MAK RTIspy API Documentation for HLA Evolved
 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 ()
 Default CTOR. More...
 
virtual ~DtForwarderObserverForAssistant ()
 Virtual DTOR. More...
 
virtual void initialize (DtRIDParameters *params)
 Initialize the observer. More...
 
virtual void queryForConnectionInfo (int &forwarderPort, MAKRti::DtInetAddr &forwarderToConnectTo)
 Queries the assistant for the connection info to use. More...
 
virtual void performParameterOverrides (DtRIDParameters &ridParams) const
 Overrides RID parameters based on connection status and other settings. More...
 
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. More...
 
virtual void enableNotifications ()
 Enables sending DtWarn & DtFatal to assistant as notifications. More...
 
virtual void disableNotifications ()
 Disables sending DtWarn & DtFatal to assistant as notifications. More...
 
virtual void processLogFileUpdatedEvent (const MAKRti::DtFilename &logFile)
 Process a log file name update event. More...
 
virtual int clientToForwarderConnectionEstablished (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, const MAKRti::DtString &connType, unsigned int connID, const DtInetAddrAndPort &connAddr)
 Callback for established joined client<->forwarder connections. More...
 
virtual int clientToForwarderConnectionLost (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int connID, const DtInetAddrAndPort &connAddr)
 Callback for lost client<->forwarder connections. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual int forwarderToForwarderExecLost (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &connAddr)
 Callback for lost forwarder<->forwarder exec connections. More...
 
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. More...
 
virtual int clientToForwarderExecLost (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &connAddr)
 Callback for lost client->forwarder exec connections. More...
 
virtual void forwarderToForwarderConnectionEstablished (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int connID, const std::pair< DtInetAddrAndPort, DtInetAddrAndPort > &connAddr)
 Callback for established forwarder<->forwarder connections. More...
 
virtual void forwarderToForwarderConnectionLost (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int connID, const std::pair< DtInetAddrAndPort, DtInetAddrAndPort > &connAddr)
 Callback for lost forwarder<->forwarder connections. More...
 
virtual void forwarderToForwarderConnectionChanged (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int oldConnID, unsigned int newConnID, const DtInetAddrAndPort &connAddr)
 Callback for changed forwarder<->forwarder connections. More...
 
virtual int clientToForwarderSocketQueueUpdate (unsigned int connId, int connQueueStatus)
 Callback for socket queue update. More...
 
virtual void waitingForFowrarderConnections (const DtForwarderPort::DtConnAndNameMap &allNeededFws, const DtForwarderPort::DtConnAndNameMap &stillNeededFws)
 Callback to signal that forwarder is waiting for forwarder<->forwarder connections. More...
 
virtual void notWaitingForFowrarderConnections ()
 Callback to signal that forwarder is no longer waiting for forwarder<->forwarder connections. More...
 
bool gotConnInfoFromAssistant ()
 /brief Returns true if the assistant supplied the RTI Forwarder connection info. More...
 
DtBoost::shared_ptr
< DtRtiAssistantForwarderClient
assistantClient ()
 
virtual void sendTrayNotification (const MAKRti::DtString &text, DtNotifyLevelType notifyLevel)
 
const DtRIDParametersridParams () const
 
DtRIDParametersridParams ()
 
- Public Member Functions inherited from DtRtiForwarderObserver
 DtRtiForwarderObserver ()
 Constructor. More...
 
virtual ~DtRtiForwarderObserver ()
 Destructor. More...
 
virtual void setMgr (DtRtiForwarderObserverMgr *mgr)
 Sets the manager for this observer. More...
 
virtual void initMgr ()
 Initializes the mgr. More...
 
virtual void removeMgr ()
 Removes the manager for this observer. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void addTickCallback (DtTickCbFn fcn, MAKRti::DtTime interval)
 Add a tick callback function to be called periodically at the given time interval. More...
 
virtual void removeTickCallback (DtTickCbFn fcn)
 Remove tick callback. More...
 
virtual unsigned long connectionId () const
 Get the connection ID for this forwarder (thread safe) More...
 

