MAK RTIspy API Documentation for HLA 1516
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtRtiexecObserverForAssistant Class Reference

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

+ Inheritance diagram for DtRtiexecObserverForAssistant:
+ Collaboration diagram for DtRtiexecObserverForAssistant:

Public Member Functions

 DtRtiexecObserverForAssistant ()
virtual ~DtRtiexecObserverForAssistant ()
virtual void initialize (DtRIDParameters *params, DtBoost::shared_ptr< DtRtiexecCmdProc > cmdProc)
 Initializes the observer.
virtual void startObservation ()
 Indicates that observation of the exec has begun.
bool gotConnInfoFromAssistant ()
 Returns true if the assistant supplied the rtiexec connection info.
- Public Member Functions inherited from DtRtiexecObserver
 DtRtiexecObserver ()
 Constructor.
virtual ~DtRtiexecObserver ()
 Destructor.
virtual void setMgr (DtRtiexecObserverMgr *mgr)
 Sets the manager for this observer.
virtual void removeMgr ()
 Removes the manager for this observer.
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, 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 void addTickCallback (DtTickWithExecCbFn fcn, DtTime interval)
 Add a tick callback function that takes a reference to a DtRtiExec to be called periodically at the given time interval.
virtual void removeTickCallback (DtTickWithExecCbFn fcn)
 Remove tick callback that takes a reference to a DtRtiExec.
virtual unsigned long connectionId () const
 Get the connection ID for this exec (threadsafe)

Protected Member Functions

virtual void addCallbacks ()
 Adds all RTI message and tick callbacks. Called when a manager is set.
virtual void removeCallbacks ()
 Removes all RTI message and tick callbacks.
void fillFederateTimeStateInfo (DtAssistantFederateInfo &stateInfo, unsigned long connId, const MAKRti::DtString &fedType, const MAKRti::DtString &fedName, DtFederateHandle fedHandle, const MAKRti::DtString &fedHostName, const MAKRti::DtInetAddr &fedHost, DtHlaVersionId hlaVersion, int astntCompId, const DtFedExec &fedExec)
 Fills in the federate time state using the given information.
virtual void sendConnectionInfo (bool isConnected)
 Send the connection info to the assistant.

Protected Attributes

DtBoost::shared_ptr
< DtRtiAssistantExecClient
myAssistantClient
 The assistant client.
DtAssistantPrintermyAssistantPrinter
 The printer which sends notifications to the assistant.
DtBufferPrintermyBufferPrinter
 The printer which stores all rtiexec output.
DtBoost::shared_ptr< DtPrinterBufmyPrinterBuffer
 Buffer which the buffer printer writes to.
DtBoost::shared_ptr
< DtRtiexecCmdProc
myCmdProc
 Processes commands to be performed by the rtiexec.
bool myFedReconnectEnabled
 Is federate reconnect enabled?
bool myAllowNetworkTesting
 Whether or not this rtiexec allows network testing for its federations.
DtFederationStateByNameMap myFederations
 Cache the complete state of the federations.
DtFederationNameByHandleMap myFederationNames
 Map of federation handles to names.
MAKRti::DtTime myMinTimeBetweenUpdates
 Min. time exec should wait between time state updates.
bool myGotConnInfoFromAssistant
 Whether or not the assistant supplied connection info.
bool myExecIsObserved
 Whether or not there is currently an assistant observing this rtiexec.
DtRIDParametersmyParams
 The RID parameter settings.
int myForwarderPort
 Stored information about the forwarder.
MAKRti::DtInetAddr myForwarderToConnectTo
 Stored information about the forwarder.
- Protected Attributes inherited from DtRtiexecObserver
DtRtiexecObserverMgrmyMgr
 Pointer to the observer manager.

Rtiexec event processing functions

virtual void tick ()
 Periodic processing.
virtual void queryForConnectionInfo (DtRtiConnectionInfoDataPair &connInfo, DtRtiConnectionConfigurationInfo &config)
 Periodic processing.
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 processFedExCreatedEvent (DtFedExec *exec)
 Process a new federation execution created event.
