SST
14.0.0
StructuralSimulationToolkit
|
Base class for holding SharedObject data. More...
#include <sharedObject.h>
Public Member Functions | |
const std::string & | getName () |
Get the name of the SharedObject for this data. More... | |
bool | isFullyPublished () |
Checks to see if all instances of this SharedObject have called publish(). More... | |
virtual int | getShareCount () |
Get the number of sharers for this data. More... | |
virtual int | getPublishCount () |
Get the number of instances that have called publish() on their instance of the shared object. More... | |
Public Member Functions inherited from SST::Core::Serialization::serializable | |
virtual const char * | cls_name () const =0 |
virtual uint32_t | cls_id () const =0 |
virtual std::string | serialization_name () const =0 |
Protected Member Functions | |
void | check_lock_for_write (const std::string &obj) |
virtual int | incShareCount () |
Increment the count of sharers. More... | |
virtual void | incPublishCount () |
Increment the count of instances that have called publish. More... | |
virtual SharedObjectChangeSet * | getChangeSet ()=0 |
Gets the changeset for this data on this rank. More... | |
virtual void | resetChangeSet ()=0 |
Resets the changeset for this data on this rank. More... | |
void | lock () |
Called by the core when writing to shared regions is no longer allowed. | |
SharedObjectData (const std::string &name) | |
Constructor for SharedObjectData. More... | |
virtual | ~SharedObjectData () |
Destructor for SharedObjectData. | |
void | serialize_order (SST::Core::Serialization::serializer &ser) override |
ImplementVirtualSerializable (SharedObjectData) | |
Protected Attributes | |
std::string | name |
int | share_count |
int | publish_count |
bool | fully_published |
bool | locked |
std::mutex | mtx |
Friends | |
class | SharedObjectDataManager |
class | SharedObject |
Additional Inherited Members | |
Static Public Attributes inherited from SST::Core::Serialization::serializable | |
static constexpr uint32_t | NullClsId = std::numeric_limits<uint32_t>::max() |
Protected Types inherited from SST::Core::Serialization::serializable | |
enum | cxn_flag_t { ConstructorFlag } |
Static Protected Member Functions inherited from SST::Core::Serialization::serializable | |
static void | serializable_abort (uint32_t line, const char *file, const char *func, const char *obj) |
Base class for holding SharedObject data.
The base class is needed so that we can have an API to manage unknown types of objects.
|
inlineprotected |
Constructor for SharedObjectData.
name | name of the SharedObject |
|
protectedpure virtual |
Gets the changeset for this data on this rank.
This is called by the core when exchanging and merging data
Implemented in SST::Shared::SharedArray< bool >::Data, SST::Shared::SharedArray< T >::Data, SST::Shared::SharedMap< keyT, valT >::Data, and SST::Shared::SharedSet< valT >::Data.
|
inline |
Get the name of the SharedObject for this data.
Referenced by SST::Shared::SharedSet< SST::CoreTestSharedObjectsComponent::setItem >::insert(), SST::Shared::SharedArray< int >::write(), and SST::Shared::SharedMap< int, int >::write().
|
inlinevirtual |
Get the number of instances that have called publish() on their instance of the shared object.
|
inlinevirtual |
Get the number of sharers for this data.
|
inlineprotectedvirtual |
Increment the count of instances that have called publish.
This should only be called once per instance.
References lock().
|
inlineprotectedvirtual |
|
inline |
Checks to see if all instances of this SharedObject have called publish().
This is forced to true before the setup() phase of simulation, as no more writes are allowed.
Referenced by SST::Shared::SharedSet< SST::CoreTestSharedObjectsComponent::setItem >::isFullyPublished(), SST::Shared::SharedArray< int >::isFullyPublished(), and SST::Shared::SharedMap< int, int >::isFullyPublished().
|
protectedpure virtual |
Resets the changeset for this data on this rank.
This is called by the core when exchanging and merging data
Implemented in SST::Shared::SharedArray< bool >::Data, SST::Shared::SharedArray< T >::Data, SST::Shared::SharedMap< keyT, valT >::Data, and SST::Shared::SharedSet< valT >::Data.