Protected Member Functions

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

Protected Attributes

DtBoost::shared_ptr
< DtRtiAssistantForwarderClient
myAssistantClient
 The assistant client. More...
 
DtAssistantPrintermyAssistantPrinter
 The printer which sends notifications to the assistant. More...
 
bool myForwarderIsObserved
 Whether or not there is currently an assistant observing this RTI Forwarder. More...
 
DtRIDParametersmyParams
 The RID parameter settings. More...
 
MAKRti::DtInetAddr myHostAddr
 The host address used for connection. More...
 
bool myGotConnInfoFromAssistant
 Whether or not the assistant supplied connection info. More...
 
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. More...
 
bool myIsWaitingForFws
 Whether we are still waiting for forwarder connections. More...
 
MAKRti::DtClock myClock
 
float myDefunctRemovalTime
 
DtForwarderObserverConnInfomyExecConnection
 
bool myExecIsLocal
 
DtBoost::shared_ptr
< DtFilePrinter > 
myLogPrinter
 Printer which prints output to a log file. More...
 
int myForwarderPort
 Forwarder connection information. More...
 
MAKRti::DtInetAddr myForwarderToConnectTo
 Forwarder connection information. More...
 
- Protected Attributes inherited from DtRtiForwarderObserver
DtRtiForwarderObserverMgrmyMgr
 Pointer to the observer manager. More...
 

event processing functions

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

RTI Assistant message processing callbacks

virtual void processForwarderObserveMsg (const DtAssistantStateObserveMsg &msg)
 /brief Process forwarder observer message by enabling or disabling update messages. More...
 
virtual void processExitCmndMsg (const DtAssistantExitMsg &msg)
 Process exit command. More...
 
virtual void processRidParamRequest (const DtAssistantRidParamsMsg &msg)
 Process RID parameter request. More...
 
virtual void processEnableLoggingMsg (const DtAssistantLogEnableMsg &msg)
 Process logging enable command. More...
 
virtual void processNotifyLevelChangeMsg (const DtAssistantNtfyLvlUpdateMsg &msg)
 Process notify level change command. More...
 
virtual void processAssistantDisconnect ()
 Process assistant disconnect. More...
 
static void processForwarderObserveMsg (const DtAssistantStateObserveMsg &msg, void *usr)
 /brief Callback for a message notifying this forwarder that it is or is not being observed. More...
 
static void processExitCmndMsg (const DtAssistantExitMsg &msg, void *usr)
 /brief Callback for exit command message More...
 
static void processRidParamRequest (const DtAssistantRidParamsMsg &msg, void *usr)
 /brief Callback for assistant RID parameter request message More...
 
static void processEnableLoggingMsg (const DtAssistantLogEnableMsg &msg, void *usr)
 Callback for logging enable command message. More...
 
static void processNotifyLevelChangeMsg (const DtAssistantNtfyLvlUpdateMsg &msg, void *usr)
 Callback for notify level change command message. More...
 
static void processAssistantDisconnect (void *usr)
 /brief Callback for assistant disconnect More...
 

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

Default CTOR.

virtual DtForwarderObserverForAssistant::~DtForwarderObserverForAssistant ( )
virtual

Virtual DTOR.

Member Function Documentation

virtual void DtForwarderObserverForAssistant::addCallbacks ( )
protectedvirtual

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

Implements DtRtiForwarderObserver.

DtBoost::shared_ptr<DtRtiAssistantForwarderClient> DtForwarderObserverForAssistant::assistantClient ( )
inline
virtual int DtForwarderObserverForAssistant::clientToForwarderConnectionEstablished ( const MAKRti::DtString &  connName,
const MAKRti::DtString &  hostName,
const MAKRti::DtString &  connType,
unsigned int  connID,
const DtInetAddrAndPort connAddr 
)
virtual

Callback for established joined client<->forwarder connections.

Implements DtRtiForwarderObserver.

