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 | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtRtiExec Class Reference
+ Collaboration diagram for DtRtiExec:

Public Member Functions

virtual ~DtRtiExec ()
 Destructor.
virtual void shutdownForwarderIfCreated ()
virtual void checkVersion (const DtString &version) const
 Called by the exec application to make sure that the RTI Version matches.
virtual void processCreate (const DtCreateMsg &msg)
 Called when a createFedEx message is received.
virtual void processDestroy (const DtDestroyMsg &msg)
 Called when a destroyFedEx message is received.
virtual void processListFederations (const DtListFederationsMsg &msg)
 Called when a list federations message is received.
virtual void processJoin (const DtJoinMsg &msg)
 Called when a Join message is received.
virtual void processDisconnect (const DtDisconnectMsg &msg)
 Called when a disconnect message is received Actually used to capture broken connection.
virtual void processQueueFull (const DtQueueFullMsg &msg)
 Called when a queue full message is received.
virtual void processReconnect (const DtReconnectMsg &msg)
 Called when a reconnect message is received Actually used to recover from a broken connection.
virtual DtFedExeccreateFedEx (DtConnectionMgr *connMgr, const std::vector< unsigned int > &crcs, const char *fedExName, std::string const &timeImplName, MAKRti::DtFomType fedType, const std::vector< DtString > &fedFileName, const DtString &momModuleName, int fedExHandle, DtRIDParameters *params, unsigned int momModuleCrc)
 Returns a new fed ex instance, Override this function to replace the default federation execution object.
DtConnectionMgrconnectMgr ()
 Returns the connection manager Not virtual because referenced in both ctors and dtors.
virtual bool exists (const DtString &fedExName)
 Returns true if the name fedex exists, false otherwise.
virtual void destroyFederationByName (const DtString &fullFedexName, bool sendDestroyResponse=true, bool forceDestroy=false)
 Attempt to destroy a federation.
int processQuit ()
 User request to quit is processed.
virtual void listFederates ()
 Respond to a request to list federates through interactive input.
virtual void parseDeleteCommand (const DtString &command, unsigned int &handle, DtString &federationName) const
 Respond to a request to delete a federate through interactive input.
virtual int deleteFederate (unsigned int handle, const DtString &federationName)
virtual void processUpdateNotifyLevel (DtNotifyLevelType level)
 Updates the rtiexec notify level.
virtual void exit ()
 Causes the rtiexec to exit.
virtual void enableLogging ()
 Enables logging.
DtFedExecfedExec (const DtString &fedExName)
 Search for a fed rtiexec by name.
const DtFedExecfedExec (const DtString &fedExName) const
const std::map< DtString,
DtFedExec * > & 
fedExecs () const
 Returns a reference to the entire map of federations.
const DtRIDParametersparams () const
 Returns a handle to the current RID Params.
virtual void run ()
 main loop
virtual bool tick (bool noCallbacks=false)
 Work performed here for each cycle in main loop.
virtual void wait (DtTime intervalInSeconds)
 Wait for input or until the the given interval expires.
virtual void addFedExCreatedCallback (DtFedExCbFn fn, void *usr)
 Register a callback to be triggered whenever a new federation execution is created.
virtual void removeFedExCreatedCallback (DtFedExCbFn fn, void *usr)
virtual void addFedExDestroyedCallback (DtFedExCbFn fn, void *usr)
 Register a callback to be triggered whenever an existing federation execution is destroyed.
virtual void removeFedExDestroyedCallback (DtFedExCbFn fn, void *usr)
virtual void addLogFileNameUpdatedCallback (DtLogFileNameCbFn fn, void *usr)
 Register a callback to be triggered whenever the log file name for the rtiexec is updated.
virtual void removeLogFileNameUpdatedCallback (DtLogFileNameCbFn fn, void *usr)
virtual void addTickCallback (DtTickCbFn fn, void *usr, DtTime interval)
 Register a callback to be called during tick, but only at the given interval.
virtual void removeTickCallback (DtTickCbFn fn, void *usr)
virtual void addTickCallback (DtTickWithExecCbFn fn, void *usr, DtTime interval)
 Register a callback to be called during tick, but only at the given interval.
virtual void removeTickCallback (DtTickWithExecCbFn fn, void *usr)
virtual void sendCreateResponseMsg (const unsigned long destinationID, DtCreateResponseFlag flag, MAKRti::DtString const &errorString)
 Send RTI messages.
virtual void sendDestroyResponseMsg (const char *fedExName, DtDestroyResponseFlag flag)
virtual void sendReportFederationsMsg (unsigned long destId, const std::vector< DtString > &federationNames, const std::vector< DtString > &timeImplNames)
virtual void sendJoinResponseMsg (unsigned long destinationIDValue, unsigned short requestID, unsigned int crc, DtFederateHandle handle, const char *fedName, int fedExHandle, const char *fedExName, const DtString &momModule, const std::vector< DtString > &fedFileName, unsigned long flags, bool allowNetworkTesting, MAKRti::DtString const &errorString, DtJoinResponseMsg::errorCodes errorValue=DtJoinResponseMsg::DT_NO_ERROR)
virtual void ridRequestCb (const DtRidTestRequestMsg &msg)
 The RID request callback is processed by the RTI in response to a ridTestRequest.

Static Public Member Functions

static DtRtiExeccreate (DtRIDParameters *p, DtBoost::shared_ptr< DtFilePrinter > logPrinter, bool autoExit=false, const DtRtiConnectionInfoDataPair &connInfo=DtRtiConnectionInfoDataPair())
 Creates an instance of a DtRtiExec;.
static void setCreatorFunction (DtRtiExecCreator fn)
 Call this function to set an alternate creator function With this function, users can replace this DtRtiExec with their own derived class.
static void processRtiExecHandshakeMsg (const DtRtiExecHandshakeMsg &msg, void *usr)
 Handshake message callback.
static void processCreate (const DtCreateMsg &msg, void *usr)
 Callback on the createFedEx message.
static void processDestroy (const DtDestroyMsg &msg, void *usr)
 Callback on the destroyFedEx message.
static void processListFederations (const DtListFederationsMsg &msg, void *usr)
 Callback on the list federations message.
static void processJoin (const DtJoinMsg &msg, void *usr)
 Callback on the Join message.
static void processDisconnect (const DtDisconnectMsg &msg, void *usr)
 Callback on the Disconnect message.
static void processQueueFull (const DtQueueFullMsg &msg, void *usr)
 Callback on the Queue Full message.
static void processReconnect (const DtReconnectMsg &msg, void *usr)
 Callback on the Reconnect message.
static void ridRequestCb (const DtRidTestRequestMsg &msg, void *usr)
 RID File Received callback.
static bool shutdownSignalCaught ()
static void caughtShutdownSignal ()

Protected Types

enum  DtStartRtiForwarderResult { ForwarderSuccessfullyStarted, RetryStartingForwarder, ForwarderStartupFailed }
typedef std::map< unsigned
long, DtTime > 
DtConnIdToTimeMap

Protected Member Functions

 DtRtiExec (DtRIDParameters *p, DtBoost::shared_ptr< DtFilePrinter > logPrinter, bool autoExit, const DtRtiConnectionInfoDataPair &connInfo)
 Constructor.
void cleanupConstructorException ()
 Clean up before constructor throws an exception Not virtual since it is called by constructor.
virtual void rtiExecToForwarderHandshake ()
 Inform RTI Forwarder that Exec is connected, and verify that this is the ONLY Exec connected.
virtual void sendRtiExecHandshakeMsg (DtHandle destId, DtRtiExecHandshakeMsg::DtHandshakeStatus status)
 Send RTI Forwarder connection response msg.
virtual void processRtiExecHandshakeMsg (const DtRtiExecHandshakeMsg &msg)
 Process the RTI Forwarder's Handshake response.
virtual void performMulticastDiscovery (bool reliableTransportDisabled)
 Attempt to discover either the RTI Forwarder or other rtiexecs.
virtual void removeDroppedFederateConnections ()
 Force resign a federate.
virtual DtStartRtiForwarderResult startRtiForwarder (const DtRIDParameters *params)
 Starts forwarder if the exec is configured to do so.

Protected Attributes

DtConnectionMgrmyConnectionMgr
std::map< DtString, DtFedExec * > myExecByName
std::map< DtFederationHandle,
DtFedExec * > 
myExecByHandle
DtString lineOfInput
bool myHandleForDeleteComplete
bool myFedNameForDeleteComplete
DtString myFederationNameForDelete
unsigned int myHandleForDelete
bool myCreatedRtiForwarder
bool myPendingDelete
bool myPendingQuit
int myFreeFedExHandle
DtList myCreateCallbacks
DtList myDestroyCallbacks
std::list< DtTickCallbackInfomyTickCallbacks
 List of tick callbacks.
std::list
< DtTickWithExecCallbackInfo
myTickWithExecCallbacks
 List of tick callbacks with DtRtiExec reference.
std::list
< DtLogFileNameCallbackInfo
myLogFileNameCallbacks
 List of log file name update callbacks.
DtClock myClock
DtRtiExecHandshakeMsg::DtHandshakeStatus myHandshakeStatus
DtTime myNextHeartbeat
DtRtiMsgForwarderSP myRtiForwarder
DtForwarderFaultManagermyFaultManager
DtMulitcastDiscoveryMgrmyMcastDiscoveryMgr
DtConnIdToTimeMap myDisconnectedFederates
 Map of dropped Federate to timestamp of drop.
DtRIDParametersmyParams
bool myAutoExit
bool myExitCommanded
 Flag indicating that an exit command was received.
DtBoost::shared_ptr
< DtFilePrinter > 
myLogPrinter
 Printer which prints output to a log file.
DtRtiConnectionInfoDataPair myConnInfo
DtString myHostname

Static Protected Attributes

static bool theShutdownSignalCaught
static DtRtiExecCreator theCreator

Member Typedef Documentation

typedef std::map< unsigned long, DtTime > DtRtiExec::DtConnIdToTimeMap
protected

Member Enumeration Documentation

Enumerator:
ForwarderSuccessfullyStarted 
RetryStartingForwarder 
ForwarderStartupFailed 

Constructor & Destructor Documentation

DtRtiExec::DtRtiExec ( DtRIDParameters p,
DtBoost::shared_ptr< DtFilePrinter >  logPrinter,
bool  autoExit,
const DtRtiConnectionInfoDataPair connInfo 
)
protected

Constructor.

virtual DtRtiExec::~DtRtiExec ( )
virtual

Destructor.

Member Function Documentation

virtual void DtRtiExec::addFedExCreatedCallback ( DtFedExCbFn  fn,
void *  usr 
)
virtual

Register a callback to be triggered whenever a new federation execution is created.

virtual void DtRtiExec::addFedExDestroyedCallback ( DtFedExCbFn  fn,
void *  usr 
)
virtual

Register a callback to be triggered whenever an existing federation execution is destroyed.

virtual void DtRtiExec::addLogFileNameUpdatedCallback ( DtLogFileNameCbFn  fn,
void *  usr 
)
virtual

Register a callback to be triggered whenever the log file name for the rtiexec is updated.

virtual void DtRtiExec::addTickCallback ( DtTickCbFn  fn,
void *  usr,
DtTime  interval 
)
virtual

Register a callback to be called during tick, but only at the given interval.

virtual void DtRtiExec::addTickCallback ( DtTickWithExecCbFn  fn,
void *  usr,
DtTime  interval 
)
virtual

Register a callback to be called during tick, but only at the given interval.

For callbacks which will be passed a reference to the calling DtRtiExec.

static void DtRtiExec::caughtShutdownSignal ( )
static
virtual void DtRtiExec::checkVersion ( const DtString &  version) const
virtual

Called by the exec application to make sure that the RTI Version matches.

void DtRtiExec::cleanupConstructorException ( )
protected

Clean up before constructor throws an exception Not virtual since it is called by constructor.

DtConnectionMgr * DtRtiExec::connectMgr ( )
inline

Returns the connection manager Not virtual because referenced in both ctors and dtors.

References myConnectionMgr.

static DtRtiExec* DtRtiExec::create ( DtRIDParameters p,
DtBoost::shared_ptr< DtFilePrinter >  logPrinter,
bool  autoExit = false,
const DtRtiConnectionInfoDataPair connInfo = DtRtiConnectionInfoDataPair() 
)
static

Creates an instance of a DtRtiExec;.

virtual DtFedExec* DtRtiExec::createFedEx ( DtConnectionMgr connMgr,
const std::vector< unsigned int > &  crcs,
const char *  fedExName,
std::string const &  timeImplName,
MAKRti::DtFomType  fedType,
const std::vector< DtString > &  fedFileName,
const DtString &  momModuleName,
int  fedExHandle,
DtRIDParameters params,
unsigned int  momModuleCrc 
)
virtual

Returns a new fed ex instance, Override this function to replace the default federation execution object.

virtual int DtRtiExec::deleteFederate ( unsigned int  handle,
const DtString &  federationName 
)
virtual
virtual void DtRtiExec::destroyFederationByName ( const DtString &  fullFedexName,
bool  sendDestroyResponse = true,
bool  forceDestroy = false 
)
virtual

Attempt to destroy a federation.

By default, if destruction fails, a destroy response is sent. If this is being called in response to a command at the rtiexec GUI, then no response needs to be sent. If forceDestroy is set, federation is destroyed regardless of whether it has joined federates.

virtual void DtRtiExec::enableLogging ( )
virtual

Enables logging.

virtual bool DtRtiExec::exists ( const DtString &  fedExName)
virtual

Returns true if the name fedex exists, false otherwise.

virtual void DtRtiExec::exit ( )
virtual

Causes the rtiexec to exit.

DtFedExec* DtRtiExec::fedExec ( const DtString &  fedExName)

Search for a fed rtiexec by name.

Returns NULL if none are found.

const DtFedExec* DtRtiExec::fedExec ( const DtString &  fedExName) const
const std::map<DtString, DtFedExec*>& DtRtiExec::fedExecs ( ) const

Returns a reference to the entire map of federations.

virtual void DtRtiExec::listFederates ( )
virtual

Respond to a request to list federates through interactive input.

const DtRIDParameters & DtRtiExec::params ( ) const
inline

Returns a handle to the current RID Params.

References myParams.

virtual void DtRtiExec::parseDeleteCommand ( const DtString &  command,
unsigned int &  handle,
DtString &  federationName 
) const
virtual

Respond to a request to delete a federate through interactive input.

virtual void DtRtiExec::performMulticastDiscovery ( bool  reliableTransportDisabled)
protectedvirtual

Attempt to discover either the RTI Forwarder or other rtiexecs.

virtual void DtRtiExec::processCreate ( const DtCreateMsg msg)
virtual

Called when a createFedEx message is received.

static void DtRtiExec::processCreate ( const DtCreateMsg msg,
void *  usr 
)
static

Callback on the createFedEx message.

virtual void DtRtiExec::processDestroy ( const DtDestroyMsg msg)
virtual

Called when a destroyFedEx message is received.

static void DtRtiExec::processDestroy ( const DtDestroyMsg msg,
void *  usr 
)
static

Callback on the destroyFedEx message.

virtual void DtRtiExec::processDisconnect ( const DtDisconnectMsg msg)
virtual

Called when a disconnect message is received Actually used to capture broken connection.

static void DtRtiExec::processDisconnect ( const DtDisconnectMsg msg,
void *  usr 
)
static

Callback on the Disconnect message.

virtual void DtRtiExec::processJoin ( const DtJoinMsg msg)
virtual

Called when a Join message is received.

static void DtRtiExec::processJoin ( const DtJoinMsg msg,
void *  usr 
)
static

