SST 16.0.0
Structural Simulation Toolkit
SST::Core::Serialization::ObjectMapFundamental< T, REF > Class Template Reference

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

#include <objectMap.h>

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

Public Member Functions

virtual void set_impl (const std::string &value) override
 Set the value of the object represented as a string.
bool checkValue (const std::string &value) const override
std::string get () const override
 Get the value of the object as a string.
bool isFundamental () const final override
 Returns true as object is a fundamental.
void * getAddr () const override
 Get the address of the variable represented by the ObjectMap.
 ObjectMapFundamental (REF *addr)
 ~ObjectMapFundamental () override=default
 Destructor.
 ObjectMapFundamental (const ObjectMapFundamental &)=delete
 Disallow copying and assignment.
ObjectMapFundamental & operator= (const ObjectMapFundamental &)=delete
std::string getType () const override
 Return the type represented by this ObjectMap as given by the demangled version of typeid(T).name().
ObjectMapComparisongetComparison (const std::string &name, ObjectMapComparison::Op op, const std::string &value) const override
ObjectMapComparisongetComparisonVar (const std::string &name, ObjectMapComparison::Op UNUSED(op), const std::string &name2, ObjectMap *var2) const override
ObjectBuffergetObjectBuffer (const std::string &name, size_t sz) override
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 const ObjectMultimap & getVariables () const
 Get the list of child variables contained in this 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.
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 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.
virtual void refresh ()
 Refresh the ObjectMap, reconstructing children.

Protected Attributes

REF * addr_ = nullptr
 Address of the variable for reading and writing.
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().
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).

Detailed Description

template<typename T, typename REF = T>
class SST::Core::Serialization::ObjectMapFundamental< T, REF >

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

In order for an object to be treated as a fundamental, it must be printable using SST::Core::to_string() and assignable using SST::Core::from_string(). If this is not true, it is possible to create a template specialization for the type desired to be treated as a fundamental. The specialization will need to provide the functions for getting and setting the values as a string.

REF defaults to T, but may be a type like std::vector<bool>::reference or std::bitset<N>::reference indicating a proxy reference to the object.

Constructor & Destructor Documentation

◆ ~ObjectMapFundamental()

template<typename T, typename REF = T>
SST::Core::Serialization::ObjectMapFundamental< T, REF >::~ObjectMapFundamental ( )
overridedefault

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.

Member Function Documentation

◆ get()

template<typename T, typename REF = T>
std::string SST::Core::Serialization::ObjectMapFundamental< T, REF >::get ( ) const
inlineoverridevirtual

Get the value of the object as a string.

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

References addr_.

◆ getAddr()

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

Get the address of the variable represented by the ObjectMap.

Returns
Address of variable

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

References addr_.

◆ getType()

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

Return the type represented by this ObjectMap as given by the demangled version of typeid(T).name().

Returns
type of underlying object

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

Reimplemented in SST::Core::Serialization::ObjectMapFundamentalReference< T, REF, PTYPE >.

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

◆ isFundamental()

template<typename T, typename REF = T>
bool SST::Core::Serialization::ObjectMapFundamental< T, REF >::isFundamental ( ) const
inlinefinaloverridevirtual

Returns true as object is a fundamental.

Returns
true

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

◆ set_impl()

template<typename T, typename REF = T>
virtual void SST::Core::Serialization::ObjectMapFundamental< T, REF >::set_impl ( const std::string & value)
inlineoverridevirtual

Set the value of the object represented as a string.

Parameters
valueValue to set the underlying object to, represented as a string

References addr_.


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