virtual void processFedExDestroyedEvent (DtFedExec *exec)
 Process a federation execution destroyed event.
virtual void processFederateJoinedEvent (DtFedExec *exec, DtFederate *federate)
 Process a federate joined event.
virtual void processFederateResignedEvent (DtFedExec *exec, DtFederate *federate)
 Process a federate resigned event.
virtual void processSyncPtRegisteredEvent (DtFedExec *exec, DtSyncPt *pt)
 Process a new sync. point registered event.
virtual void processFederationSynchronizedEvent (DtFedExec *exec, DtSyncPt *pt)
 Process a federation synchronized to an existing sync. point event.
virtual void processSyncPtAchievedEvent (DtFedExec *exec, DtFederate *federate, DtSyncPt *pt)
 Process an existing sync. point achieved event.
virtual void processFederateDisconnectedEvent (DtFedExec *exec, DtFederate *federate)
 Process a federate disconnect event.
virtual void processFederateReconnectSucceededEvent (DtFedExec *exec, DtFederate *federate)
 Process a federate reconnect succeeded event.
virtual void processFederateReconnectFailedEvent (DtFedExec *exec, DtFederate *federate)
 Process a federate reconnect failed event.
virtual void processLogFileUpdatedEvent (const MAKRti::DtFilename &logFile)
 Process a log file name update event.
virtual void processTimeStateEvent (const DtRtiExec &exec)
 Process a federate reconnect failed event.
static void tick (void *usr)
 Callback for periodic processing.
static void processTimeStateEvent (const DtRtiExec &exec, void *usr)
 Callback for periodic time state processing.

RTI message processing callbacks

virtual void processLatencyTestStatusMsg (const DtTestMgrStatusMsg &msg)
 Process latency test status message.
virtual void processLatencyTestResultsMsg (const DtLatencyReportMsg &msg)
 Process latency test status message.
static void processLatencyTestStatusMsg (const DtRtiMsg &msg, void *usr)
 Callback for latency test status message.
static void processLatencyTestResultsMsg (const DtRtiMsg &msg, void *usr)
 Callback for latency test results message.

RTI Assistant message processing callbacks

virtual void processExecObserveMsg (const DtAssistantStateObserveMsg &msg)
 Process exec observe message by enabling or disabling rtiexec update messages to the assistant.
virtual void processDeleteFederateMsg (const DtAssistantDeleteFederateMsg &msg)
 Process delete federate command.
virtual void processDeleteFederationMsg (const DtAssistantDeleteFederationMsg &msg)
 Process delete federation command.
virtual void processEnableLoggingMsg (const DtAssistantLogEnableMsg &msg)
 Process logging enable command.
virtual void processNotifyLevelChangeMsg (const DtAssistantNtfyLvlUpdateMsg &msg)
 Process notify level change command.
virtual void processNetworkTestingEnableMsg (const DtAssistantNetworkTestEnableMsg &msg)
 Process network testing enable/disable command.
virtual void processLatencyTestCmndMsg (const DtAssistantChangeLatencyTestModeMsg &msg)
 Process latency command.
virtual void processRidParamRequestMsg (const DtAssistantRidParamsMsg &msg)
 Process RID request.
virtual void processLogRequestMsg (const DtAssistantLogRequestMsg &msg)
 Process log request.
virtual void processExitCmndMsg (const DtAssistantExitMsg &msg)
 Process exit command.
virtual void processAssistantDisconnect ()
 Process assistant disconnect.
static void processExecObserveMsg (const DtAssistantStateObserveMsg &msg, void *usr)
 Callback for a command message notifying this exec that it is or is not being observed.
static void processDeleteFederateMsg (const DtAssistantDeleteFederateMsg &msg, void *usr)
 Callback for federate delete command message.
static void processDeleteFederationMsg (const DtAssistantDeleteFederationMsg &msg, void *usr)
 Callback for federation delete command 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 processNetworkTestingEnableMsg (const DtAssistantNetworkTestEnableMsg &msg, void *usr)
 Callback for networking testing enable/disable command message.
