SST 16.1.0
Structural Simulation Toolkit
SST::Core::Serialization::ContainerObj Class Reference
Inheritance diagram for SST::Core::Serialization::ContainerObj:
SST::Core::Serialization::ObjTree< ContainerObj > SST::Core::Serialization::ObjTreeCont

Public Member Functions

 ContainerObj (const std::string &name, const std::string &type, size_t size, ObjectMap *source)
 ContainerObj (const ContainerObj &rhs)
ContainerObj & operator= (const ContainerObj &rhs)
ObjTreeCont * clone () const override
const std::string & getContainerType () const
size_t getSize () const
void syncFromSim () override
 This function will update the local stored node value with the live value in the sst simulation.
bool hasChanged () override
 This function will compare the stored the node value with the live simulation value.
void apply () override
void Dump (const int verbosity, std::ios_base::fmtflags base=std::ios_base::dec, std::ostream &os=std::cout) override
 Print the contents of the node to the stream specified by os.
ObjTreeCont * getElementAt (std::vector< size_t > indices) const
void printElementAt (std::vector< size_t > indices, int verbosity=1, std::ios_base::fmtflags base=std::ios_base::dec, std::ostream &os=std::cout) const
bool setElementFromString (std::vector< size_t > indices, std::string val)
Public Member Functions inherited from SST::Core::Serialization::ObjTree< ContainerObj >
ObjTree< ContainerObj > & operator= (const ObjTree< ContainerObj > &other)
void BuildTree (const ComponentInfoMap &compMap)
 Each time we break into the debugger we rebuild the ObjectTree based on the current ComponentInfoMap.
ContainerObj & getObj ()
void applyRecursiveByType (Func &&func)
std::string getTypeName () const override
bool isEmpty ()
void Dump (const int verbosity, std::ios_base::fmtflags base=std::ios_base::dec, std::ostream &os=std::cout) override
 Print the contents of the node to the stream specified by os.
void clear () override
 Clears the entire Object Tree and frees all nodes.
Public Member Functions inherited from SST::Core::Serialization::ObjTreeCont
 ObjTreeCont (const std::string &name, const std::string &type, NodeKind kind=NodeKind::Generic)
 ObjTreeCont (const ObjTreeCont &rhs)
ObjTreeCont & operator= (const ObjTreeCont &rhs)
void addChildObj (ObjTreeCont *obj)
 Adds a child node to the current node.
void setParent (ObjTreeCont *p)
ObjTreeCont * getParent () const
const std::vector< std::unique_ptr< ObjTreeCont > > & getChildren () const
const std::string & getObjName () const
const std::string & getType () const
void setName (const std::string &name)
void setType (const std::string &type)
 Set the type of the node - this comes from ObjectMap/Serialization.
bool isRoot ()
 Returns true if this is the top of the tree - determined by the parent pointer being nullptr.
void makeReadOnly ()
 Function that will be called if during conversion from ObjectMap the node has been marked as ReadOnly.
bool isReadOnly ()
template<typename Func>
void applyRecursive (Func &&func)
 Apply a function to all children of this node regardless of type, etc.
template<typename ObjectType, typename Func>
void applyRecursiveByType (Func &&func)
 Apply a function to all children of this node of a specific type.
template<typename ObjectType, typename Func>
ObjectType * findByType (Func &&predicate)
 Find the first instance of a particular type in this node's children_ that matches criteria set by predicate.
ObjTreeCont * findByName (const std::string name)
 Find the first instance of a child with name_ matching name.
virtual bool setFromString (const std::string &value)
 Set the value stored in the node from a string.
NodeKind getKind () const
bool isComponent () const
bool isLeaf () const

Additional Inherited Members

Public Types inherited from SST::Core::Serialization::ObjTreeCont
enum class  NodeKind {
  Generic , Integer , Float , String ,
  Bool , Component , Container , FRef ,
  GenericVal
}
Static Protected Member Functions inherited from SST::Core::Serialization::ObjTreeCont
static void replaceAll (std::string &s, std::string_view from, std::string_view to)
static std::string prettifyType (std::string t)
Protected Attributes inherited from SST::Core::Serialization::ObjTree< ContainerObj >
std::vector< std::unique_ptr< ObjTreeCont > > objects_
Protected Attributes inherited from SST::Core::Serialization::ObjTreeCont
ObjTreeCont * parent_ = nullptr
std::vector< std::unique_ptr< ObjTreeCont > > children_
std::string name_ = "uninit"
std::string type_ = "uninit"
NodeKind kind_ = NodeKind::Generic
bool readOnly_ = false

Member Function Documentation

◆ apply()

void SST::Core::Serialization::ContainerObj::apply ( )
inlineoverridevirtual

◆ clone()

ObjTreeCont * SST::Core::Serialization::ContainerObj::clone ( ) const
inlineoverridevirtual

◆ Dump()

void SST::Core::Serialization::ContainerObj::Dump ( const int verbosity,
std::ios_base::fmtflags base = std::ios_base::dec,
std::ostream & os = std::cout )
inlineoverridevirtual

Print the contents of the node to the stream specified by os.

Verbosity Level 0 will only print "/" - applicable to the root node only. Any higher Verbosity will trigger a call to Dump() to all children.

Parameters
verbosity- Level 0: Print this node only, which for the base class is "/" Level > 0: Call Dump on all children_
base- Control the base (dec, hex, oct) to print numerical values in. Default dec.
os- Stream to send the output. Default std::cout
Returns
pointer to node, if found, nullptr otherwise

Reimplemented from SST::Core::Serialization::ObjTreeCont.

References SST::Core::Serialization::ObjTreeCont::applyRecursive(), and SST::Core::Serialization::ObjTreeCont::Dump().

◆ hasChanged()

bool SST::Core::Serialization::ContainerObj::hasChanged ( )
inlineoverridevirtual

This function will compare the stored the node value with the live simulation value.

This function will NOT modify the stored value - an independent call to syncFromSim() is required.

Returns
true if the value in the live simulation differs from the stored node value. false otherwise

Reimplemented from SST::Core::Serialization::ObjTreeCont.

◆ syncFromSim()

void SST::Core::Serialization::ContainerObj::syncFromSim ( )
inlineoverridevirtual

This function will update the local stored node value with the live value in the sst simulation.

Reimplemented from SST::Core::Serialization::ObjTreeCont.


The documentation for this class was generated from the following file: