MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
DtRtiSmSocket Class Reference

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, std::shared_ptr< DtMsgHeaderReader > hdrReader)
 
virtual ~DtRtiSmSocket ()
 
virtual bool initializeSmQueue (MAKRti::DtU32 id=DtSM_INVALID_SUBSCRIBER_ID, bool forceSubscribe=false)
 Attach to RTI specific variant of shared memory message queue. More...
 
virtual bool initializeSmQueue (MAKRti::DtU32 numBuckets, MAKRti::DtU32 payloadSize, bool reliableQueue, MAKRti::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. More...
 
virtual int sendMessage (caddr_t msg, size_t msgSize, bool deleteAfterSend, unsigned int flags, const MAKRti::DtInetAddr &destAddr=MAKRti::DtInetAddr::inaddrAny())
 The send method takes an extra flags parameter which identifies the transport method (DtReliable or DtBestEffort) and priority. More...
 
virtual bool flush ()
 Send buffered messages. More...
 
virtual int getMsgTransportInfo (MAKRti::DtInetAddr *addr, MAKRti::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. More...
 
virtual
MAKRti::DtSmSubscribableMessageQueue__rti__ * 
msgQueue () const
 Return pointer to the attached queue. More...
 
virtual bool queueIsReliable () const
 Query the queue to see if it is configured to operate in reliable mode. More...
 
virtual int waitForMessages (MAKRti::DtTime waitTime=0.0)
 These methods are substitutes for using 'select()' calls on net sockets to check for messages. More...
 
virtual int waitUntilFull (MAKRti::DtTime waitTime=0.0)
 Wait (block) for the specified time until the shared memory is full. More...
 
virtual void setReceiveMask (MAKRti::DtU32 rcvMask)
 Set the message retrieval characteristics for this socket. More...
 
virtual void setAnonFilter (bool onOrOff)
 Enable or disable filtering of anonymous MOM messages. More...
 
virtual MAKRti::DtInetSockState state () const
 Returns the state of the socket. More...
 

Protected Types

typedef std::vector< char > Buffer
 
typedef std::map
< MAKRti::DtInetAddr,
DtRtiSmSocketBundleBuff
RtiBufferMap
 

Protected Member Functions

 DtRtiSmSocket (const DtRtiSmSocket &)
 Not Implemented. More...
 
DtRtiSmSocketoperator= (const DtRtiSmSocket &)
 Not Implemented. More...
 
virtual int recv (caddr_t *buffptr, MAKRti::DtInetEndpoint *ep)
 
virtual bool filterAnonMsgs (caddr_t buffptr, MAKRti::DtU32 msgSenderId)
 

Protected Attributes

MAKRti::DtString mySharedMemName
 
DtRtiSubscribableMessageQueuemyRtiSmMsgQueue
 
MAKRti::DtU32 myRecvMask
 
bool myAnonFilterEnabled
 
RtiBufferMap myRtiBufferMap
 
MAKRti::DtInetSockState myState
 The current state of the socket. More...
 

Friends

class DtRtiSmSocketBundleBuff
 

Detailed Description

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.

Member Typedef Documentation

typedef std::vector<char> DtRtiSmSocket::Buffer
protected
typedef std::map< MAKRti::DtInetAddr, DtRtiSmSocketBundleBuff > DtRtiSmSocket::RtiBufferMap
protected

Constructor & Destructor Documentation

DtRtiSmSocket::DtRtiSmSocket ( const char *  sharename,
std::shared_ptr< DtMsgHeaderReader hdrReader 
)
virtual DtRtiSmSocket::~DtRtiSmSocket ( )
virtual
DtRtiSmSocket::DtRtiSmSocket ( const DtRtiSmSocket )
protected

Not Implemented.

Member Function Documentation

virtual bool DtRtiSmSocket::filterAnonMsgs ( caddr_t  buffptr,
MAKRti::DtU32  msgSenderId 
)
protectedvirtual
virtual bool DtRtiSmSocket::flush ( )
virtual

Send buffered messages.

Returns indication of whether flush is complete or incomplete.

virtual int DtRtiSmSocket::getMsgTransportInfo ( MAKRti::DtInetAddr *  addr,
MAKRti::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.

virtual bool DtRtiSmSocket::initializeSmQueue ( MAKRti::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.

virtual bool DtRtiSmSocket::initializeSmQueue ( MAKRti::DtU32  numBuckets,
MAKRti::DtU32  payloadSize,
bool  reliableQueue,
MAKRti::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.

virtual MAKRti::DtSmSubscribableMessageQueue__rti__* DtRtiSmSocket::msgQueue ( ) const
virtual

Return pointer to the attached queue.

DtRtiSmSocket& DtRtiSmSocket::operator= ( const DtRtiSmSocket )
protected

Not Implemented.

virtual bool DtRtiSmSocket::queueIsReliable ( ) const
virtual

Query the queue to see if it is configured to operate in reliable mode.

virtual int DtRtiSmSocket::recv ( caddr_t *  buffptr,
MAKRti::DtInetEndpoint *  ep 
)
protectedvirtual
virtual int DtRtiSmSocket::sendMessage ( caddr_t  msg,
size_t  msgSize,
bool  deleteAfterSend,
unsigned int  flags,
const MAKRti::DtInetAddr &  destAddr = MAKRti::DtInetAddr::inaddrAny() 
)
virtual

The send method takes an extra flags parameter which identifies the transport method (DtReliable or DtBestEffort) and priority.

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

virtual void DtRtiSmSocket::setReceiveMask ( MAKRti::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

virtual MAKRti::DtInetSockState DtRtiSmSocket::state ( ) const
virtual

Returns the state of the socket.

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

virtual 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

Friends And Related Function Documentation

friend class DtRtiSmSocketBundleBuff
friend

Member Data Documentation

bool DtRtiSmSocket::myAnonFilterEnabled
protected
MAKRti::DtU32 DtRtiSmSocket::myRecvMask
protected
RtiBufferMap DtRtiSmSocket::myRtiBufferMap
protected
DtRtiSubscribableMessageQueue* DtRtiSmSocket::myRtiSmMsgQueue
protected
MAKRti::DtString DtRtiSmSocket::mySharedMemName
protected
MAKRti::DtInetSockState DtRtiSmSocket::myState
protected

The current state of the socket.


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

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)