static void processLatencyTestCmndMsg (const DtAssistantChangeLatencyTestModeMsg &msg, void *usr)
 Callback for latency testing command message.
static void processRidParamRequestMsg (const DtAssistantRidParamsMsg &msg, void *usr)
 Callback for RID parameter request.
static void processLogRequestMsg (const DtAssistantLogRequestMsg &msg, void *usr)
 Callback for log request.
static void processExitCmndMsg (const DtAssistantExitMsg &msg, void *usr)
 Callback for exit command message.
static void processAssistantDisconnect (void *usr)
 Callback for assistant disconnect.

Detailed Description

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

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

Constructor & Destructor Documentation

DtRtiexecObserverForAssistant::DtRtiexecObserverForAssistant ( )
DtRtiexecObserverForAssistant::~DtRtiexecObserverForAssistant ( )
virtual

Member Function Documentation

void DtRtiexecObserverForAssistant::addCallbacks ( )
protectedvirtual
void DtRtiexecObserverForAssistant::disableNotifications ( )
virtual

Disables sending DtWarn & DtFatal to assistant as notifications.

References myAssistantPrinter.

void DtRtiexecObserverForAssistant::enableNotifications ( )
virtual

Enables sending DtWarn & DtFatal to assistant as notifications.

References myAssistantPrinter.

void DtRtiexecObserverForAssistant::fillFederateTimeStateInfo ( DtAssistantFederateInfo stateInfo,
unsigned long  connId,
const MAKRti::DtString &  fedType,
const MAKRti::DtString &  fedName,
DtFederateHandle  fedHandle,
const MAKRti::DtString &  fedHostName,
const MAKRti::DtInetAddr &  fedHost,
DtHlaVersionId  hlaVersion,
int  astntCompId,
const DtFedExec fedExec 
)
protected
bool DtRtiexecObserverForAssistant::gotConnInfoFromAssistant ( )
inline

Returns true if the assistant supplied the rtiexec connection info.

References myGotConnInfoFromAssistant.

void DtRtiexecObserverForAssistant::initialize ( DtRIDParameters params,
DtBoost::shared_ptr< DtRtiexecCmdProc cmdProc 
)
virtual
void DtRtiexecObserverForAssistant::processAssistantDisconnect ( void *  usr)
static

Callback for assistant disconnect.

References processAssistantDisconnect().

void DtRtiexecObserverForAssistant::processAssistantDisconnect ( )
virtual
void DtRtiexecObserverForAssistant::processDeleteFederateMsg ( const DtAssistantDeleteFederateMsg msg,
void *  usr 
)
static

Callback for federate delete command message.

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

void DtRtiexecObserverForAssistant::processDeleteFederateMsg ( const DtAssistantDeleteFederateMsg msg)
virtual
void DtRtiexecObserverForAssistant::processDeleteFederationMsg ( const DtAssistantDeleteFederationMsg msg,
void *  usr 
)
static

Callback for federation delete command message.

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

void DtRtiexecObserverForAssistant::processDeleteFederationMsg ( const DtAssistantDeleteFederationMsg msg)
virtual
void DtRtiexecObserverForAssistant::processEnableLoggingMsg ( const DtAssistantLogEnableMsg msg,
void *  usr 
)
static

Callback for logging enable command message.

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

void DtRtiexecObserverForAssistant::processEnableLoggingMsg ( const DtAssistantLogEnableMsg msg)
virtual

Process logging enable command.

References myCmdProc.

void DtRtiexecObserverForAssistant::processExecObserveMsg ( const DtAssistantStateObserveMsg msg,
void *  usr 
)
static

Callback for a command message notifying this exec that it is or is not being observed.

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

void DtRtiexecObserverForAssistant::processExecObserveMsg ( const DtAssistantStateObserveMsg msg)
virtual
void DtRtiexecObserverForAssistant::processExitCmndMsg ( const DtAssistantExitMsg msg,
void *  usr 
)
static

Callback for exit command message.

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

void DtRtiexecObserverForAssistant::processExitCmndMsg ( const DtAssistantExitMsg msg)
virtual

Process exit command.

References myAssistantClient, and myCmdProc.