virtual int DtForwarderObserverForAssistant::clientToForwarderConnectionLost ( const MAKRti::DtString &  connName,
const MAKRti::DtString &  hostName,
unsigned int  connID,
const DtInetAddrAndPort connAddr 
)
virtual

Callback for lost client<->forwarder connections.

Implements DtRtiForwarderObserver.

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

Callback for connected client->forwarder exec connections.

Implements DtRtiForwarderObserver.

virtual int DtForwarderObserverForAssistant::clientToForwarderExecLost ( const MAKRti::DtString &  connName,
unsigned int  connID,
const DtInetAddrAndPort connAddr 
)
virtual

Callback for lost client->forwarder exec connections.

Implements DtRtiForwarderObserver.

virtual 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

Callback for fully joined client<->forwarder connections.

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.

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

Callback for socket queue update.

Implements DtRtiForwarderObserver.

virtual void DtForwarderObserverForAssistant::disableNotifications ( )
virtual

Disables sending DtWarn & DtFatal to assistant as notifications.

virtual void DtForwarderObserverForAssistant::enableNotifications ( )
virtual

Enables sending DtWarn & DtFatal to assistant as notifications.

virtual void DtForwarderObserverForAssistant::forwarderToForwarderConnectionChanged ( const MAKRti::DtString &  connName,
const MAKRti::DtString &  hostName,
unsigned int  oldConnID,
unsigned int  newConnID,
const DtInetAddrAndPort connAddr 
)
virtual

Callback for changed forwarder<->forwarder connections.

Implements DtRtiForwarderObserver.

virtual void DtForwarderObserverForAssistant::forwarderToForwarderConnectionEstablished ( const MAKRti::DtString &  connName,
const MAKRti::DtString &  hostName,
unsigned int  connID,
const std::pair< DtInetAddrAndPort, DtInetAddrAndPort > &  connAddr 
)
virtual

Callback for established forwarder<->forwarder connections.

Implements DtRtiForwarderObserver.

virtual void DtForwarderObserverForAssistant::forwarderToForwarderConnectionLost ( const MAKRti::DtString &  connName,
const MAKRti::DtString &  hostName,
unsigned int  connID,
const std::pair< DtInetAddrAndPort, DtInetAddrAndPort > &  connAddr 
)
virtual

Callback for lost forwarder<->forwarder connections.

Implements DtRtiForwarderObserver.

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

Callback for connected forwarder<->forwarder exec connections.

Implements DtRtiForwarderObserver.

virtual int DtForwarderObserverForAssistant::forwarderToForwarderExecLost ( const MAKRti::DtString &  connName,
unsigned int  connID,
const DtInetAddrAndPort connAddr 
)
virtual

Callback for lost forwarder<->forwarder exec connections.

Implements DtRtiForwarderObserver.

bool DtForwarderObserverForAssistant::gotConnInfoFromAssistant ( )
inline

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

References myGotConnInfoFromAssistant.

virtual void DtForwarderObserverForAssistant::initialize ( DtRIDParameters params)
virtual

Initialize the observer.

Observer takes ownership of params, which could be changed or reinstantiated - do not continue to use the pointer passed into this method. Use ridParams accessor instead.

virtual void DtForwarderObserverForAssistant::notWaitingForFowrarderConnections ( )
virtual

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

Implements DtRtiForwarderObserver.

virtual void DtForwarderObserverForAssistant::performParameterOverrides ( DtRIDParameters ridParams) const
virtual

Overrides RID parameters based on connection status and other settings.

static void DtForwarderObserverForAssistant::processAssistantDisconnect ( void *  usr)
static

/brief Callback for assistant disconnect

virtual void DtForwarderObserverForAssistant::processAssistantDisconnect ( )
virtual

Process assistant disconnect.

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

Callback for logging enable command message.

virtual void DtForwarderObserverForAssistant::processEnableLoggingMsg ( const DtAssistantLogEnableMsg msg)
virtual

Process logging enable command.

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

/brief Callback for exit command message

virtual void DtForwarderObserverForAssistant::processExitCmndMsg ( const DtAssistantExitMsg msg)
virtual

Process exit command.

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

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

