SST  11.0.0
StructuralSimulationToolkit
SST::SharedRegion Class Reference
Inheritance diagram for SST::SharedRegion:
SST::SharedRegionImpl

Data Structures

class  DeferredPointer
 
class  DeferredPointerBase
 

Public Member Functions

void shutdown ()
 
size_t getLocalShareID () const
 
size_t getSize () const
 
void publish ()
 Call to denote that you are done making any changes to this region.
 
bool isReady () const
 Check to see if the region is ready (all elements requesting the region have called publish()). More...
 
void modifyRegion (size_t offset, size_t length, const void *data)
 Before the region has published, apply a modification. More...
 
template<typename T >
void modifyArray (size_t offset, const T &data)
 Before the region has published, apply a modification. More...
 
void * getRawPtr ()
 
template<typename T >
getPtr () const
 Get a pointer to the const shared data. More...
 
template<typename T >
void getPtrDeferred (T &ptr)
 Used to get a pointer to the const shared data when the element doesn't yet know the size. More...
 

Protected Member Functions

 SharedRegion (SharedRegionManager *manager, size_t id)
 

Protected Attributes

DeferredPointerBasedeferred_pointer
 

Member Function Documentation

size_t SST::SharedRegion::getLocalShareID ( ) const
inline
Returns
The ID of this instance. (Number in range 0->N)
template<typename T >
T SST::SharedRegion::getPtr ( ) const
inline

Get a pointer to the const shared data.

Returns
a const pointer to the shared memory region. This function cannot be called if the size is still set to 0, as there is no backing memory yet.
template<typename T >
void SST::SharedRegion::getPtrDeferred ( T &  ptr)
inline

Used to get a pointer to the const shared data when the element doesn't yet know the size.

This will defer setting the pointer until the size of the region is known (and therefor the memory has been allocated). This allows an element to initialize the region and get the pointer without having to make the call to getPtr() later. This is particularly helpful if the SharedRegion is created in an object that doesn't get called during init() or setup().

Pointer that should be set once the size is known. User can tell pointer is valid when getSize() returns a value != 0.

References getSize().

void* SST::SharedRegion::getRawPtr ( )
inline
Returns
a void* pointer to the shared memory region This pointer is only valid to write to before a call to publish(). This function cannot be called if the size is still set to 0, as there is no backing memory yet.
size_t SST::SharedRegion::getSize ( ) const
inline
Returns
The size of the shared memory region, may return 0 if this copy of the region doesn't know the final size yet.

Referenced by getPtrDeferred().

bool SST::SharedRegion::isReady ( ) const
inline

Check to see if the region is ready (all elements requesting the region have called publish()).

Returns
True if the region is ready to use (all sharers have called publish()).
template<typename T >
void SST::SharedRegion::modifyArray ( size_t  offset,
const T &  data 
)
inline

Before the region has published, apply a modification.

(Copy this data in). This function cannot be called if the size is still set to 0.

void SST::SharedRegion::modifyRegion ( size_t  offset,
size_t  length,
const void *  data 
)
inline

Before the region has published, apply a modification.

(Copy this data in). This function cannot be called if the size is still set to 0.


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