This class defines a shared-memory region between a master process and one or more child processes Region has three data structures:
More...
#include <tunneldef.h>
|
| TunnelDef (size_t numBuffers, size_t bufferSize, uint32_t expectedChildren) |
| Create a new tunnel. More...
|
|
| TunnelDef (void *sPtr) |
| Access an existing tunnel Child creates the TunnelDef, reads the shmSize, and then resizes its map accordingly. More...
|
|
uint32_t | initialize (void *sPtr) |
| Finish setting up a tunnel once the manager knows the correct size of the tunnel and has mmap'd a large enough region for it. More...
|
|
virtual | ~TunnelDef () |
| Destructor.
|
|
void | shutdown () |
| Clean up a region.
|
|
size_t | getTunnelSize () |
| return size of tunnel
|
|
ShareDataType * | getSharedData () |
| return a pointer to the ShareDataType region
|
|
void | writeMessage (size_t buffer, const MsgType &command) |
| Write data to buffer, blocks until space is available. More...
|
|
MsgType | readMessage (size_t buffer) |
| Read data from buffer, blocks until message received. More...
|
|
bool | readMessageNB (size_t buffer, MsgType *result) |
| Read data from buffer, non-blocking. More...
|
|
void | clearBuffer (size_t buffer) |
| Empty the messages in a buffer. More...
|
|
bool | isMaster () |
| return whether this is a master-side tunnel or a child
|
|
|
ShareDataType * | sharedData |
| Pointer to the Shared Data Region.
|
|
template<typename ShareDataType, typename MsgType>
class SST::Core::Interprocess::TunnelDef< ShareDataType, MsgType >
This class defines a shared-memory region between a master process and one or more child processes Region has three data structures:
- internal bookkeeping (InternalSharedData),
- user defined shared data (ShareDataType)
- multiple circular-buffer queues with entries of type MsgType
- Template Parameters
-
ShareDataType | Type to put in the shared data region |
MsgType | Type of messages being sent in the circular buffers |
template<typename ShareDataType , typename MsgType >
Create a new tunnel.
- Parameters
-
numBuffers | Number of buffers for which we should tunnel |
bufferSize | How large each buffer should be |
expectedChildren | Number of child processes that will connect to this tunnel |
template<typename ShareDataType , typename MsgType >
Access an existing tunnel Child creates the TunnelDef, reads the shmSize, and then resizes its map accordingly.
- Parameters
-
sPtr | Location of shared memory region |
template<typename ShareDataType , typename MsgType >
Empty the messages in a buffer.
- Parameters
-
buffer | which buffer to empty |
template<typename ShareDataType , typename MsgType >
template<typename ShareDataType , typename MsgType >
Read data from buffer, blocks until message received.
- Parameters
-
buffer | which buffer to read from return the message |
template<typename ShareDataType , typename MsgType >
Read data from buffer, non-blocking.
- Parameters
-
buffer | which buffer to read from |
result | pointer to return read message at return whether a message was read |
template<typename ShareDataType , typename MsgType >
Write data to buffer, blocks until space is available.
- Parameters
-
buffer | which buffer index to write to |
command | message to write to buffer |
The documentation for this class was generated from the following file: