MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | 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:

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 ()
- Public Member Functions inherited from DtRtiForwarderObserver
 DtRtiForwarderObserver ()
 Constructor.
virtual ~DtRtiForwarderObserver ()
 Destructor.
virtual void setMgr (DtRtiForwarderObserverMgr *mgr)
 Sets the manager for this observer.
virtual void initMgr ()
 Initializes the mgr.
virtual void removeMgr ()
 Removes the manager for this observer.
virtual void clientToForwarderFederateJoined (const MAKRti::DtString &connName, const MAKRti::DtString &connType, const MAKRti::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)=0
 Callback for joined client<->forwarder federate connections.
virtual void addRtiMsgCallback (DtRtiMsgKind msgKind, DtRtiMsgCbMgr::DtCallbackFcn fcn, bool isMomCallback=false)
 Register to receive an event whenever an RTI Msg of the specified kind is received.
virtual void removeRtiMsgCallback (DtRtiMsgKind msgKind, DtRtiMsgCbMgr::DtCallbackFcn fcn, bool isMomCallback=false)
 Unregister to receive an event whenever an RTI Msg of the specified kind is received.
virtual void addTickCallback (DtTickCbFn fcn, MAKRti::DtTime interval)
 Add a tick callback function to be called periodically at the given time interval.
virtual void removeTickCallback (DtTickCbFn fcn)
 Remove tick callback.
virtual unsigned long connectionId () const
 Get the connection ID for this forwarder (thread safe)

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 Member Functions inherited from DtRtiForwarderObserver

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
DtBoost::shared_ptr
< DtFilePrinter > 
myLogPrinter
 Printer which prints output to a log file.
int myForwarderPort
 Forwarder connection information.
MAKRti::DtInetAddr myForwarderToConnectTo
 Forwarder connection information.
- Protected Attributes inherited from DtRtiForwarderObserver
DtRtiForwarderObserverMgrmyMgr
 Pointer to the observer manager.

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 processRidParamRequest (const DtAssistantRidParamsMsg &msg)
 Process RID parameter request.
virtual void processEnableLoggingMsg (const DtAssistantLogEnableMsg &msg)
 Process logging enable command.
virtual void processNotifyLevelChangeMsg (const DtAssistantNtfyLvlUpdateMsg &msg)
 Process notify level change 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 processRidParamRequest (const DtAssistantRidParamsMsg &msg, void *usr)
 /brief Callback for assistant RID parameter request message
static void processEnableLoggingMsg (const DtAssistantLogEnableMsg &msg, void *usr)
 Callback for logging enable command message.
static void processNotifyLevelChangeMsg (const DtAssistantNtfyLvlUpdateMsg &msg, void *usr)
 Callback for notify level change 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

DtForwarderObserverForAssistant::DtForwarderObserverForAssistant ( )
DtForwarderObserverForAssistant::~DtForwarderObserverForAssistant ( )
virtual

Member Function Documentation

void DtForwarderObserverForAssistant::addCallbacks ( )
protectedvirtual

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

Implements DtRtiForwarderObserver.

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

DtBoost::shared_ptr<DtRtiAssistantForwarderClient> DtForwarderObserverForAssistant::assistantClient ( )
inline
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, myForwarderIsObserved, and sendForwarderInfoToAssistant().

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

void DtForwarderObserverForAssistant::disableNotifications ( )
virtual

Disables sending DtWarn & DtFatal to assistant as notifications.

References myAssistantPrinter.

void DtForwarderObserverForAssistant::enableNotifications ( )
virtual

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

bool DtForwarderObserverForAssistant::gotConnInfoFromAssistant ( )
inline

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

References myGotConnInfoFromAssistant.

void DtForwarderObserverForAssistant::initialize ( DtRIDParameters params)
virtual

Initialization.

References myParams.

void DtForwarderObserverForAssistant::notWaitingForFowrarderConnections ( )
virtual

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

Implements DtRtiForwarderObserver.

References myIsWaitingForFws, myNeededFws, and sendWaitingForForwardersToAssistant().

void DtForwarderObserverForAssistant::processAssistantDisconnect ( void *  usr)
static

/brief Callback for assistant disconnect

References processAssistantDisconnect().

void DtForwarderObserverForAssistant::processAssistantDisconnect ( )
virtual
void DtForwarderObserverForAssistant::processEnableLoggingMsg ( const DtAssistantLogEnableMsg msg,
void *  usr 
)
static

Callback for logging enable command message.

Referenced by DtForwarderObserverForAssistant().

void DtForwarderObserverForAssistant::processEnableLoggingMsg ( const DtAssistantLogEnableMsg msg)
virtual

Process logging enable command.

References myAssistantClient, myLogPrinter, myParams, and DtRIDParameters::rtiForwarderLogFileName.

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