virtual void DtForwarderObserverForAssistant::processForwarderObserveMsg ( const DtAssistantStateObserveMsg msg)
virtual

/brief Process forwarder observer message by enabling or disabling update messages.

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

Process a log file name update event.

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

Callback for notify level change command message.

virtual void DtForwarderObserverForAssistant::processNotifyLevelChangeMsg ( const DtAssistantNtfyLvlUpdateMsg msg)
virtual

Process notify level change command.

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

/brief Callback for assistant RID parameter request message

virtual void DtForwarderObserverForAssistant::processRidParamRequest ( const DtAssistantRidParamsMsg msg)
virtual

Process RID parameter request.

virtual void DtForwarderObserverForAssistant::queryForConnectionInfo ( int &  forwarderPort,
MAKRti::DtInetAddr &  forwarderToConnectTo 
)
virtual

Queries the assistant for the connection info to use.

Note: May reinstantiate RID Parameters object, invalidating old pointers.

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.

const DtRIDParameters* DtForwarderObserverForAssistant::ridParams ( ) const
inline
DtRIDParameters* DtForwarderObserverForAssistant::ridParams ( )
inline
virtual void DtForwarderObserverForAssistant::sendForwarderInfoToAssistant ( ) const
protectedvirtual

/brief Populates necessary data and sends it to the assistant client (for observation requests)

void DtForwarderObserverForAssistant::sendTrayNotification ( const MAKRti::DtString &  text,
DtNotifyLevelType  notifyLevel 
)
virtual

References myAssistantClient.

virtual 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.

virtual 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.

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

Callback for periodic processing.

virtual void DtForwarderObserverForAssistant::tick ( )
virtual

Periodic processing.

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.

Member Data Documentation

DtBoost::shared_ptr<DtRtiAssistantForwarderClient> DtForwarderObserverForAssistant::myAssistantClient
protected

The assistant client.

Referenced by sendTrayNotification().

DtAssistantPrinter* DtForwarderObserverForAssistant::myAssistantPrinter
protected

The printer which sends notifications to the assistant.

std::set<DtForwarderObserverConnInfo> DtForwarderObserverForAssistant::myClientForwarderConns
protected
MAKRti::DtClock DtForwarderObserverForAssistant::myClock
protected
std::set<DtForwarderObserverConnInfo> DtForwarderObserverForAssistant::myConnectedNotJoinedClientConns
protected
float DtForwarderObserverForAssistant::myDefunctRemovalTime
protected
DtForwarderObserverConnInfo* DtForwarderObserverForAssistant::myExecConnection
protected
bool DtForwarderObserverForAssistant::myExecIsLocal
protected
std::set<DtForwarderObserverConnInfo> DtForwarderObserverForAssistant::myForwarderForwarderConns
protected
bool DtForwarderObserverForAssistant::myForwarderIsObserved
protected

Whether or not there is currently an assistant observing this RTI Forwarder.

int DtForwarderObserverForAssistant::myForwarderPort
protected

Forwarder connection information.

MAKRti::DtInetAddr DtForwarderObserverForAssistant::myForwarderToConnectTo
protected

Forwarder connection information.

bool DtForwarderObserverForAssistant::myGotConnInfoFromAssistant
protected

Whether or not the assistant supplied connection info.

Referenced by gotConnInfoFromAssistant().

MAKRti::DtInetAddr DtForwarderObserverForAssistant::myHostAddr
protected

The host address used for connection.

bool DtForwarderObserverForAssistant::myIsWaitingForFws
protected

Whether we are still waiting for forwarder connections.

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

Printer which prints output to a log file.

DtNeededFwConnMap DtForwarderObserverForAssistant::myNeededFws
protected

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

DtRIDParameters* DtForwarderObserverForAssistant::myParams
protected

The RID parameter settings.

std::set<DtForwarderObserverDroppedConnInfo> DtForwarderObserverForAssistant::myUnexpectedlyDroppedClientConns
protected

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

Document ID: Generated on Mon Sep 7 15:40:32 EDT 2020 from SVN revision 217499
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)