SST  11.0.0
StructuralSimulationToolkit
SST::Shared::SharedObjectData Class Referenceabstract

Base class for holding SharedObject data. More...

#include <sharedObject.h>

Inherited by SST::Shared::SharedArray< T >::Data, SST::Shared::SharedArray< bool >::Data, SST::Shared::SharedMap< keyT, valT >::Data, and SST::Shared::SharedSet< valT >::Data.

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...
 

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 SharedObjectChangeSetgetChangeSet ()=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.
 

Protected Attributes

std::string name
 
int share_count
 
int publish_count
 
bool fully_published
 
bool locked
 
std::mutex mtx
 

Friends

class SharedObjectDataManager
 
class SharedObject
 

Detailed Description

Base class for holding SharedObject data.

The base class is needed so that we can have an API to manage unknown types of objects.

Constructor & Destructor Documentation

SST::Shared::SharedObjectData::SharedObjectData ( const std::string &  name)
inlineprotected

Constructor for SharedObjectData.

Parameters
namename of the SharedObject

Member Function Documentation

virtual SharedObjectChangeSet* SST::Shared::SharedObjectData::getChangeSet ( )
protectedpure virtual

Gets the changeset for this data on this rank.

This is called by the core when exchanging and merging data

const std::string& SST::Shared::SharedObjectData::getName ( )
inline

Get the name of the SharedObject for this data.

Returns
name of data
virtual int SST::Shared::SharedObjectData::getPublishCount ( )
inlinevirtual

Get the number of instances that have called publish() on their instance of the shared object.

Returns
number of instances that have called publish()
virtual int SST::Shared::SharedObjectData::getShareCount ( )
inlinevirtual

Get the number of sharers for this data.

Returns
number of sharers
virtual void SST::Shared::SharedObjectData::incPublishCount ( )
inlineprotectedvirtual

Increment the count of instances that have called publish.

This should only be called once per instance.

References lock().

virtual int SST::Shared::SharedObjectData::incShareCount ( )
inlineprotectedvirtual

Increment the count of sharers.

This should only be called once per instance.

References lock().

bool SST::Shared::SharedObjectData::isFullyPublished ( )
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.

Returns
true if all instances have called publish(), false otherwise.
virtual void SST::Shared::SharedObjectData::resetChangeSet ( )
protectedpure virtual

Resets the changeset for this data on this rank.

This is called by the core when exchanging and merging data


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