void DtForwarderObserverForAssistant::processExitCmndMsg ( const DtAssistantExitMsg msg)
virtual

Process exit command.

void DtForwarderObserverForAssistant::processForwarderObserveMsg ( const DtAssistantStateObserveMsg msg,
void *  usr 
)
static

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

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

void DtForwarderObserverForAssistant::processForwarderObserveMsg ( const DtAssistantStateObserveMsg msg)
virtual
void DtForwarderObserverForAssistant::processLogFileUpdatedEvent ( const MAKRti::DtFilename &  logFile)
virtual

Process a log file name update event.

void DtForwarderObserverForAssistant::processNotifyLevelChangeMsg ( const DtAssistantNtfyLvlUpdateMsg msg,
void *  usr 
)
static

Callback for notify level change command message.

Referenced by DtForwarderObserverForAssistant().

void DtForwarderObserverForAssistant::processNotifyLevelChangeMsg ( const DtAssistantNtfyLvlUpdateMsg msg)
virtual

Process notify level change command.

References myAssistantClient, and DtAssistantNtfyLvlUpdateMsg::notifyLevel().

void DtForwarderObserverForAssistant::processRidParamRequest ( const DtAssistantRidParamsMsg msg,
void *  usr 
)
static

/brief Callback for assistant RID parameter request message

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

void DtForwarderObserverForAssistant::processRidParamRequest ( const DtAssistantRidParamsMsg msg)
virtual
void DtForwarderObserverForAssistant::queryForConnectionInfo ( int &  forwarderPort,
MAKRti::DtInetAddr &  forwarderToConnectTo 
)
virtual
void DtForwarderObserverForAssistant::removeCallbacks ( )
protectedvirtual

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

void DtForwarderObserverForAssistant::sendForwarderInfoToAssistant ( ) const
protectedvirtual
void DtForwarderObserverForAssistant::sendWaitingForForwardersToAssistant ( ) const
protectedvirtual

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

void DtForwarderObserverForAssistant::tick ( )
virtual
void DtForwarderObserverForAssistant::waitingForFowrarderConnections ( const DtForwarderPort::DtConnAndNameMap allNeededFws,
const DtForwarderPort::DtConnAndNameMap stillNeededFws 
)
virtual

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

DtBoost::shared_ptr<DtRtiAssistantForwarderClient> DtForwarderObserverForAssistant::myAssistantClient
protected
DtAssistantPrinter* DtForwarderObserverForAssistant::myAssistantPrinter
protected

The printer which sends notifications to the assistant.

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

std::set<DtForwarderObserverConnInfo> DtForwarderObserverForAssistant::myClientForwarderConns
protected
MAKRti::DtClock DtForwarderObserverForAssistant::myClock
protected
std::set<DtForwarderObserverConnInfo> DtForwarderObserverForAssistant::myConnectedNotJoinedClientConns
protected
float DtForwarderObserverForAssistant::myDefunctRemovalTime
protected

Referenced by processForwarderObserveMsg(), and tick().

DtForwarderObserverConnInfo* DtForwarderObserverForAssistant::myExecConnection
protected
bool DtForwarderObserverForAssistant::myExecIsLocal
protected
std::set<DtForwarderObserverConnInfo> DtForwarderObserverForAssistant::myForwarderForwarderConns
protected
bool DtForwarderObserverForAssistant::myForwarderIsObserved
protected
int DtForwarderObserverForAssistant::myForwarderPort
protected

Forwarder connection information.

Referenced by queryForConnectionInfo(), and setForwarderInfo().

MAKRti::DtInetAddr DtForwarderObserverForAssistant::myForwarderToConnectTo
protected

Forwarder connection information.

Referenced by queryForConnectionInfo(), and setForwarderInfo().

bool DtForwarderObserverForAssistant::myGotConnInfoFromAssistant
protected

Whether or not the assistant supplied connection info.

Referenced by gotConnInfoFromAssistant(), and queryForConnectionInfo().

MAKRti::DtInetAddr DtForwarderObserverForAssistant::myHostAddr
protected

The host address used for connection.

bool DtForwarderObserverForAssistant::myIsWaitingForFws
protected
DtBoost::shared_ptr<DtFilePrinter> DtForwarderObserverForAssistant::myLogPrinter
protected

Printer which prints output to a log file.

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

DtNeededFwConnMap DtForwarderObserverForAssistant::myNeededFws
protected

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

DtRIDParameters* DtForwarderObserverForAssistant::myParams
protected
std::set<DtForwarderObserverDroppedConnInfo> DtForwarderObserverForAssistant::myUnexpectedlyDroppedClientConns
protected

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

Document ID: Generated on Wed Mar 11 20:26:49 EDT 2015 from SVN revision 150939
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)