MAK RTIspy API Documentation for HLA 1.3
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtSmConnectionMgr Class Reference

Instances of DtSmConnectionMgr manage the communication objects that the RTI will use to communicate via shared memory or communicate with the LRC application (using the federate ambassador pointer). More...

+ Inheritance diagram for DtSmConnectionMgr:
+ Collaboration diagram for DtSmConnectionMgr:

List of all members.

Public Member Functions

virtual ~DtSmConnectionMgr ()
virtual void initQMgr (DtU32 numBuckets, DtU32 payloadSize, bool reliable, bool forceMgrSubscribe)
 This method is called by the queue manager to setup the queue.
virtual int send (const DtRtiMsg &msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
 Sending.
virtual bool flush ()
 Send buffered messages.
virtual bool processConnection (DtRtiConnection *conn, MAKRti::DtTransportType trans)
 Receiving.
virtual bool processConnections ()
 Override of base class method.
virtual DtRtiMsggetMessage ()
 Get a message if one exists Message must be destroyed by caller.
virtual DtRtiMsggetMessageWithNetInfo (MAKRti::DtInetAddr *addr, MAKRti::DtTransportType *trans, DtU32 *priority=NULL)
 These methods return the network information (destination address, transport method, and priority - if any) associated with a message in shared memory.
virtual MAKRti::DtInetAddr getLastDestAddr () const
virtual MAKRti::DtTransportType getLastTransportType () const
virtual int readFileDescriptor (RTI::TransportType transport)
 Returns a file descriptor on which data will be present for the given transport type whenever there is incoming data waiting to be read.
virtual DtSmRtiConnectionsharedMemConn () const
 Returns the connection created by createSharedMemConn().
virtual void setNetConnMgr (DtRtiShmQNetMgr *smNetConnMgr)
 Shared memory queue manager will allow messages to be exchanged between the shared memory connection manager and the network I/O connection manager.
virtual bool sm_shutdown (bool ruthless=false)
 Attempts to shutdown shared memory queue.
virtual bool setupSelectParams (DtSelectParam *params)
 adds Read File descriptors to a DtSelectParams
virtual void setMsgFactory (DtRtiMsgFactory *fact)
 Get/Set the message factory.
virtual void listenToMulticastGroup (const MAKRti::DtInetAddr &addr, const MAKRti::DtInetAddr &netInterface=MAKRti::DtInetAddr::inaddrAny())
 Add/Drop multicast groups from the best effort connection.
virtual void dropMulticastGroup (const MAKRti::DtInetAddr &addr, const MAKRti::DtInetAddr &netInterface=MAKRti::DtInetAddr::inaddrAny())
 Add/Drop multicast groups from the best effort connection Listens are accumulated and drops decrement.
virtual void forceDropMulticastGroup (const MAKRti::DtInetAddr &addr, const MAKRti::DtInetAddr &netInterface=MAKRti::DtInetAddr::inaddrAny())
 Override listen count and force drop multicast address.
virtual void connectFederation (RTI::FederateAmbassador *fedAmb, DtLogicalTimeFactory *logicalTimeFactoryPtr, MAKRti::DtString fedExName, DtFederateHandle fedHandle, int fedExHandle)
 The LRC associates its federation information with its network connections.
virtual bool repairFederationConnection ()
 Attempt to re-establish a broken connection to the federation Returns true if successful.
virtual void disconnectFederation ()
 The LRC disassociates its connections from the federation.
virtual bool wait (MAKRti::DtTime period=0.0, bool unlockWhileWaiting=false)
 Wait for data to be ready or the given period of time to expire Return boolean: data is ready for reading?
virtual int subscriberCount () const
 Return a count of the number of subscribers currently attached to the shared memory queue.

Static Public Member Functions

static DtConnectionMgrcreate (DtRIDParameters *p, bool isFederate=false, DtBoost::shared_ptr< DtRtiAssistantLrcClient > assistantClient=DtBoost::shared_ptr< DtRtiAssistantLrcClient >())
 Creates an instance of a DtSmConnectionMgr; If an alternate creator function has been set, that creator function will be called from within this function.
static DtConnectionMgrcreateQMgr (DtRIDParameters *params, DtU32 numBuckets, DtU32 payloadSize, bool queueReliable, bool forceMgrSubscribe, bool isFederate=false, DtBoost::shared_ptr< DtRtiAssistantLrcClient > assistantClient=DtBoost::shared_ptr< DtRtiAssistantLrcClient >(), DtRtiShmQNetMgr *smNetConnMgr=0)
 Creates an instance of a DtSmConnectionMgr which acts on behalf of the shared memory queue manager.

Protected Member Functions

 DtSmConnectionMgr (DtRIDParameters *params, bool isFederate=false, DtBoost::shared_ptr< DtRtiAssistantLrcClient > assistantClient=DtBoost::shared_ptr< DtRtiAssistantLrcClient >())
virtual void startSharedMemMgr ()
 Launch detached process to create the shared memory pool, subscribable message queue, and shared memory manager.
virtual int initConnections ()
 Initialize the RTI's exercise connections Users who wish to override the MAK RTI's shared memory connections should override these functions.
virtual bool createSharedMemConn ()
 Create connection (attach) to subscribable shared memory queue; Returns true if successful.

Protected Attributes

DtSmRtiConnectionmySharedMemConn
MAKRti::DtString mySharedMemName
DtRtiShmQNetMgrmySharedMemNetMgr
bool myIsQueueManager
 These members are specific to the queue manager's connection manager.
DtU32 myNumBuckets
 indicates this is the queue manager
DtU32 myPayloadSize
 number of message slots in shared memory queue
bool myQueueReliable
 number of bytes available in each message slot
bool myForceSubscribe
 indicates shared mem queue in reliable mode
DtU32 myReadMask
 should only be used by queue manager
MAKRti::DtInetAddr myLastDestAddr
 controls what type of messages are read/skipped
MAKRti::DtTransportType myLastTransportType

Detailed Description

Instances of DtSmConnectionMgr manage the communication objects that the RTI will use to communicate via shared memory or communicate with the LRC application (using the federate ambassador pointer).

Override this class to change the way in which the MAK RTI communicates with other LRC components (or the rtiexec) using shared memory. Refer to DtConnectionMgr for other methods of communication.


Constructor & Destructor Documentation

DtSmConnectionMgr::DtSmConnectionMgr ( DtRIDParameters params,
bool  isFederate = false,
DtBoost::shared_ptr< DtRtiAssistantLrcClient assistantClient = DtBoost::shared_ptr<DtRtiAssistantLrcClient>() 
) [protected]

Referenced by create(), and createQMgr().


Member Function Documentation

void DtSmConnectionMgr::connectFederation ( RTI::FederateAmbassador fedAmb,
DtLogicalTimeFactory logicalTimeFactoryPtr,
MAKRti::DtString  fedExName,
DtFederateHandle  fedHandle,
int  fedExHandle 
) [virtual]
DtConnectionMgr * DtSmConnectionMgr::create ( DtRIDParameters p,
bool  isFederate = false,
DtBoost::shared_ptr< DtRtiAssistantLrcClient assistantClient = DtBoost::shared_ptr<DtRtiAssistantLrcClient>() 
) [static]

Creates an instance of a DtSmConnectionMgr; If an alternate creator function has been set, that creator function will be called from within this function.

Reimplemented from DtConnectionMgr.

References DtSmConnectionMgr().

Referenced by DtRtiExec::DtRtiExec(), and DtRtiAmbassadorBaseImplementor::setupConnection().

DtConnectionMgr * DtSmConnectionMgr::createQMgr ( DtRIDParameters params,
DtU32  numBuckets,
DtU32  payloadSize,
bool  queueReliable,
bool  forceMgrSubscribe,
bool  isFederate = false,
DtBoost::shared_ptr< DtRtiAssistantLrcClient assistantClient = DtBoost::shared_ptr<DtRtiAssistantLrcClient>(),
DtRtiShmQNetMgr smNetConnMgr = 0 
) [static]

Creates an instance of a DtSmConnectionMgr which acts on behalf of the shared memory queue manager.

This function prototype is intentionally different than the nominal DtConnectionMgr create method to make it incompatible with the setCreator() method. This will prevent it being set as the default creator of DtConnectionMgr objects. Only one shared memory queue manager should be created (per shared memory queue).

References DtSmConnectionMgr(), DtConnectionMgr::init(), initQMgr(), and setNetConnMgr().

bool DtSmConnectionMgr::createSharedMemConn ( ) [protected, virtual]
void DtSmConnectionMgr::dropMulticastGroup ( const MAKRti::DtInetAddr &  addr,
const MAKRti::DtInetAddr &  netInterface = MAKRti::DtInetAddr::inaddrAny() 
) [virtual]

Add/Drop multicast groups from the best effort connection Listens are accumulated and drops decrement.

The multicast is not actually dropped until the listen count goes to zero.

Reimplemented from DtConnectionMgr.

References DtConnectionMgr::bestEffortConn(), DtMulticastEntry::count, DtConnectionMgr::create(), DtMcastConfigureMsgKind, DtMcastDrop, DtConnectionMgr::myFederateHandle, DtConnectionMgr::myInternalTransportType, DtConnectionMgr::myMulticastGroups, DtConnectionMgr::sendAndDelete(), and DtMcastConfigureMsg::set().

Send buffered messages.

Returns indication of whether the flush is complete or incomplete.

Reimplemented from DtConnectionMgr.

References sharedMemConn().

Referenced by getMessage().

void DtSmConnectionMgr::forceDropMulticastGroup ( const MAKRti::DtInetAddr &  addr,
const MAKRti::DtInetAddr &  netInterface = MAKRti::DtInetAddr::inaddrAny() 
) [virtual]
MAKRti::DtInetAddr DtSmConnectionMgr::getLastDestAddr ( ) const [virtual]

References myLastDestAddr.

MAKRti::DtTransportType DtSmConnectionMgr::getLastTransportType ( ) const [virtual]

References myLastTransportType.

DtRtiMsg * DtSmConnectionMgr::getMessageWithNetInfo ( MAKRti::DtInetAddr *  addr,
MAKRti::DtTransportType *  trans,
DtU32 *  priority = NULL 
) [virtual]

These methods return the network information (destination address, transport method, and priority - if any) associated with a message in shared memory.

References getMessage(), and sharedMemConn().

int DtSmConnectionMgr::initConnections ( ) [protected, virtual]
void DtSmConnectionMgr::initQMgr ( DtU32  numBuckets,
DtU32  payloadSize,
bool  reliable,
bool  forceMgrSubscribe 
) [virtual]

This method is called by the queue manager to setup the queue.

It must be called ONLY by the queue manager and must be called before calling the init() method to ensure proper initialization of the queue manager.

References DtMetadataTypeMcastAddr, DtMetadataTypeTransport, DtSMQ_SKIP_MINE, myForceSubscribe, myIsQueueManager, myNumBuckets, myPayloadSize, myQueueReliable, myReadMask, and DtConnectionMgr::setMetadataControl().

Referenced by createQMgr().

void DtSmConnectionMgr::listenToMulticastGroup ( const MAKRti::DtInetAddr &  addr,
const MAKRti::DtInetAddr &  netInterface = MAKRti::DtInetAddr::inaddrAny() 
) [virtual]
bool DtSmConnectionMgr::processConnection ( DtRtiConnection conn,
MAKRti::DtTransportType  trans 
) [virtual]

Receiving.

Read from the given connection and process the message (if received) Return boolean: message was received? (i.e. could be more input).

Reimplemented from DtConnectionMgr.

References DtNET_READ_NO_PACKETS, DtNET_READ_SUCCESS, DtConnectionMgr::handleMsg(), myLastDestAddr, myLastTransportType, DtRtiConnection::netRead(), and DtRtiMsg::setTransportType().

Referenced by processConnections().

Override of base class method.

Shared memory only has one connection to worry about, not multiple. Return true if there is more backlogged data to send, false if done.

Reimplemented from DtConnectionMgr.

References DtSmRtiConnection::flush(), DtConnectionMgr::myInternalTransportType, DtConnectionMgr::params(), processConnection(), repairFederationConnection(), and sharedMemConn().

Returns a file descriptor on which data will be present for the given transport type whenever there is incoming data waiting to be read.

Returns -1 if no such file descriptor.

Reimplemented from DtConnectionMgr.

int DtSmConnectionMgr::send ( const DtRtiMsg msg,
MAKRti::DtTransportType  transport,
const MAKRti::DtInetAddr &  addr = MAKRti::DtInetAddr::inaddrAny() 
) [virtual]

Get/Set the message factory.

Reimplemented from DtConnectionMgr.

References DtConnectionMgr::myMsgFactory, DtRtiConnection::setMsgFactory(), and sharedMemConn().

void DtSmConnectionMgr::setNetConnMgr ( DtRtiShmQNetMgr smNetConnMgr) [virtual]

Shared memory queue manager will allow messages to be exchanged between the shared memory connection manager and the network I/O connection manager.

References mySharedMemNetMgr.

Referenced by createQMgr().

bool DtSmConnectionMgr::setupSelectParams ( DtSelectParam *  params) [virtual]

adds Read File descriptors to a DtSelectParams

Reimplemented from DtConnectionMgr.

bool DtSmConnectionMgr::sm_shutdown ( bool  ruthless = false) [virtual]

Attempts to shutdown shared memory queue.

References myIsQueueManager, sharedMemConn(), and DtSmRtiConnection::sm_shutdown().

void DtSmConnectionMgr::startSharedMemMgr ( ) [protected, virtual]

Launch detached process to create the shared memory pool, subscribable message queue, and shared memory manager.

Will fork new child process, but child will never return control to parent. If a shared memory mgr process is already running the forked process will simply exit, but will not signal the parent.

References DtCreateProcess__rti__(), DtProcFullyDetached__rti__, DtRtiSearchPathList(), DtSHMQMGR_EXEC, DtRIDParameters::getFullPathToRidFile(), and DtConnectionMgr::params().

Referenced by initConnections().

int DtSmConnectionMgr::subscriberCount ( ) const [virtual]

Return a count of the number of subscribers currently attached to the shared memory queue.

References sharedMemConn(), and DtSmRtiConnection::subscriberCount().

bool DtSmConnectionMgr::wait ( MAKRti::DtTime  period = 0.0,
bool  unlockWhileWaiting = false 
) [virtual]

Member Data Documentation

indicates shared mem queue in reliable mode

Referenced by createSharedMemConn(), and initQMgr().

These members are specific to the queue manager's connection manager.

Referenced by createSharedMemConn(), initConnections(), initQMgr(), and sm_shutdown().

MAKRti::DtInetAddr DtSmConnectionMgr::myLastDestAddr [protected]

controls what type of messages are read/skipped

This member is part of an ugly hack to get the destination address from the next message in the shared memory queue so the network I/O manager within the shared memory queue manager knows where to send messages retrieved from shared memory.

Referenced by getLastDestAddr(), and processConnection().

MAKRti::DtTransportType DtSmConnectionMgr::myLastTransportType [protected]

indicates this is the queue manager

Referenced by createSharedMemConn(), and initQMgr().

number of message slots in shared memory queue

Referenced by createSharedMemConn(), and initQMgr().

number of bytes available in each message slot

Referenced by createSharedMemConn(), and initQMgr().

DtU32 DtSmConnectionMgr::myReadMask [protected]

should only be used by queue manager

Referenced by createSharedMemConn(), and initQMgr().

MAKRti::DtString DtSmConnectionMgr::mySharedMemName [protected]

Referenced by setNetConnMgr().


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

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)