MAK RTIspy API Documentation for HLA 1516
List of all members | 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:

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.
- Public Member Functions inherited from DtConnectionMgr
virtual ~DtConnectionMgr ()
 Destructor.
virtual int init (DtRIDParameters *params)
 Initialize the RTI's exercise parameters and connections Users who wish to override the MAK RTI's network connections should override this function or initConnections()
virtual void initParams (DtRIDParameters *params)
 Initialize the parameters used by the connection manager.
virtual void enableSmartForwarding (bool enable, int maxNumFederates)
 Enables or disables smart forwarding.
virtual DtRIDParametersparams ()
 Get a pointer to the RID parameters.
virtual void setFederateMgr (DtFederateMgr *fedMgrPtr)
 Set the federate manager.
virtual void shutdown ()
 Request shutdown of communication activities.
virtual bool isShuttingDown ()
 Shutdown acknowledged.
virtual int sendStamped (const DtRtiMsg &msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &=MAKRti::DtInetAddr::inaddrAny())
 Send a message stamped with fedEx name and federate ID Retraction record of timestamped messages made here.
virtual int sendStampedAnonymous (const DtRtiMsg &msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
 Send a message stamped with fedEx name, but not federate ID Does not make retraction record of sent messages.
virtual int sendAndDelete (DtRtiMsg *msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
 Send a message and delete the message after it has been sent Returns the size of the data sent.
virtual int sendStampedAndDelete (DtRtiMsg *msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &=MAKRti::DtInetAddr::inaddrAny())
 Send and delete a message stamped with fedEx name and federate ID Retraction record of timestamped messages made here.
virtual int sendStampedAnonymousAndDelete (DtRtiMsg *msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
 Send and delete a message stamped with fedEx name, but not federate ID Does not make retraction record of sent messages.
virtual void sendLoopback (DtRtiMsg *msg)
 Send a message to be processed by this federate.
virtual bool drainBacklog (MAKRti::DtTime timeout=0.0)
 Attempts to flush backlogged messages repeatedly until either all messages are sent or the timeout expires.
virtual void activateTransmitDelay ()
 Activate a delay timer (based on RID) used by managers to control transmission of internal state Expired delays disable activation for current tick.
virtual bool delayTransmit () const
 Return true if retransmission of internal state should be delayed.
virtual void testTransmitDelay ()
 Test if retransmit delay time has expired.
virtual void activateAutoProvideDelay ()
 Activate a delay timer (based on RID) used by managers to control timing for autoprovide callbacks Expired delays disable activation for current tick.
virtual bool delayAutoProvide () const
 Return true if autoprovides should be delayed.
bool allProvideUpdateRequestsDelayed () const
 Return true if all provide update calls should be delayed (not just auto provide).
virtual void testAutoProvideDelay ()
 Test if autoprovide delay time has expired.
virtual void processQueuedMessages ()
 Process queued messages that are being sent at specified rate.
virtual void flushQueuedMessages ()
 Process queued messages.
virtual unsigned long incrementServiceCallCount ()
 Increment a counter to identify the service call being processed.
virtual unsigned long serviceCallCount () const
 Return service call counter.
virtual bool tick ()
 Receiving.
virtual void updateBufferSizes ()
 Update Buffer sizes from Rid params object.
virtual DtNetReadStatus handleMsg (DtRtiMsg &msg)
 Handle this message by either processing it or queuing it if save pending.
virtual DtNetReadStatus processMsg (const DtRtiMsg &msg)
 this function applies the callbacks to the message
virtual DtNetReadStatus momProcessMsg (const DtRtiMsg &msg)
 apply MOM callbacks to message
DtFederateMgrfedMgr ()
 The federate manager.
DtPartnerMgrpartnerMgr ()
 Partner manager.
virtual MAKRti::DtTransportType internalTransportType () const
 Returns the TransportType associated for the internal connection.
virtual bool hasTransport (MAKRti::DtTransportType trans)
 returns true if the specified transport type is available
virtual DtRtiMsgcreate (DtRtiMsgKind kind)
 Request the RTI message factory for a msg.
virtual DtRtiMsgFactorymsgFactory () const
virtual void connectFederation (DtLogicalTimeFactory *logicalTimeFactoryPtr, MAKRti::DtString fedExName, DtFederateHandle federateHandle, int fedExHandle)
 The LRC associates its federation information with its network connections.
virtual RTI::FederateAmbassadorfedAmb () const
 Return pointer to Federate Ambassador.
virtual void addFedAmbWrapper (MAKRti::DtString const &name, DtFedAmbWrapper *fedAmb)
 Register a Federate Wrapper with the RTI A federate wrapper allows your plugin to monitor any RTI invoked services.
virtual bool addFedAmbWrapperAtFront (MAKRti::DtString const &name, DtFedAmbWrapper *fedAmb)
 When the fedAmb Wrapper is installed make certain that this particular wrapper is the first to process the msg.
virtual DtFedAmbWrapperremoveFedAmbWrapper (MAKRti::DtString const &name)
 Remove federate wrapper.
virtual unsigned long connectionId () const
 Return connection ID.
virtual DtFederateHandle fedHandle () const
 Return federate handle.
virtual unsigned long fedExHandle () const
 Return federation execution handle.
virtual const MAKRti::DtString & fedExName () const
 Return federation execution name.
virtual void setFederateHandle (DtFederateHandle handle)
 set federate handle ( this is used by restore and should not be called otherwise )
virtual DtLogicalTimeFactorylogicalTimeFactory (DtFederationHandle federationHandle=0) const
 Get the factory for the given federation that can create logical time/interval instances.
virtual void addLogicalTimeFactory (DtFederationHandle federationHandle, DtLogicalTimeFactory *timeFactory)
 Add the factory for the given federation that can create logical time/interval instances.
virtual void removeLogicalTimeFactory (DtFederationHandle federationHandle)
 Remove the factory for the given federation that can create logical time/interval instances.
virtual DtRtiMsgQueuemsgQueue ()
 Set/Get the time managed message queue.
virtual void setMsgQueue (DtRtiMsgQueue *msgQueuePtr)
virtual DtRetractInfoListretractList ()
 Set/Get the time managed retract list.
virtual void setRetractList (DtRetractInfoList *listPtr)
virtual void yield ()
 Yield processing to allow more data to arrive.
virtual bool saveInProgress () const
 Set/Get the flag indicating whether a save is in progress Unless a message is marked safe to process during a save a received message is queued for later processing.
virtual void setSaveInProgress (bool saveIsInProgress)
virtual bool restoreInProgress () const
 Set/Get the flag indicating whether a restore is in progress Unless a message is marked safe to process during a save a received message is queued for later processing.
virtual void setRestoreInProgress (bool saveIsInProgress)
virtual bool saveRestoreInProgress () const
 Return bool: Is save or restore in progress.
virtual void setMetadataControl (DtMetadataType type, bool onOff)
 Set/Get metadata control indicators.
virtual bool isMetadataEnabled (DtMetadataType type)
virtual void sendShutdownForwarderMsg ()
 Called by the rtiExec when it is exiting, only if it started this forwarder.
virtual unsigned long sequenceNumber () const
 Get the next sequence number.
virtual void incrementSequenceNumber ()
 Increment the sequence number.
virtual void setProcessingTick (bool processingTick)
 Set/Get tick processing state.
virtual bool processingTick () const
 Set/Get tick processing state.
virtual void setEvokingCallbacks (bool evokingCbs)
 Set/Get the evoke callbacks state.
virtual bool evokingCallbacks () const
 Set/Get the evoke callbacks state.
virtual void addPendingMsg (DtRtiMsg *msg)
 Add/get/process a pending message Messages will be processed during the next tick.
virtual bool processPendingMsg ()
 Add/get/process a pending message Messages will be processed during the next tick.
virtual DtRtiMsgnextPendingMsg ()
 Add/get/process a pending message Messages will be processed during the next tick.
virtual void emptyPendingMsgList ()
 Add/get/process a pending message Messages will be processed during the next tick.
virtual int pendingMsgCount ()
 Add/get/process a pending message Messages will be processed during the next tick.
virtual void addMsgCallback (DtRtiMsgKind msgKind, DtRtiMsgCbMgr::DtCallbackFcn fcn, void *usr, bool isMomCallback=false)
 Message Callbacks These callback functions operate on all of the connections.
virtual void removeMsgCallback (DtRtiMsgKind msgKind, DtRtiMsgCbMgr::DtCallbackFcn fcn, void *usr, bool isMomCallback=false)
 Message Callbacks These callback functions operate on all of the connections.
virtual void addWildcardMsgCallback (DtRtiMsgCbMgr::DtCallbackFcn fcn, void *usr, bool isMomCallback=false)
 Message Callbacks These callback functions operate on all of the connections.
virtual void removeWildcardMsgCallback (DtRtiMsgCbMgr::DtCallbackFcn fcn, void *usr, bool isMomCallback=false)
 Message Callbacks These callback functions operate on all of the connections.
virtual DtRtiConnectionreliableConn () const
 Returns the connection created by createTcpConn().
virtual DtRtiConnectionbestEffortConn () const
 Returns the connection created by createBestEffortConn().
virtual bool lockServiceCall ()
 Called by asynchronous processing thread to gain mutually exclusive access to RTI managers.
virtual void unlockServiceCall ()
 Called by asychronous processing thread to release mutually exclusive access to RTI managers.
virtual bool serviceCallLocked ()
 Called by RTI Ambassador services query if mutex was set using lockServiceCall()
virtual bool enterServiceCall ()
 Called by RTI Ambassador services to gain mutually exclusive access to RTI managers.
virtual void exitServiceCall ()
 Called by RTI Ambassador services to release mutually exclusive access to RTI managers.
virtual bool inServiceCall ()
 Called by RTI Ambassador services query if mutex was set using enterServiceCall()

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.
- Static Public Member Functions inherited from DtConnectionMgr
static void setCreatorFunction (DtConnectionMgrCreator fn)
 Register a creator function.
static void setInternalCreatorFunction (DtConnectionMgrCreator fn)
 Register alternate internal creators.

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 Member Functions inherited from DtConnectionMgr
 DtConnectionMgr (DtRIDParameters *params, bool isFederate=false, DtBoost::shared_ptr< DtRtiAssistantLrcClient > assistantClient=DtBoost::shared_ptr< DtRtiAssistantLrcClient >())
 Constructor is performed through create.
virtual bool doWait (MAKRti::DtTime period)
 perform actual wait. Called by wait
virtual bool createBestEffortConn ()
 Create best effort connection; Returns true if successful Could be that it already exist in which case it is still used.
virtual void destroyBestEffortConn ()
 Destroy best effort connection.
virtual bool createRelConn ()
 Create reliable connection; Returns true if successful.
virtual void destroyRelConn ()
 Destroy reliable connection.
virtual unsigned int createAncillaryRelConns ()
 Create ancillary reliable connections; Returns count of successful connections.
virtual void destroyAncillaryRelConn (DtRtiConnection *conn)
 Destroy the given ancillary reliable connection.
virtual void destroyAncillaryRelConns ()
 Destroy ancillary reliable connections.
virtual unsigned int ancillaryReliableConnsCount () const
 Report number of ancillary reliable connections successfully established.
virtual bool checkRelConn ()
 Check the reliable connection status.
virtual void processReadResult (int readError)
 Process read result to print error diagnostics for example.
virtual int sendStampedUtilityFunction (DtRtiMsg *msg, MAKRti::DtTransportType transport, bool performDelete, bool isAnonymous, const MAKRti::DtInetAddr &addr)
 Called by sendStamped, sendStampedAndDelete, sendAnonymousStamped, etc.

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
- Protected Attributes inherited from DtConnectionMgr
DtRtiMsgFactorymyMsgFactory
 The message factory.
DtRtiConnectionmyBestEffortConn
 The best effort connection.
DtRtiConnectionmyPrimaryReliableConn
 The primary reliable connection.
DtRtiConnectionList myReliableConns
DtRIDParametersmyParams
 The RTI initialization parameters.
DtFederateMgrmyFedMgr
 The federate manager.
std::map< MAKRti::DtInetAddr,
DtMulticastEntry * > 
myMulticastGroups
 LRC listening to these multicast groups.
DtFedAmbWrapperChain myFedAmbChain
 Chain of Federate Ambassador Wrappers.
DtDfltMsgFactory myDfltMsgFactory
 Default message factory.
DtRtiMsgCbMgr myMsgCbMgr
 Message callback manager.
DtRtiMsgCbMgr myMomMsgCbMgr
 MOM message callback manager.
MAKRti::DtTransportType myInternalTransportType
 Transport type used for internal messages.
bool myAddTransportTypeMetadata
 Metadata control indicators.
bool myAddMcastMetadata
std::map< DtFederationHandle,
DtLogicalTimeFactory * > 
myLogicalTimeFactories
 Factories for creating logical time instances.
DtRtiMsgQueuemyMsgQueue
 Message queue.
DtRetractInfoListmyRetractList
 Message retractions.
std::list< DtRtiMsg * > myPendingMessages
 Pending messages.
bool mySaveInProgress
 Save status.
bool myRestoreInProgress
 Restore status.
unsigned long myConnectionId
 "unique" identifier for this connMgr (if there is a good source of unique ids)
MAKRti::DtString myFedExName
 Federation execution name.
DtFederateHandle myFedExHandle
 Federation execution handle.
DtFederateHandle myFederateHandle
 Federate handle.
unsigned long myReceivedMsgCount
 Number of received messages.
unsigned long mySentMsgCount
 Number of sent messages.
MAKRti::DtList myWorkingMsgId
 Diagnostic message ID stack.
DtMessageThrottlemyMessageThrottle
 Message output throttle.
bool myAllProvideUpdateRequestsDelayed
 Extend auto provide delay to all attribute update requests.
DtMutex * myCallbackMutex
 Mutex to synchronize access to RTI and Federate Ambassadors.
unsigned int myLockService
 RTI is processing a message.
unsigned int myInService
 RTI is processing a service call.
MAKRti::DtClock myClock
 Clock for timing.
DtBoost::shared_ptr
< DtRtiAssistantLrcClient
myAssistantClient
 The assistant client.
bool myIsFederate
 Whether this manager is for a federate.
unsigned long myVersionConflictCount
 The count of message version conflicts.
MAKRti::DtTime myVersionConflictNoticationTimer
unsigned long mySizeMismatchCount
 The count of message size mismatches.
MAKRti::DtTime mySizeMismatchNoticationTimer
DtPartnerMgrmyPartnerMgr
unsigned long myServiceCallCount
 Service call counter - increment before processing each service call.
bool myProcessingTick
 Tick processing state.
bool myEvokingCallbacks
 Indicates if callbacks are being evoked.
bool myProcessingMessage
 Indicates if message is being processed.
bool myShutdown
 Shutdown requested.
bool myShuttingDown
 Shutdown acknowledged.

Additional Inherited Members

- Public Types inherited from DtConnectionMgr
typedef DtConnectionMgr *(* DtConnectionMgrCreator )(DtRIDParameters *p, bool isFederate, DtBoost::shared_ptr< DtRtiAssistantLrcClient > assistantClient)
 Connection Manager Creator.
- Protected Types inherited from DtConnectionMgr
typedef std::list
< DtRtiConnection * > 
DtRtiConnectionList
 List of all reliable connections (for forwarder load balancing)
- Static Protected Attributes inherited from DtConnectionMgr
static DtConnectionMgrCreator theCreator = 0
 The plugin creator.
static DtConnectionMgrCreator theInternalCreator = 0
 The internal creator.

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().

DtSmConnectionMgr::~DtSmConnectionMgr ( )
virtual

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 ( )
protectedvirtual
void DtSmConnectionMgr::disconnectFederation ( )
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().

bool DtSmConnectionMgr::flush ( )
virtual

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::getMessage ( )
virtual
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 ( )
protectedvirtual
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().

bool DtSmConnectionMgr::processConnections ( )
virtual

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().

int DtSmConnectionMgr::readFileDescriptor ( RTI::TransportType  transport)
virtual

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.

bool DtSmConnectionMgr::repairFederationConnection ( )
virtual
int DtSmConnectionMgr::send ( const DtRtiMsg msg,
MAKRti::DtTransportType  transport,
const MAKRti::DtInetAddr &  addr = MAKRti::DtInetAddr::inaddrAny() 
)
virtual
void DtSmConnectionMgr::setMsgFactory ( DtRtiMsgFactory fact)
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.

DtSmRtiConnection * DtSmConnectionMgr::sharedMemConn ( ) const
virtual
bool DtSmConnectionMgr::sm_shutdown ( bool  ruthless = false)
virtual

Attempts to shutdown shared memory queue.

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

void DtSmConnectionMgr::startSharedMemMgr ( )
protectedvirtual

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

bool DtSmConnectionMgr::myForceSubscribe
protected

indicates shared mem queue in reliable mode

Referenced by createSharedMemConn(), and initQMgr().

bool DtSmConnectionMgr::myIsQueueManager
protected

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
DtU32 DtSmConnectionMgr::myNumBuckets
protected

indicates this is the queue manager

Referenced by createSharedMemConn(), and initQMgr().

DtU32 DtSmConnectionMgr::myPayloadSize
protected

number of message slots in shared memory queue

Referenced by createSharedMemConn(), and initQMgr().

bool DtSmConnectionMgr::myQueueReliable
protected

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().

DtSmRtiConnection* DtSmConnectionMgr::mySharedMemConn
protected
MAKRti::DtString DtSmConnectionMgr::mySharedMemName
protected
DtRtiShmQNetMgr* DtSmConnectionMgr::mySharedMemNetMgr
protected

Referenced by setNetConnMgr().


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

Document ID: Generated on Tue May 7 16:26:47 EDT 2013 from SVN revision 126903
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)