Callback on the Join message.

virtual void DtRtiExec::processListFederations ( const DtListFederationsMsg msg)
virtual

Called when a list federations message is received.

static void DtRtiExec::processListFederations ( const DtListFederationsMsg msg,
void *  usr 
)
static

Callback on the list federations message.

virtual void DtRtiExec::processQueueFull ( const DtQueueFullMsg msg)
virtual

Called when a queue full message is received.

static void DtRtiExec::processQueueFull ( const DtQueueFullMsg msg,
void *  usr 
)
static

Callback on the Queue Full message.

int DtRtiExec::processQuit ( )

User request to quit is processed.

If there are no federations, quit is granted immediately. Otherwise, a pending quit status is set to true and the user is prompted to confirm the quit request. Return -1 if quit should be granted immediately.

virtual void DtRtiExec::processReconnect ( const DtReconnectMsg msg)
virtual

Called when a reconnect message is received Actually used to recover from a broken connection.

static void DtRtiExec::processReconnect ( const DtReconnectMsg msg,
void *  usr 
)
static

Callback on the Reconnect message.

static void DtRtiExec::processRtiExecHandshakeMsg ( const DtRtiExecHandshakeMsg msg,
void *  usr 
)
static

Handshake message callback.

virtual void DtRtiExec::processRtiExecHandshakeMsg ( const DtRtiExecHandshakeMsg msg)
protectedvirtual

Process the RTI Forwarder's Handshake response.

virtual void DtRtiExec::processUpdateNotifyLevel ( DtNotifyLevelType  level)
virtual

Updates the rtiexec notify level.

virtual void DtRtiExec::removeDroppedFederateConnections ( )
protectedvirtual

Force resign a federate.

virtual void DtRtiExec::removeFedExCreatedCallback ( DtFedExCbFn  fn,
void *  usr 
)
virtual
virtual void DtRtiExec::removeFedExDestroyedCallback ( DtFedExCbFn  fn,
void *  usr 
)
virtual
virtual void DtRtiExec::removeLogFileNameUpdatedCallback ( DtLogFileNameCbFn  fn,
void *  usr 
)
virtual
virtual void DtRtiExec::removeTickCallback ( DtTickCbFn  fn,
void *  usr 
)
virtual
virtual void DtRtiExec::removeTickCallback ( DtTickWithExecCbFn  fn,
void *  usr 
)
virtual
virtual void DtRtiExec::ridRequestCb ( const DtRidTestRequestMsg msg)
virtual

The RID request callback is processed by the RTI in response to a ridTestRequest.

It fills up a ridResponse with the number of RID parameters that it wants consistent and sends the response back to the federate that requested it.

static void DtRtiExec::ridRequestCb ( const DtRidTestRequestMsg msg,
void *  usr 
)
static

RID File Received callback.

virtual void DtRtiExec::rtiExecToForwarderHandshake ( )
protectedvirtual

Inform RTI Forwarder that Exec is connected, and verify that this is the ONLY Exec connected.

virtual void DtRtiExec::run ( )
virtual

main loop

virtual void DtRtiExec::sendCreateResponseMsg ( const unsigned long  destinationID,
DtCreateResponseFlag  flag,
MAKRti::DtString const &  errorString 
)
virtual

Send RTI messages.

virtual void DtRtiExec::sendDestroyResponseMsg ( const char *  fedExName,
DtDestroyResponseFlag  flag 
)
virtual
virtual void DtRtiExec::sendJoinResponseMsg ( unsigned long  destinationIDValue,
unsigned short  requestID,
unsigned int  crc,
DtFederateHandle  handle,
const char *  fedName,
int  fedExHandle,
const char *  fedExName,
const DtString &  momModule,
const std::vector< DtString > &  fedFileName,
unsigned long  flags,
bool  allowNetworkTesting,
MAKRti::DtString const &  errorString,
DtJoinResponseMsg::errorCodes  errorValue = DtJoinResponseMsg::DT_NO_ERROR 
)
virtual
virtual void DtRtiExec::sendReportFederationsMsg ( unsigned long  destId,
const std::vector< DtString > &  federationNames,
const std::vector< DtString > &  timeImplNames 
)
virtual
virtual void DtRtiExec::sendRtiExecHandshakeMsg ( DtHandle  destId,
DtRtiExecHandshakeMsg::DtHandshakeStatus  status 
)
protectedvirtual

