MAK RTIspy API Documentation for HLA 1.3
Classes | Public Member Functions | Protected Member Functions | Protected Attributes
DtForwarderObserverForAssistant Class Reference

Observes the RTI Forwarder and is responsible sending information on RTI Forwarder to the RTI Assistant. More...

+ Inheritance diagram for DtForwarderObserverForAssistant:
+ Collaboration diagram for DtForwarderObserverForAssistant:

List of all members.

Classes

struct  DtForwarderObserverConnInfo
struct  DtForwarderObserverDroppedConnInfo

Public Member Functions

 DtForwarderObserverForAssistant ()
virtual ~DtForwarderObserverForAssistant ()
virtual void initialize (DtRIDParameters *params)
 Initialization.
virtual void queryForConnectionInfo (int &forwarderPort, MAKRti::DtInetAddr &forwarderToConnectTo)
virtual void setForwarderInfo (int forwarderPort, const MAKRti::DtInetAddr &forwarderToConnectTo)
 If we're not querying the assistant, provide some way for the forwarder to indicate what its forwarderConnInfo is.
virtual void enableNotifications ()
 Enables sending DtWarn & DtFatal to assistant as notifications.
virtual void disableNotifications ()
 Disables sending DtWarn & DtFatal to assistant as notifications.
virtual void processLogFileUpdatedEvent (const MAKRti::DtFilename &logFile)
 Process a log file name update event.
virtual int clientToForwarderConnectionEstablished (const MAKRti::DtString &connName, const MAKRti::DtString &connType, unsigned int connID, const DtInetAddrAndPort &connAddr)
 Callback for established joined client<->forwarder connections.
virtual int clientToForwarderConnectionLost (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &connAddr)
 Callback for lost client<->forwarder connections.
virtual void clientToForwarderFederateJoined (const DtString &connName, const DtString &connType, const DtString &federationName, unsigned int connID, unsigned int fedHandle, const DtInetAddrAndPort &connAddr, const MAKRti::DtString &connHost, unsigned int processId, const MAKRti::DtString &processName, const MAKRti::DtString &commandArgs, DtHlaVersionId hlaVersion)
 Callback for fully joined client<->forwarder connections.
virtual void clientToForwarderFederateLost (const MAKRti::DtString &connName, const MAKRti::DtString &connType, unsigned int connID, unsigned int fedHandle, const DtInetAddrAndPort &connAddr)
 Callback for lost client<->forwarder connections that were fully joined.
virtual int forwarderToForwarderExecConnected (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &connAddr, const MAKRti::DtString &hostName, bool fullyCompliant)
 Callback for connected forwarder<->forwarder exec connections.
virtual int forwarderToForwarderExecLost (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &connAddr)
 Callback for lost forwarder<->forwarder exec connections.
virtual int clientToForwarderExecConnected (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &connAddr, const MAKRti::DtString &connHost, bool fullyCompliant)
 Callback for connected client->forwarder exec connections.
virtual int clientToForwarderExecLost (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &connAddr)
 Callback for lost client->forwarder exec connections.
virtual void forwarderToForwarderConnectionEstablished (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &connAddr)
 Callback for established forwarder<->forwarder connections.
virtual void forwarderToForwarderConnectionLost (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &connAddr)
 Callback for lost forwarder<->forwarder connections.
virtual int clientToForwarderSocketQueueUpdate (unsigned int connId, int connQueueStatus)
 Callback for socket queue update.
virtual void waitingForFowrarderConnections (const DtForwarderPort::DtConnAndNameMap &allNeededFws, const DtForwarderPort::DtConnAndNameMap &stillNeededFws)
 Callback to signal that forwarder is waiting for forwarder<->forwarder connections.
virtual void notWaitingForFowrarderConnections ()
 Callback to signal that forwarder is no longer waiting for forwarder<->forwarder connections.
bool gotConnInfoFromAssistant ()
 /brief Returns true if the assistant supplied the RTI Forwarder connection info.
DtBoost::shared_ptr
< DtRtiAssistantForwarderClient
assistantClient ()

Protected Member Functions

virtual void addCallbacks ()
 /brief Adds all RTI message and tick callbacks. Called when a manager is set.
virtual void removeCallbacks ()
 /brief Removes all RTI message and tick callbacks.
virtual void sendForwarderInfoToAssistant () const
 /brief Populates necessary data and sends it to the assistant client (for observation requests)
virtual void sendWaitingForForwardersToAssistant () const
 /brief Populates necessary data and sends a message to the assistant specifying that we are waiting for additional forwarder connections.

Protected Attributes

DtBoost::shared_ptr
< DtRtiAssistantForwarderClient
myAssistantClient
 The assistant client.
DtAssistantPrintermyAssistantPrinter
 The printer which sends notifications to the assistant.
bool myForwarderIsObserved
 Whether or not there is currently an assistant observing this RTI Forwarder.
DtRIDParametersmyParams
 The RID parameter settings.
MAKRti::DtInetAddr myHostAddr
 The host address used for connection.
bool myGotConnInfoFromAssistant
 Whether or not the assistant supplied connection info.