void DtRtiexecObserverForAssistant::processFederateDisconnectedEvent ( DtFedExec exec,
DtFederate federate 
)
virtual
void DtRtiexecObserverForAssistant::processFederateJoinedEvent ( DtFedExec exec,
DtFederate federate 
)
virtual
void DtRtiexecObserverForAssistant::processFederateReconnectFailedEvent ( DtFedExec exec,
DtFederate federate 
)
virtual
void DtRtiexecObserverForAssistant::processFederateReconnectSucceededEvent ( DtFedExec exec,
DtFederate federate 
)
virtual
void DtRtiexecObserverForAssistant::processFederateResignedEvent ( DtFedExec exec,
DtFederate federate 
)
virtual
void DtRtiexecObserverForAssistant::processFederationSynchronizedEvent ( DtFedExec exec,
DtSyncPt pt 
)
virtual
void DtRtiexecObserverForAssistant::processFedExCreatedEvent ( DtFedExec exec)
virtual
void DtRtiexecObserverForAssistant::processFedExDestroyedEvent ( DtFedExec exec)
virtual

Process a federation execution destroyed event.

Reimplemented from DtRtiexecObserver.

References DtFedExec::fedExHandle(), DtFedExec::fedExName(), myAssistantClient, myExecIsObserved, myFederationNames, and myFederations.

void DtRtiexecObserverForAssistant::processLatencyTestCmndMsg ( const DtAssistantChangeLatencyTestModeMsg msg,
void *  usr 
)
static

Callback for latency testing command message.

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

void DtRtiexecObserverForAssistant::processLatencyTestCmndMsg ( const DtAssistantChangeLatencyTestModeMsg msg)
virtual
void DtRtiexecObserverForAssistant::processLatencyTestResultsMsg ( const DtRtiMsg msg,
void *  usr 
)
static

Callback for latency test results message.

Referenced by addCallbacks(), and removeCallbacks().

void DtRtiexecObserverForAssistant::processLatencyTestResultsMsg ( const DtLatencyReportMsg msg)
virtual
void DtRtiexecObserverForAssistant::processLatencyTestStatusMsg ( const DtRtiMsg msg,
void *  usr 
)
static

Callback for latency test status message.

Referenced by addCallbacks(), and removeCallbacks().

void DtRtiexecObserverForAssistant::processLatencyTestStatusMsg ( const DtTestMgrStatusMsg msg)
virtual
void DtRtiexecObserverForAssistant::processLogFileUpdatedEvent ( const MAKRti::DtFilename &  logFile)
virtual

Process a log file name update event.

Reimplemented from DtRtiexecObserver.

References myAssistantClient.

void DtRtiexecObserverForAssistant::processLogRequestMsg ( const DtAssistantLogRequestMsg msg,
void *  usr 
)
static

Callback for log request.

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

void DtRtiexecObserverForAssistant::processLogRequestMsg ( const DtAssistantLogRequestMsg msg)
virtual
void DtRtiexecObserverForAssistant::processNetworkTestingEnableMsg ( const DtAssistantNetworkTestEnableMsg msg,
void *  usr 
)
static

Callback for networking testing enable/disable command message.

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

void DtRtiexecObserverForAssistant::processNetworkTestingEnableMsg ( const DtAssistantNetworkTestEnableMsg msg)
virtual
void DtRtiexecObserverForAssistant::processNotifyLevelChangeMsg ( const DtAssistantNtfyLvlUpdateMsg msg,
void *  usr 
)
static

Callback for notify level change command message.

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

void DtRtiexecObserverForAssistant::processNotifyLevelChangeMsg ( const DtAssistantNtfyLvlUpdateMsg msg)
virtual

Process notify level change command.

References myCmdProc, and DtAssistantNtfyLvlUpdateMsg::notifyLevel().

void DtRtiexecObserverForAssistant::processRidParamRequestMsg ( const DtAssistantRidParamsMsg msg,
void *  usr 
)
static

Callback for RID parameter request.

Referenced by DtRtiexecObserverForAssistant().