Send RTI Forwarder connection response msg.

static void DtRtiExec::setCreatorFunction ( DtRtiExecCreator  fn)
static

Call this function to set an alternate creator function With this function, users can replace this DtRtiExec with their own derived class.

virtual void DtRtiExec::shutdownForwarderIfCreated ( )
virtual
static bool DtRtiExec::shutdownSignalCaught ( )
static
virtual DtStartRtiForwarderResult DtRtiExec::startRtiForwarder ( const DtRIDParameters params)
protectedvirtual

Starts forwarder if the exec is configured to do so.

return zero on error.

virtual bool DtRtiExec::tick ( bool  noCallbacks = false)
virtual

Work performed here for each cycle in main loop.

Primarily processing messages and ticking each federation execution. Returns boolean: tick processed a message? If noCallbacks is true, no tick callbacks will be called

virtual void DtRtiExec::wait ( DtTime  intervalInSeconds)
virtual

Wait for input or until the the given interval expires.

Member Data Documentation

DtString DtRtiExec::lineOfInput
protected
bool DtRtiExec::myAutoExit
protected
DtClock DtRtiExec::myClock
protected
DtConnectionMgr* DtRtiExec::myConnectionMgr
protected

Referenced by connectMgr().

DtRtiConnectionInfoDataPair DtRtiExec::myConnInfo
protected
DtList DtRtiExec::myCreateCallbacks
protected
bool DtRtiExec::myCreatedRtiForwarder
protected
DtList DtRtiExec::myDestroyCallbacks
protected
DtConnIdToTimeMap DtRtiExec::myDisconnectedFederates
protected

Map of dropped Federate to timestamp of drop.

  • If connection is not re-established before timeout, Then federate must be resigned.
std::map<DtFederationHandle, DtFedExec*> DtRtiExec::myExecByHandle
protected
std::map<DtString, DtFedExec*> DtRtiExec::myExecByName
protected
bool DtRtiExec::myExitCommanded
protected

Flag indicating that an exit command was received.

DtForwarderFaultManager* DtRtiExec::myFaultManager
protected
DtString DtRtiExec::myFederationNameForDelete
protected
bool DtRtiExec::myFedNameForDeleteComplete
protected
int DtRtiExec::myFreeFedExHandle
protected
unsigned int DtRtiExec::myHandleForDelete
protected
bool DtRtiExec::myHandleForDeleteComplete
protected
DtRtiExecHandshakeMsg::DtHandshakeStatus DtRtiExec::myHandshakeStatus
protected
DtString DtRtiExec::myHostname
protected
std::list<DtLogFileNameCallbackInfo> DtRtiExec::myLogFileNameCallbacks
protected

List of log file name update callbacks.

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

Printer which prints output to a log file.

DtMulitcastDiscoveryMgr* DtRtiExec::myMcastDiscoveryMgr
protected
DtTime DtRtiExec::myNextHeartbeat
protected
DtRIDParameters* DtRtiExec::myParams
protected

Referenced by params().

bool DtRtiExec::myPendingDelete
protected
bool DtRtiExec::myPendingQuit
protected
DtRtiMsgForwarderSP DtRtiExec::myRtiForwarder
protected
std::list<DtTickCallbackInfo> DtRtiExec::myTickCallbacks
protected

List of tick callbacks.

std::list<DtTickWithExecCallbackInfo> DtRtiExec::myTickWithExecCallbacks
protected

List of tick callbacks with DtRtiExec reference.

DtRtiExecCreator DtRtiExec::theCreator
staticprotected
bool DtRtiExec::theShutdownSignalCaught
staticprotected

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

Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)