std::set
< DtForwarderObserverConnInfo
myConnectedNotJoinedClientConns
std::set
< DtForwarderObserverConnInfo
myClientForwarderConns
std::set
< DtForwarderObserverConnInfo
myForwarderForwarderConns
std::set
< DtForwarderObserverDroppedConnInfo
myUnexpectedlyDroppedClientConns
DtNeededFwConnMap myNeededFws
 List of forwarders which we are trying to connect to and whether or not a connection has been made.
bool myIsWaitingForFws
 Whether we are still waiting for forwarder connections.
MAKRti::DtClock myClock
float myDefunctRemovalTime
DtForwarderObserverConnInfomyExecConnection
bool myExecIsLocal
int myForwarderPort
 Forwarder connection information.
MAKRti::DtInetAddr myForwarderToConnectTo
 Forwarder connection information.

event processing functions

virtual void tick ()
 Periodic processing.
static void tick (void *usr)
 Callback for periodic processing.

RTI Assistant message processing callbacks

virtual void processForwarderObserveMsg (const DtAssistantStateObserveMsg &msg)
 /brief Process forwarder observe message by enabling or disabling forwarder update messages to the assistant
virtual void processExitCmndMsg (const DtAssistantExitMsg &msg)
 Process exit command.
virtual void processAssistantDisconnect ()
 Process assistant disconnect.
static void processForwarderObserveMsg (const DtAssistantStateObserveMsg &msg, void *usr)
 /brief Callback for a command message notifying this forwarder that it is or is not being observed
static void processExitCmndMsg (const DtAssistantExitMsg &msg, void *usr)
 /brief Callback for exit command message
static void processAssistantDisconnect (void *usr)
 /brief Callback for assistant disconnect

Detailed Description

Observes the RTI Forwarder and is responsible sending information on RTI Forwarder to the RTI Assistant.

Also accepts commands from the Assistant and gives them to the RTI Forwarder for processing.


Constructor & Destructor Documentation


Member Function Documentation

void DtForwarderObserverForAssistant::addCallbacks ( ) [protected, virtual]

/brief Adds all RTI message and tick callbacks. Called when a manager is set.

Implements DtRtiForwarderObserver.

References DtRtiForwarderObserver::addTickCallback(), and tick().

int DtForwarderObserverForAssistant::clientToForwarderConnectionEstablished ( const MAKRti::DtString &  connName,
const MAKRti::DtString &  connType,
unsigned int  connID,
const DtInetAddrAndPort connAddr 
) [virtual]

Callback for established joined client<->forwarder connections.

Implements DtRtiForwarderObserver.

References myConnectedNotJoinedClientConns.

int DtForwarderObserverForAssistant::clientToForwarderConnectionLost ( const MAKRti::DtString &  connName,
unsigned int  connID,
const DtInetAddrAndPort connAddr 
) [virtual]
int DtForwarderObserverForAssistant::clientToForwarderExecConnected ( const MAKRti::DtString &  connName,
unsigned int  connID,
const DtInetAddrAndPort connAddr,
const MAKRti::DtString &  connHost,
bool  fullyCompliant 
) [virtual]
int DtForwarderObserverForAssistant::clientToForwarderExecLost ( const MAKRti::DtString &  connName,
unsigned int  connID,
const DtInetAddrAndPort connAddr 
) [virtual]

Callback for lost client->forwarder exec connections.

Implements DtRtiForwarderObserver.

References myAssistantClient, myExecConnection, myExecIsLocal, myForwarderIsObserved, and sendForwarderInfoToAssistant().

void DtForwarderObserverForAssistant::clientToForwarderFederateJoined ( const DtString &  connName,
const DtString &  connType,
const DtString &  federationName,
unsigned int  connID,
unsigned int  fedHandle,
const DtInetAddrAndPort connAddr,
const MAKRti::DtString &  connHost,
unsigned int  processId,
const MAKRti::DtString &  processName,
const MAKRti::DtString &  commandArgs,
DtHlaVersionId  hlaVersion 
) [virtual]
void DtForwarderObserverForAssistant::clientToForwarderFederateLost ( const MAKRti::DtString &  connName,
const MAKRti::DtString &  connType,
unsigned int  connID,
unsigned int  fedHandle,
const DtInetAddrAndPort connAddr 
) [virtual]

Callback for lost client<->forwarder connections that were fully joined.

Implements DtRtiForwarderObserver.

References myClientForwarderConns, myConnectedNotJoinedClientConns, myForwarderIsObserved, and sendForwarderInfoToAssistant().

int DtForwarderObserverForAssistant::clientToForwarderSocketQueueUpdate ( unsigned int  connId,
int  connQueueStatus 
) [virtual]

Callback for socket queue update.

Implements DtRtiForwarderObserver.

References myClientForwarderConns, and sendForwarderInfoToAssistant().

Disables sending DtWarn & DtFatal to assistant as notifications.

References myAssistantPrinter.

Enables sending DtWarn & DtFatal to assistant as notifications.

References myAssistantPrinter.

