SST  14.1.0
StructuralSimulationToolkit
SST::Core::Serialization::ObjectMapFundamental< T > Class Template Reference

ObjectMap object fundamental types, and classes treated as fundamental types. More...

#include <objectMap.h>

Inheritance diagram for SST::Core::Serialization::ObjectMapFundamental< T >:
SST::Core::Serialization::ObjectMap

Public Member Functions

virtual std::string get () override
 Get the value of the variable as a string. More...
 
virtual void set_impl (const std::string &value) override
 
bool isFundamental () override
 Check to see if this ObjectMap represents a fundamental or a class treated as a fundamental. More...
 
void * getAddr () override
 Get the address of the variable represented by the ObjectMap. More...
 
const std::vector< std::pair< std::string, ObjectMap * > > & getVariables () override
 Get the list of child variables contained in this ObjectMap, which in this case will be empty. More...
 
 ObjectMapFundamental (T *addr)
 
std::string getType () override
 Get the type of the variable represented by the ObjectMap. More...
 
- Public Member Functions inherited from SST::Core::Serialization::ObjectMap
 ObjectMap ()
 Default constructor primarily used for the "top" object in the hierarchy.
 
bool isReadOnly ()
 
void setReadOnly ()
 
std::string getName ()
 Get the name of the variable represented by this ObjectMap. More...
 
std::string getFullName ()
 Get the full hierarchical name of the variable represented by this ObjectMap, based on the path taken to get to this object. More...
 
void incRefCount ()
 Increament the reference counter for this object map.
 
void decRefCount ()
 Decreament the reference counter for this object map. More...
 
int32_t getRefCount ()
 Get the current reference count. More...
 
ObjectMapselectParent ()
 Get the parent for this ObjectMap. More...
 
ObjectMapselectVariable (std::string name, bool &loop_detected)
 Get the ObjectMap for the specified variable. More...
 
virtual void addVariable (const std::string &UNUSED(name), ObjectMap *UNUSED(obj))
 Adds a varaible to this ObjectMap. More...
 
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. More...
 
virtual std::string get (const std::string &var)
 Gets the value of the specified variable as a string. More...
 
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. More...
 
virtual bool isContainer ()
 Check to see if this ObjectMap represents a container. More...
 
virtual ~ObjectMap ()
 Destructor.
 
virtual std::string listVariable (std::string name, bool &found, int recurse=0)
 Create a string that lists information for the specified variable. More...
 
virtual std::string list (int recurse=0)
 Create a string that lists information for the current object. More...
 

Protected Attributes

T * addr_ = nullptr
 Address of the variable for reading and writing.
 
- Protected Attributes inherited from SST::Core::Serialization::ObjectMap
ObjectMapMetaDatamdata_ = nullptr
 Metedata object for walking the object hierarchy. More...
 
bool read_only_ = false
 Indicates wheter 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() More...
 
- 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(). More...
 
virtual void activate_callback ()
 Function that will get called when this object is selected.
 
virtual void deactivate_callback ()
 
- Static Protected Attributes inherited from SST::Core::Serialization::ObjectMap
static std::vector< std::pair< std::string, ObjectMap * > > emptyVars
 Static empty variable vector for use by versions that don't have variables (i.e. More...
 

Detailed Description

template<typename T>
class SST::Core::Serialization::ObjectMapFundamental< T >

ObjectMap object fundamental types, and classes treated as fundamental types.

In order for an object to be treated as a fundamental, it must be printable using std::to_string() and assignable using SST::Core::from_string().

Member Function Documentation

◆ get()

template<typename T>
virtual std::string SST::Core::Serialization::ObjectMapFundamental< T >::get ( )
inlineoverridevirtual

Get the value of the variable as a string.

NOTE: this function is only valid for ObjectMaps that represent fundamental types or classes treated as fundamental types.

Returns
Value of the represented variable as a string

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

References SST::Core::Serialization::ObjectMapFundamental< T >::addr_.

◆ getAddr()

template<typename T>
void* SST::Core::Serialization::ObjectMapFundamental< T >::getAddr ( )
inlineoverridevirtual

Get the address of the variable represented by the ObjectMap.

Returns
Address of varaible

Implements SST::Core::Serialization::ObjectMap.

References SST::Core::Serialization::ObjectMapFundamental< T >::addr_.

◆ getType()

template<typename T>
std::string SST::Core::Serialization::ObjectMapFundamental< T >::getType ( )
inlineoverridevirtual

Get the type of the variable represented by the ObjectMap.

Returns
Type of variable

Implements SST::Core::Serialization::ObjectMap.

References SST::Core::Serialization::ObjectMap::demangle_name().

◆ getVariables()

template<typename T>
const std::vector<std::pair<std::string, ObjectMap*> >& SST::Core::Serialization::ObjectMapFundamental< T >::getVariables ( )
inlineoverridevirtual

Get the list of child variables contained in this ObjectMap, which in this case will be empty.

Returns
Refernce to vector containing ObjectMaps for this ObjectMap's child variables. This vector will be empty because fundamentals have no children

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

References SST::Core::Serialization::ObjectMap::emptyVars.

◆ isFundamental()

template<typename T>
bool SST::Core::Serialization::ObjectMapFundamental< T >::isFundamental ( )
inlineoverridevirtual

Check to see if this ObjectMap represents a fundamental or a class treated as a fundamental.

Returns
true if this ObjectMap represents a fundamental or class treated as a fundamental, false otherwise

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


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