void DtRtiexecObserverForAssistant::processRidParamRequestMsg ( const DtAssistantRidParamsMsg msg)
virtual
void DtRtiexecObserverForAssistant::processSyncPtAchievedEvent ( DtFedExec exec,
DtFederate federate,
DtSyncPt pt 
)
virtual
void DtRtiexecObserverForAssistant::processSyncPtRegisteredEvent ( DtFedExec exec,
DtSyncPt pt 
)
virtual
void DtRtiexecObserverForAssistant::processTimeStateEvent ( const DtRtiExec exec,
void *  usr 
)
static

Callback for periodic time state processing.

Referenced by addCallbacks(), processExecObserveMsg(), and removeCallbacks().

void DtRtiexecObserverForAssistant::processTimeStateEvent ( const DtRtiExec exec)
virtual
void DtRtiexecObserverForAssistant::queryForConnectionInfo ( DtRtiConnectionInfoDataPair connInfo,
DtRtiConnectionConfigurationInfo config 
)
virtual
void DtRtiexecObserverForAssistant::removeCallbacks ( )
protectedvirtual
void DtRtiexecObserverForAssistant::sendConnectionInfo ( bool  isConnected)
protectedvirtual
void DtRtiexecObserverForAssistant::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 DtRtiexecObserverForAssistant::startObservation ( )
virtual

Indicates that observation of the exec has begun.

Reimplemented from DtRtiexecObserver.

References sendConnectionInfo().

void DtRtiexecObserverForAssistant::tick ( void *  usr)
static

Callback for periodic processing.

References tick().

void DtRtiexecObserverForAssistant::tick ( )
virtual

Periodic processing.

References myAssistantClient.

Referenced by addCallbacks(), removeCallbacks(), and tick().

Member Data Documentation

bool DtRtiexecObserverForAssistant::myAllowNetworkTesting
protected

Whether or not this rtiexec allows network testing for its federations.

Referenced by initialize(), and processFedExCreatedEvent().

DtBoost::shared_ptr<DtRtiAssistantExecClient> DtRtiexecObserverForAssistant::myAssistantClient
protected
DtAssistantPrinter* DtRtiexecObserverForAssistant::myAssistantPrinter
protected
DtBufferPrinter* DtRtiexecObserverForAssistant::myBufferPrinter
protected

The printer which stores all rtiexec output.

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

DtBoost::shared_ptr<DtRtiexecCmdProc> DtRtiexecObserverForAssistant::myCmdProc
protected
bool DtRtiexecObserverForAssistant::myExecIsObserved
protected
DtFederationNameByHandleMap DtRtiexecObserverForAssistant::myFederationNames
protected
DtFederationStateByNameMap DtRtiexecObserverForAssistant::myFederations
protected
bool DtRtiexecObserverForAssistant::myFedReconnectEnabled
protected

Is federate reconnect enabled?

Referenced by initialize(), and processFederateDisconnectedEvent().

int DtRtiexecObserverForAssistant::myForwarderPort
protected

Stored information about the forwarder.

Referenced by queryForConnectionInfo(), sendConnectionInfo(), and setForwarderInfo().

MAKRti::DtInetAddr DtRtiexecObserverForAssistant::myForwarderToConnectTo
protected

Stored information about the forwarder.

Referenced by queryForConnectionInfo(), sendConnectionInfo(), and setForwarderInfo().

bool DtRtiexecObserverForAssistant::myGotConnInfoFromAssistant
protected

Whether or not the assistant supplied connection info.

Referenced by gotConnInfoFromAssistant(), and queryForConnectionInfo().

MAKRti::DtTime DtRtiexecObserverForAssistant::myMinTimeBetweenUpdates
protected

Min. time exec should wait between time state updates.

Referenced by addCallbacks(), and processExecObserveMsg().

DtRIDParameters* DtRtiexecObserverForAssistant::myParams
protected
DtBoost::shared_ptr<DtPrinterBuf> DtRtiexecObserverForAssistant::myPrinterBuffer
protected

Buffer which the buffer printer writes to.

Referenced by DtRtiexecObserverForAssistant(), and processLogRequestMsg().


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

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)