void DtForwarderObserverForAssistant::forwarderToForwarderConnectionEstablished ( const MAKRti::DtString &  connName,
unsigned int  connID,
const DtInetAddrAndPort connAddr 
) [virtual]
void DtForwarderObserverForAssistant::forwarderToForwarderConnectionLost ( const MAKRti::DtString &  connName,
unsigned int  connID,
const DtInetAddrAndPort connAddr 
) [virtual]

Callback for lost forwarder<->forwarder connections.

Implements DtRtiForwarderObserver.

References myForwarderForwarderConns, myForwarderIsObserved, and sendForwarderInfoToAssistant().

int DtForwarderObserverForAssistant::forwarderToForwarderExecConnected ( const MAKRti::DtString &  connName,
unsigned int  connID,
const DtInetAddrAndPort connAddr,
const MAKRti::DtString &  hostName,
bool  fullyCompliant 
) [virtual]
int DtForwarderObserverForAssistant::forwarderToForwarderExecLost ( const MAKRti::DtString &  connName,
unsigned int  connID,
const DtInetAddrAndPort connAddr 
) [virtual]

Callback for lost forwarder<->forwarder exec connections.

Implements DtRtiForwarderObserver.

References myAssistantClient, myExecConnection, myForwarderIsObserved, and sendForwarderInfoToAssistant().

/brief Returns true if the assistant supplied the RTI Forwarder connection info.

References myGotConnInfoFromAssistant.

Initialization.

References myParams.

Callback to signal that forwarder is no longer waiting for forwarder<->forwarder connections.

Implements DtRtiForwarderObserver.

References myIsWaitingForFws, myNeededFws, and sendWaitingForForwardersToAssistant().

/brief Callback for assistant disconnect

References processAssistantDisconnect().

void DtForwarderObserverForAssistant::processExitCmndMsg ( const DtAssistantExitMsg msg,
void *  usr 
) [static]

/brief Callback for exit command message

Callback for exit command message.

Referenced by DtForwarderObserverForAssistant(), and ~DtForwarderObserverForAssistant().

Process exit command.

/brief Callback for a command message notifying this forwarder that it is or is not being observed

Referenced by DtForwarderObserverForAssistant(), and ~DtForwarderObserverForAssistant().

void DtForwarderObserverForAssistant::processLogFileUpdatedEvent ( const MAKRti::DtFilename &  logFile) [virtual]

Process a log file name update event.

void DtForwarderObserverForAssistant::queryForConnectionInfo ( int &  forwarderPort,
MAKRti::DtInetAddr &  forwarderToConnectTo 
) [virtual]
void DtForwarderObserverForAssistant::removeCallbacks ( ) [protected, virtual]

/brief Removes all RTI message and tick callbacks.

Called when a manager is removed or the observer is destroyed.

Implements DtRtiForwarderObserver.

References DtRtiForwarderObserver::removeTickCallback(), and tick().

/brief Populates necessary data and sends a message to the assistant specifying that we are waiting for additional forwarder connections.

References myAssistantClient, myIsWaitingForFws, and myNeededFws.

Referenced by forwarderToForwarderConnectionEstablished(), notWaitingForFowrarderConnections(), and waitingForFowrarderConnections().

void DtForwarderObserverForAssistant::setForwarderInfo ( int  forwarderPort,
const MAKRti::DtInetAddr &  forwarderToConnectTo 
) [virtual]

If we're not querying the assistant, provide some way for the forwarder to indicate what its forwarderConnInfo is.

References myForwarderPort, and myForwarderToConnectTo.

void DtForwarderObserverForAssistant::tick ( void *  usr) [static]

Callback for periodic processing.

References tick().

Callback to signal that forwarder is waiting for forwarder<->forwarder connections.

Implements DtRtiForwarderObserver.

References DtNameAndConnStatus::isConnected, myIsWaitingForFws, myNeededFws, DtNameAndConnStatus::name, and sendWaitingForForwardersToAssistant().


Member Data Documentation

The printer which sends notifications to the assistant.

Referenced by disableNotifications(), DtForwarderObserverForAssistant(), enableNotifications(), and ~DtForwarderObserverForAssistant().

MAKRti::DtClock DtForwarderObserverForAssistant::myClock [protected]

Referenced by processForwarderObserveMsg(), and tick().

Forwarder connection information.

Referenced by queryForConnectionInfo(), and setForwarderInfo().

Forwarder connection information.

Referenced by queryForConnectionInfo(), and setForwarderInfo().

Whether or not the assistant supplied connection info.

Referenced by gotConnInfoFromAssistant(), and queryForConnectionInfo().

MAKRti::DtInetAddr DtForwarderObserverForAssistant::myHostAddr [protected]

The host address used for connection.

List of forwarders which we are trying to connect to and whether or not a connection has been made.

Referenced by forwarderToForwarderConnectionEstablished(), notWaitingForFowrarderConnections(), sendWaitingForForwardersToAssistant(), and waitingForFowrarderConnections().

The RID parameter settings.

Referenced by initialize(), and queryForConnectionInfo().


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)