![]() |
MAK RTIspy API Documentation for HLA Evolved
|
DtRtiSmSocket provides access to shared memory via a subscribable message queue tailored to the need of the RTI. More...
Inheritance diagram for DtRtiSmSocket:
Collaboration diagram for DtRtiSmSocket:Classes | |
| class | DtRtiSmSocketBundleBuff |
Public Member Functions | |
| DtRtiSmSocket (const char *sharename, DtBoost::shared_ptr< DtMsgHeaderReader > hdrReader) | |
| virtual | ~DtRtiSmSocket () |
| virtual bool | initializeSmQueue (DtU32 id=DtSM_INVALID_SUBSCRIBER_ID, bool forceSubscribe=false) |
| Attach to RTI specific variant of shared memory message queue. | |
| virtual bool | initializeSmQueue (DtU32 numBuckets, DtU32 payloadSize, bool reliableQueue, DtU32 id=DtSM_INVALID_SUBSCRIBER_ID, bool forceSubscribe=false) |
| The following version of initializeSmQueue() is specific to management of the shared memory subscribable message queue which the socket interfaces with. | |
| virtual int | sendMessage (caddr_t msg, size_t msgSize, bool deleteAfterSend, unsigned int flags, const DtInetAddr &destAddr=DtInetAddr::inaddrAny()) |
| The send method takes an extra flags parameter which identifies the transport method (DtReliable or DtBestEffort) and priority. | |
| virtual bool | flush () |
| Send buffered messages. | |
| virtual int | getMsgTransportInfo (DtInetAddr *addr, DtU32 *transAndPriority) |
| This receive method returns the size of the next message in shared memory as well as additional information needed by a forwarder or shared memory queue manager net I/O handler to pass messages to the network. | |
| virtual DtSmSubscribableMessageQueue__rti__ * | msgQueue () const |
| Return pointer to the attached queue. | |
| virtual bool | queueIsReliable () const |
| Query the queue to see if it is configured to operate in reliable mode. | |
| virtual int | waitForMessages (MAKRti::DtTime waitTime=0.0) |
| These methods are substitutes for using 'select()' calls on net sockets to check for messages. | |
| virtual int | waitUntilFull (MAKRti::DtTime waitTime=0.0) |
| Wait (block) for the specified time until the shared memory is full. | |
| virtual void | setReceiveMask (DtU32 rcvMask) |
| Set the message retrieval characteristics for this socket. | |
| virtual void | setAnonFilter (bool onOrOff) |
| Enable or disable filtering of anonymous MOM messages. | |
| virtual DtInetSockState | state () const |
| Returns the state of the socket. | |
Protected Types | |
| typedef std::vector< char > | Buffer |
| typedef std::map < MAKRti::DtInetAddr, DtRtiSmSocketBundleBuff > | RtiBufferMap |
Protected Member Functions | |
| DtRtiSmSocket (const DtRtiSmSocket &) | |
| Not Implemented. | |
| DtRtiSmSocket & | operator= (const DtRtiSmSocket &) |
| Not Implemented. | |
| virtual int | recv (caddr_t *buffptr, DtInetEndpoint *ep) |
| Gets the next message from the incoming data. | |
| virtual bool | filterAnonMsgs (caddr_t buffptr, DtU32 msgSenderId) |
Protected Attributes | |
| MAKRti::DtString | mySharedMemName |
| DtRtiSubscribableMessageQueue * | myRtiSmMsgQueue |
| DtU32 | myRecvMask |
| bool | myAnonFilterEnabled |
| RtiBufferMap | myRtiBufferMap |
| DtInetSockState | myState |
| The current state of the socket. | |
Friends | |
| class | DtRtiSmSocketBundleBuff |
DtRtiSmSocket provides access to shared memory via a subscribable message queue tailored to the need of the RTI.
DtRtiSmSocket isn't really a socket in the classical 'BSD sockets' sense. It is an interface abstraction that mirrors socket functionality to allow applications to easily use either network I/O or shared memory for communication using the same general interface. Where this flexibility is not a paramount concern direct access to the subscribable message queue is more efficient.
typedef std::vector<char> DtRtiSmSocket::Buffer [protected] |
typedef std::map< MAKRti::DtInetAddr, DtRtiSmSocketBundleBuff > DtRtiSmSocket::RtiBufferMap [protected] |
| DtRtiSmSocket::DtRtiSmSocket | ( | const char * | sharename, |
| DtBoost::shared_ptr< DtMsgHeaderReader > | hdrReader | ||
| ) |
| DtRtiSmSocket::~DtRtiSmSocket | ( | ) | [virtual] |
References myRtiSmMsgQueue.
| DtRtiSmSocket::DtRtiSmSocket | ( | const DtRtiSmSocket & | ) | [protected] |
Not Implemented.
| bool DtRtiSmSocket::filterAnonMsgs | ( | caddr_t | buffptr, |
| DtU32 | msgSenderId | ||
| ) | [protected, virtual] |
References DtNetMsgHeader::fedHandle.
Referenced by recv().
| bool DtRtiSmSocket::flush | ( | ) | [virtual] |
Send buffered messages.
Returns indication of whether flush is complete or incomplete.
Reimplemented from DtSmSocket__rti__.
References myRtiBufferMap, and sendMessage().
Referenced by DtSmRtiConnection::flush().
| int DtRtiSmSocket::getMsgTransportInfo | ( | DtInetAddr * | addr, |
| DtU32 * | transAndPriority | ||
| ) | [virtual] |
This receive method returns the size of the next message in shared memory as well as additional information needed by a forwarder or shared memory queue manager net I/O handler to pass messages to the network.
References DtRtiSubscribableMessageQueue::getRcvMsgTransportInfo(), DtRtiSubscribableMessageQueue::isEmpty(), and myRtiSmMsgQueue.
Referenced by DtSmRtiConnection::getMessageNetInfo().
| bool DtRtiSmSocket::initializeSmQueue | ( | DtU32 | id = DtSM_INVALID_SUBSCRIBER_ID, |
| bool | forceSubscribe = false |
||
| ) | [virtual] |
Attach to RTI specific variant of shared memory message queue.
If 'id' is not specified one will be assigned automatically. For use by non- manager subscribers.
Reimplemented from DtSmSocket__rti__.
References DtSMQ_FETCH_ALL, myRtiSmMsgQueue, mySharedMemName, myState, and DtRtiSubscribableMessageQueue::subscribe().
Referenced by DtSmConnectionMgr::createSharedMemConn(), and initializeSmQueue().
| bool DtRtiSmSocket::initializeSmQueue | ( | DtU32 | numBuckets, |
| DtU32 | payloadSize, | ||
| bool | reliableQueue, | ||
| DtU32 | id = DtSM_INVALID_SUBSCRIBER_ID, |
||
| bool | forceSubscribe = false |
||
| ) | [virtual] |
The following version of initializeSmQueue() is specific to management of the shared memory subscribable message queue which the socket interfaces with.
These should only be used by a queue manager, not by ordinary subscribers. It must be called once and only once prior to use of the message queue.
References DtSMQ_SKIP_MINE, DtSmqEnqueueReliableMode, initializeSmQueue(), DtRtiSubscribableMessageQueue::initSyncVars(), myRtiSmMsgQueue, myState, DtRtiSubscribableMessageQueue::resetQueue(), and DtRtiSubscribableMessageQueue::setEnqueueMode().
| DtSmSubscribableMessageQueue__rti__ * DtRtiSmSocket::msgQueue | ( | ) | const [virtual] |
Return pointer to the attached queue.
Reimplemented from DtSmSocket__rti__.
References myRtiSmMsgQueue.
Referenced by recv().
| DtRtiSmSocket& DtRtiSmSocket::operator= | ( | const DtRtiSmSocket & | ) | [protected] |
Not Implemented.
| bool DtRtiSmSocket::queueIsReliable | ( | ) | const [virtual] |
Query the queue to see if it is configured to operate in reliable mode.
References myRtiSmMsgQueue, and DtRtiSubscribableMessageQueue::queueIsReliable().
Referenced by DtSmRtiConnection::isReliable(), and DtSmRtiConnection::send().
| int DtRtiSmSocket::recv | ( | caddr_t * | buffptr, |
| DtInetEndpoint * | ep | ||
| ) | [protected, virtual] |
Gets the next message from the incoming data.
Reimplemented from DtSmSocket__rti__.
References filterAnonMsgs(), DtRtiSubscribableMessageQueue::getRcvMsgSenderInfo(), msgQueue(), myAnonFilterEnabled, DtMsgSocket::myRecvBuffer, myRtiSmMsgQueue, and NULL.
| int DtRtiSmSocket::sendMessage | ( | caddr_t | msg, |
| size_t | msgSize, | ||
| bool | deleteAfterSend, | ||
| unsigned int | flags, | ||
| const DtInetAddr & | destAddr = DtInetAddr::inaddrAny() |
||
| ) | [virtual] |
The send method takes an extra flags parameter which identifies the transport method (DtReliable or DtBestEffort) and priority.
References myRtiSmMsgQueue, and DtRtiSubscribableMessageQueue::sendMessage().
Referenced by DtSmRtiConnection::flush(), flush(), and DtSmRtiConnection::send().
| void DtRtiSmSocket::setAnonFilter | ( | bool | onOrOff | ) | [virtual] |
Enable or disable filtering of anonymous MOM messages.
Enabled by default for federate LRCs employing shared memory. Must be disabled by shared memory queue manager connection manager to allow these messages to be forwarded to the network.
References myAnonFilterEnabled.
| void DtRtiSmSocket::setReceiveMask | ( | DtU32 | rcvMask | ) | [virtual] |
Set the message retrieval characteristics for this socket.
Options allow for all messages or only a subset of messages in shared memory to be retrieved based on message originator, transport method, or priority
References myRecvMask.
Referenced by DtSmConnectionMgr::createSharedMemConn().
| DtInetSockState DtRtiSmSocket::state | ( | ) | const [virtual] |
| int DtRtiSmSocket::waitForMessages | ( | MAKRti::DtTime | waitTime = 0.0 | ) | [virtual] |
These methods are substitutes for using 'select()' calls on net sockets to check for messages.
The Win32 implementation of shared memory does not provide a way to get a file descriptor suitable for use in a select() call (shm_open() should work in Unix/Linux). Wait (block) for the specified time until a message can be read. Return status: 0 if messages are ready, > 0 if wait expired, or < 0 if error
References myRtiSmMsgQueue, and DtRtiSubscribableMessageQueue::waitForMessages().
Referenced by DtSmRtiConnection::waitForMessages().
| int DtRtiSmSocket::waitUntilFull | ( | MAKRti::DtTime | waitTime = 0.0 | ) | [virtual] |
Wait (block) for the specified time until the shared memory is full.
Return status: 0 if full, > 0 if wait expired, or < 0 if error
References myRtiSmMsgQueue, and DtRtiSubscribableMessageQueue::waitUntilFull().
Referenced by DtSmRtiConnection::waitUntilFull().
friend class DtRtiSmSocketBundleBuff [friend] |
bool DtRtiSmSocket::myAnonFilterEnabled [protected] |
Referenced by recv(), and setAnonFilter().
DtU32 DtRtiSmSocket::myRecvMask [protected] |
Referenced by setReceiveMask().
RtiBufferMap DtRtiSmSocket::myRtiBufferMap [protected] |
Referenced by flush().
Referenced by getMsgTransportInfo(), initializeSmQueue(), msgQueue(), queueIsReliable(), recv(), sendMessage(), waitForMessages(), waitUntilFull(), and ~DtRtiSmSocket().
MAKRti::DtString DtRtiSmSocket::mySharedMemName [protected] |
Reimplemented from DtSmSocket__rti__.
Referenced by initializeSmQueue().
DtInetSockState DtRtiSmSocket::myState [protected] |
The current state of the socket.
Referenced by initializeSmQueue(), and state().