SST 16.0.0
Structural Simulation Toolkit
SST::Core::Serialization::ObjectMapWithChildren Class Reference

ObjectMap object for non-fundamental, non-container types. More...

#include <objectMap.h>

Inheritance diagram for SST::Core::Serialization::ObjectMapWithChildren:
SST::Core::Serialization::ObjectMap SST::Core::Serialization::ObjectMapContainer< ELEM_T > SST::Core::Serialization::ObjectMapClass SST::Core::Serialization::ObjectMapContainer< T > SST::Core::Serialization::ObjectMapHierarchyOnly SST::Core::Serialization::ObjectMapArray< ELEM_T, SIZE_T >

Public Member Functions

 ~ObjectMapWithChildren () override
 Destructor.
 ObjectMapWithChildren (const ObjectMapWithChildren &)=delete
 Disallow copying and assignment.
ObjectMapWithChildrenoperator= (const ObjectMapWithChildren &)=delete
void addVariable (const std::string &name, ObjectMap *obj) final override
 Adds a variable to this ObjectMap.
void removeVariable (const std::string &name) final override
 Removes a variable from this ObjectMap.
const ObjectMultimap & getVariables () const final override
 Get the list of child variables contained in this ObjectMap.
void refresh () override
 Refresh the children.
Public Member Functions inherited from SST::Core::Serialization::ObjectMap
 ObjectMap ()=default
 Default constructor primarily used for the "top" object in the hierarchy.
bool isReadOnly () const
 Check to see if this object is read-only.
void setReadOnly (bool state=true)
 Set the read-only state of the object.
virtual bool checkValue (const std::string &UNUSED(value)) const
 Check if value string is valid for this type.
std::string getName () const
 Get the name of the variable represented by this ObjectMap.
std::string getFullName () const
 Get the full hierarchical name of the variable represented by this ObjectMap, based on the path taken to get to this object.
virtual std::string getType () const =0
 Get the type of the variable represented by the ObjectMap.
virtual void * getAddr () const =0
 Get the address of the variable represented by the ObjectMap.
void incRefCount ()
 Increment the reference counter for this ObjectMap.
void decRefCount ()
 Decrement the reference counter for this ObjectMap.
size_t getRefCount () const
 Get the current reference count.
virtual ObjectMapComparisongetComparison (const std::string &UNUSED(name), ObjectMapComparison::Op UNUSED(op), const std::string &UNUSED(value)) const
 Get a watch point for this object.
virtual ObjectMapComparisongetComparisonVar (const std::string &UNUSED(name), ObjectMapComparison::Op UNUSED(op), const std::string &UNUSED(name2), ObjectMap *UNUSED(var2)) const
virtual ObjectBuffergetObjectBuffer (const std::string &UNUSED(name), size_t UNUSED(sz))
ObjectMapselectParent ()
 Get the parent for this ObjectMap.
ObjectMapselectVariable (std::string name, bool &loop_detected, bool confirm=false)
 Get the ObjectMap for the specified variable.
virtual void addVariable (const std::string &UNUSED(name), ObjectMap *UNUSED(obj))
 Adds a variable to this ObjectMap.
virtual void removeVariable (const std::string &UNUSED(name))
 Removes a variable from this ObjectMap.
virtual std::string get () const
 Get the value of the variable as a string.
void set (const std::string &value)
 Sets the value of the variable represented by the ObjectMap to the specified value, which is represented as a string.
virtual std::string get (const std::string &var)
 Gets the value of the specified variable as a string.
virtual void set (const std::string &var, const std::string &value, bool &found, bool &read_only)
 Sets the value of the specified variable to the specified value, which is represented as a string.
virtual bool isFundamental () const
 Check to see if this ObjectMap represents a fundamental or a class treated as a fundamental.
virtual bool isContainer () const
 Check to see if this ObjectMap represents a container.
virtual ~ObjectMap ()=default
 Destructor.
 ObjectMap (const ObjectMap &)=delete
 Disallow copying and assignment.
ObjectMapoperator= (const ObjectMap &)=delete
virtual std::string listVariable (std::string name, bool &found, int recurse=0)
 Create a string that lists information for the specified variable.
virtual std::string list (int recurse=0)
 Create a string that lists information for the current object.
ObjectMapfindVariable (const std::string &name, bool confirm=false) const
 Find a variable in this object map.

Protected Member Functions

 ObjectMapWithChildren ()=default
 Default constructor.
Protected Member Functions inherited from SST::Core::Serialization::ObjectMap
virtual void set_impl (const std::string &UNUSED(value))
 Function implemented by derived classes to implement set().
virtual void activate_callback ()
 Function that will get called when this object is selected.
virtual void deactivate_callback ()
 Function that will get called when this object is deactivated (i.e selectParent() is called).

Protected Attributes

ObjectMultimap variables_
 Map that child ObjectMaps are stored in.
Protected Attributes inherited from SST::Core::Serialization::ObjectMap
ObjectMapMetaDatamdata_ = nullptr
 Metadata object for walking the object hierarchy.
bool read_only_ = false
 Indicates whether or not the variable is read-only.

Additional Inherited Members

Static Public Member Functions inherited from SST::Core::Serialization::ObjectMap
static std::string demangle_name (const char *name)
 Static function to demangle type names returned from typeid(T).name().

Detailed Description

ObjectMap object for non-fundamental, non-container types.

This class allows for child variables.

Constructor & Destructor Documentation

◆ ~ObjectMapWithChildren()

SST::Core::Serialization::ObjectMapWithChildren::~ObjectMapWithChildren ( )
inlineoverride

Destructor.

Should not be called directly (i.e. do not call delete on the object). Call decRefCount() when object is no longer needed. This will also call decRefCount() on all its children.

References variables_.

Member Function Documentation

◆ addVariable()

void SST::Core::Serialization::ObjectMapWithChildren::addVariable ( const std::string & name,
ObjectMap * obj )
inlinefinaloverride

Adds a variable to this ObjectMap.

Parameters
nameName of the object in the context of this ObjectMap
objObjectMap to add as a variable

References SST::Core::Serialization::ObjectMap::ObjectMap(), and variables_.

◆ getVariables()

const ObjectMultimap & SST::Core::Serialization::ObjectMapWithChildren::getVariables ( ) const
inlinefinaloverridevirtual

Get the list of child variables contained in this ObjectMap.

Returns
Reference to map containing ObjectMaps for this ObjectMap's child variables. pair.first is the name of the variable in the context of this object. pair.second is a pointer to the ObjectMap.

Reimplemented from SST::Core::Serialization::ObjectMap.

References variables_.

◆ refresh()

void SST::Core::Serialization::ObjectMapWithChildren::refresh ( )
inlineoverridevirtual

Refresh the children.

Reimplemented from SST::Core::Serialization::ObjectMap.

References variables_.

◆ removeVariable()

void SST::Core::Serialization::ObjectMapWithChildren::removeVariable ( const std::string & name)
inlinefinaloverride

Removes a variable from this ObjectMap.

Parameters
nameName of the object in the context of this ObjectMap

References variables_.


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