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 Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
DtTestManager Class Reference

DtTestManager runs network connectivity tests between local RTI components. More...

+ Collaboration diagram for DtTestManager:

Classes

struct  DtTrialDetails
 

Public Member Functions

 DtTestManager (bool initiallyEnabled)
 Constructor. More...
 
 DtTestManager (DtFederateMgr *fedMgr, bool initiallyEnabled)
 Constructor. More...
 
virtual ~DtTestManager ()
 Destructor. More...
 
DtRIDParametersparams ()
 Access to RID. More...
 
DtRIDParametersparams () const
 Const access to RID. More...
 
DtFederateMgrfedMgr ()
 Access to federate manager. More...
 
DtFederateMgrfedMgr () const
 Const access to federate manager. More...
 
RTI::RTIambassador * rtiAmb ()
 Access to the federate's RTI Ambassador. More...
 
RTI::RTIambassador * rtiAmb () const
 Const access to the federate's RTI Ambassador. More...
 
virtual DtConnectionMgrconnectMgr ()
 Access to the connection manager. More...
 
virtual DtConnectionMgrconnectMgr () const
 Const access to the connection manager. More...
 
virtual MAKRti::DtTime time () const
 return the current time. More...
 
virtual void postJoinInit ()
 Perform initializations that will allow tests to be run (e.g., publish and subscribe to test interaction) More...
 
virtual void resign ()
 Perform clean up from test instrumentation. More...
 
virtual void tick (unsigned long tickCount)
 Process test activities. More...
 
virtual float averageTickPeriod () const
 Average period between ticks. More...
 
virtual void enableNetworkTesting ()
 Enable network testing. More...
 
virtual void disableNetworkTesting ()
 Disable network testing. More...
 
virtual bool networkTestingEnabled () const
 Is network testing enabled? More...
 
void processResign (const DtResignMsg &msg)
 Process resign msg to maintain list of known federates. More...
 
virtual bool receiveInteraction (DtInteractionClassHandle classHandle, const DtPhvps &params)
 called by testMgr's installed fedAmbWrapper. More...
 
virtual bool testMgrCurrentlySending () const
 returns whether the test Manager is in a sending state. More...
 
virtual bool queueMsgForSend (DtRtiMsg &msg) const
 Add testID time stamp to message if necessary. More...
 
virtual void setTestMgrCurrentlySending (bool isSending, unsigned int testID=0)
 Mark the test mgr as sending / not sending Also sets / clears the last sent testID. More...
 
virtual bool addSendTimeStampMetaDataIfNecessary (DtRtiMsg &msg)
 If necessary add testing metadata to the message and to the testMgr, return whether timestamp was added. More...
 
virtual bool addReceiveTimeStampIfNecessary (DtRtiMsg &msg)
 If necessary record receive Timestamp. More...
 
virtual bool addAsyncQueueMsgOnRecieve (DtRtiMsg &msg)
 When the message is queued on Receive. More...
 
virtual bool isTestInteractionClassHandle (DtInteractionClassHandle classHandle)
 Return boolean: Is the given interaction handle a test interaction? More...
 
virtual void sendStatusMessages () const
 Update the status.... More...
 

Protected Types

enum  DtInitiatorByType_e { DtInitiatedByExec, DtInitiatedByAssistant }
 
typedef enum
DtTestManager::DtInitiatorByType_e 
DtInitiatorByType
 
typedef std::multimap
< DtMetadataType,
MAKRti::DtTime > 
DtTimeStampMap
 
typedef std::map< unsigned int,
DtTimeStampMap
DtTestToTimeStampMap
 

Protected Member Functions

virtual void processSub (const DtSubInterMsg &msg)
 Process subscribe msg to maintain a list of known federates. More...
 
virtual void processUnsub (const DtUnsubInterMsg &msg)
 Process unsubscribe msg to maintain a list of known federates. More...
 
virtual void processChangeLatencyTestStatus (const DtAssistantChangeLatencyTestModeMsg &testMsg)
 Processes latency test status change messages. More...
 
virtual void processChangeLatencyTestStatus (const DtChangeLatencyTestModeMsg &testMsg)
 
virtual void changeLatencyTestRequestByType (bool initiateTest, bool continuousCommand, bool stopContinuous, bool observing, DtInitiatorByType type, MAKRti::DtTime period, unsigned int numInteractions, unsigned int payloadSize)
 Change status according to parameters / initiator. More...
 
virtual void initiateLatencyTest ()
 if there are queued requests and the most recent trial has finished run a test. More...
 
virtual void processLatencyTest ()
 Process an active latency test. More...
 
virtual bool getTestIDFromMetaData (DtRtiMsg &msg, unsigned int &testID) const
 
virtual void addKnownFederate (DtFederateHandle subscribedFed)
 Add the federate to the list of known subscribed federates so we know who to send test interactions to. More...
 
virtual void removeKnownFederate (DtFederateHandle unsubscribedFed)
 Remove the federate from the list of known federates so we don't sent to it anymore. More...
 
virtual bool atLeastOneKnownFederate () const
 Do we know of at least one federate we can initiate a test with. More...
 
virtual bool isKnownFederateHandle (DtFederateHandle handle) const
 Is the input federate Handle known to us? More...
 
virtual void addSendInteractionTimeStamp (unsigned int testID)
 called by either test initiator or test recipient. More...
 
virtual void addNetSendTimeStamp (unsigned int testID, DtRtiMsg &msg)
 called by either test initiator or test recipient. More...
 
virtual void addNetReceiveTimeStamp (unsigned int testID, const DtRtiMsg &msg)
 called by either test initiator or test recipient. More...
 
virtual void addReceiveInteractionTimeStamp (unsigned int testID, MAKRti::DtTime timeToUse)
 called by either test initiator or test recipient. More...
 
virtual void removeKnowledgeOfTestId (unsigned int testID)
 Remove knowledge of this testID. More...
 
virtual void addAsyncQueueMsgTimeStamp (unsigned int &testID, const DtRtiMsg &msg)
 called by either test initiator or test recipient. More...
 
MAKRti::DtTransportType transportTypeForTestID (unsigned int testID)
 look up the transport type for this testID. More...
 
virtual unsigned int lastSentTestID () const
 called by test initiator only. More...
 
virtual void setLastSentTestID (unsigned int testID)
 Set the Test ID of the last sent interaction. More...
 
virtual bool sendSingleLatencyInteraction (unsigned int testID, DtFederateHandle recipient, MAKRti::DtTransportType transport, unsigned int payload)
 Send a single latency interaction. More...
 
virtual bool addMetadataIfNecessary (DtRtiMsg &msg, unsigned int &testID) const
 Before netsend, set the msgs's metadata from the testID. More...
 
virtual bool shouldAddMetadataToMessage (DtRtiMsg &msg) const
 determine if adding metadata is necessary based on msg type and current state. More...
 
virtual bool isInitiatorOfTestID (unsigned int testID) const
 Was this testID generated by me? More...
 
virtual void calculateTickTime (unsigned long tickCount)
 Calculate Average TickTime. More...
 
virtual bool sendInteraction (unsigned int testID, DtInteractionClassHandle handle, const DtPhvps &params, unsigned int payloadSize)
 called by testManager when either a new test interaction is being sent or when a test Interaction is being sent as a response to a received test Interaction. More...
 

Static Protected Member Functions

static void processSub (const DtSubInterMsg &msg, void *usr)
 Callback to install for processing subscription messages. More...
 
static void processUnsub (const DtUnsubInterMsg &msg, void *usr)
 Callback to install for processing unsubscribe messages. More...
 
static void queueLatencyTestRequest (const DtAssistantChangeLatencyTestModeMsg &testMsg, void *usr)
 Callback to install for processing initiate latency test messages. More...
 
static void processChangeLatencyTestStatus (const DtAssistantChangeLatencyTestModeMsg &testMsg, void *usr)
 Processes latency test status change messages. More...
 
static void processChangeLatencyTestStatus (const DtChangeLatencyTestModeMsg &testMsg, void *usr)
 

Protected Attributes

DtFederateMgrmyFedMgr
 The federate manager. More...
 
DtInitiatorLatencyTestmyInitiatorTest
 Handles initiating tests with other federates. More...
 
DtRecipientLatencyTestmyRecipientTest
 Handles receiving tests from other federates. More...
 
DtLatencyTestInteractionmyLatencyInteraction
 The latency test interaction. More...
 
MAKRti::DtClock myClock
 Keep track of time. More...
 
bool myRunningContinuous
 Are we currently running a continuous test? More...
 
DtTrialDetails myContinuousDetails
 If so what are the details of the continuous test? More...
 
std::set< DtInitiatorByTypemyObservers
 list of observers. More...
 
DtTestToTimeStampMap myCompletedAveragedInitiatedTests
 Storage of my completed initiated tests. More...
 
bool mySendingInteraction
 Set when testMgr sends a message, is cleared by accessor when connectMgr checks whether the last message was a testMgr msg. More...
 
unsigned int myTestIDOfLastSentInteraction
 The testID of the currently running initiated test. More...
 
unsigned int myCurrentTrialID
 What is the current trial number. More...
 
unsigned int myInitiatedTrialID
 What trials am I waiting to complete? More...
 
DtFederateHandle myInitiatedFedHandle
 
bool mySendSubscribe
 
DtTestMgrFedAmbWrappermyTestFedAmbWrapper
 Catches calls to ReceiveInteraction to prevent testInteractions from being delivered to the user. More...
 
std::list< DtTrialDetailsmyTrialsToInitiate
 List of trials to initiate. More...
 
std::set< DtFederateHandlemyListOfKnownFederates
 Our list of known federates (not including self). More...
 
float myInitialTickTime
 the earliest tick time we're using for avgTickPeriod. More...
 
unsigned long myInitialTickCount
 the earliest tick count we're using for avgTickPeriod. More...
 
float mySecondTickTime
 the second tick time we're using for avgTickPeriod. More...
 
unsigned long mySecondTickCount
 the second tick count we're using for avgTickPeriod. More...
 
float myAverageTickPeriod
 The average period between ticks. More...
 
bool myEnabled
 Is network testing enabled? More...
 
unsigned myNumInitiatedTests
 The number of tests this federate has initiated. More...
 
unsigned myNumTestReportsGenerated
 The number of test reports this federate has generated. More...
 
DtMutex myInitiatorMutex
 lock for the initiator test More...
 
DtMutex myRecipientMutex
 

Private Member Functions

 DtTestManager (DtTestManager const &orig)
 Copy Constructor - not allowed. More...
 
DtTestManageroperator= (DtTestManager const &orig)
 Assignment operator - not allowed. More...
 

Detailed Description

DtTestManager runs network connectivity tests between local RTI components.

Member Typedef Documentation

typedef std::map<unsigned int, DtTimeStampMap > DtTestManager::DtTestToTimeStampMap
protected
typedef std::multimap<DtMetadataType, MAKRti::DtTime> DtTestManager::DtTimeStampMap
protected

Member Enumeration Documentation

Enumerator
DtInitiatedByExec 
DtInitiatedByAssistant 

Constructor & Destructor Documentation

DtTestManager::DtTestManager ( bool  initiallyEnabled)

Constructor.

DtTestManager::DtTestManager ( DtFederateMgr fedMgr,
bool  initiallyEnabled 
)

Constructor.

virtual DtTestManager::~DtTestManager ( )
virtual

Destructor.

DtTestManager::DtTestManager ( DtTestManager const &  orig)
private

Copy Constructor - not allowed.

Member Function Documentation

virtual bool DtTestManager::addAsyncQueueMsgOnRecieve ( DtRtiMsg msg)
virtual

When the message is queued on Receive.

Synchronous mode: does not occur. Asynchronous mode: does not occur. AsyncProcessMessage mode: after the message's callbacks are converted into a fedAmbQueue Message and its processing is performed

virtual void DtTestManager::addAsyncQueueMsgTimeStamp ( unsigned int &  testID,
const DtRtiMsg msg 
)
protectedvirtual

called by either test initiator or test recipient.

If not test is currently being performed this is a nop Test manager will record the current time and associate it with the appropriate testID extracted from the message's metadata. The testID is returned.

virtual void DtTestManager::addKnownFederate ( DtFederateHandle  subscribedFed)
protectedvirtual

Add the federate to the list of known subscribed federates so we know who to send test interactions to.

virtual bool DtTestManager::addMetadataIfNecessary ( DtRtiMsg msg,
unsigned int &  testID 
) const
protectedvirtual

Before netsend, set the msgs's metadata from the testID.

return whether it was necessary to add metadata.

virtual void DtTestManager::addNetReceiveTimeStamp ( unsigned int  testID,
const DtRtiMsg msg 
)
protectedvirtual

called by either test initiator or test recipient.

If no test is currently being performed this is a nop. Test manager will record the current time and associate it with the appropriate testID extracted from the message's metadata. That testID is returned in the first argument.

virtual void DtTestManager::addNetSendTimeStamp ( unsigned int  testID,
DtRtiMsg msg 
)
protectedvirtual

called by either test initiator or test recipient.

If no test is currently being performed this is a nop. Test manager will remove all stored timestamps of testID Test manager will set the testMsg flag in the InteractionMsg. and insert them as metadata to the msg.

virtual void DtTestManager::addReceiveInteractionTimeStamp ( unsigned int  testID,
MAKRti::DtTime  timeToUse 
)
protectedvirtual

called by either test initiator or test recipient.

If no test is currently being performed this is a nop. Test Manager will record the current time and associate it with the testID

virtual bool DtTestManager::addReceiveTimeStampIfNecessary ( DtRtiMsg msg)
virtual

If necessary record receive Timestamp.

virtual void DtTestManager::addSendInteractionTimeStamp ( unsigned int  testID)
protectedvirtual

called by either test initiator or test recipient.

If no test is currently being performed this is a nop. Test manager will record the current time and associate it with the input test ID.

virtual bool DtTestManager::addSendTimeStampMetaDataIfNecessary ( DtRtiMsg msg)
virtual

If necessary add testing metadata to the message and to the testMgr, return whether timestamp was added.

virtual bool DtTestManager::atLeastOneKnownFederate ( ) const
protectedvirtual

Do we know of at least one federate we can initiate a test with.

virtual float DtTestManager::averageTickPeriod ( ) const
virtual

Average period between ticks.

virtual void DtTestManager::calculateTickTime ( unsigned long  tickCount)
protectedvirtual

Calculate Average TickTime.

virtual void DtTestManager::changeLatencyTestRequestByType ( bool  initiateTest,
bool  continuousCommand,
bool  stopContinuous,
bool  observing,
DtInitiatorByType  type,
MAKRti::DtTime  period,
unsigned int  numInteractions,
unsigned int  payloadSize 
)
protectedvirtual

Change status according to parameters / initiator.

virtual DtConnectionMgr* DtTestManager::connectMgr ( )
virtual

Access to the connection manager.

virtual DtConnectionMgr* DtTestManager::connectMgr ( ) const
virtual

Const access to the connection manager.

virtual void DtTestManager::disableNetworkTesting ( )
virtual

Disable network testing.

virtual void DtTestManager::enableNetworkTesting ( )
virtual

Enable network testing.

DtFederateMgr* DtTestManager::fedMgr ( )

Access to federate manager.

DtFederateMgr* DtTestManager::fedMgr ( ) const

Const access to federate manager.

virtual bool DtTestManager::getTestIDFromMetaData ( DtRtiMsg msg,
unsigned int &  testID 
) const
protectedvirtual
virtual void DtTestManager::initiateLatencyTest ( )
protectedvirtual

if there are queued requests and the most recent trial has finished run a test.

virtual bool DtTestManager::isInitiatorOfTestID ( unsigned int  testID) const
protectedvirtual

Was this testID generated by me?

virtual bool DtTestManager::isKnownFederateHandle ( DtFederateHandle  handle) const
protectedvirtual

Is the input federate Handle known to us?

virtual bool DtTestManager::isTestInteractionClassHandle ( DtInteractionClassHandle  classHandle)
virtual

Return boolean: Is the given interaction handle a test interaction?

virtual unsigned int DtTestManager::lastSentTestID ( ) const
protectedvirtual

called by test initiator only.

TestManager does not support more than one concurrent test to be initiated. Returns whether test can be successfully initiated. returns the testID of the last interaction sendInteraction was called for.

virtual bool DtTestManager::networkTestingEnabled ( ) const
virtual

Is network testing enabled?

DtTestManager& DtTestManager::operator= ( DtTestManager const &  orig)
private

Assignment operator - not allowed.

DtRIDParameters* DtTestManager::params ( )

Access to RID.

DtRIDParameters* DtTestManager::params ( ) const

Const access to RID.

virtual void DtTestManager::postJoinInit ( )
virtual

Perform initializations that will allow tests to be run (e.g., publish and subscribe to test interaction)

virtual void DtTestManager::processChangeLatencyTestStatus ( const DtAssistantChangeLatencyTestModeMsg testMsg)
protectedvirtual

Processes latency test status change messages.

This includes informing the LRC that there is an observer of the tests, that there is no longer an observer, initiating a test, stopping a test, etc.

virtual void DtTestManager::processChangeLatencyTestStatus ( const DtChangeLatencyTestModeMsg testMsg)
protectedvirtual
static void DtTestManager::processChangeLatencyTestStatus ( const DtAssistantChangeLatencyTestModeMsg testMsg,
void *  usr 
)
staticprotected

Processes latency test status change messages.

This includes informing the LRC that there is an observer of the tests, that there is no longer an observer, initiating a test, stopping a test, etc.

static void DtTestManager::processChangeLatencyTestStatus ( const DtChangeLatencyTestModeMsg testMsg,
void *  usr 
)
staticprotected
virtual void DtTestManager::processLatencyTest ( )
protectedvirtual

Process an active latency test.

void DtTestManager::processResign ( const DtResignMsg msg)

Process resign msg to maintain list of known federates.

virtual void DtTestManager::processSub ( const DtSubInterMsg msg)
protectedvirtual

Process subscribe msg to maintain a list of known federates.

static void DtTestManager::processSub ( const DtSubInterMsg msg,
void *  usr 
)
staticprotected

Callback to install for processing subscription messages.

virtual void DtTestManager::processUnsub ( const DtUnsubInterMsg msg)
protectedvirtual

Process unsubscribe msg to maintain a list of known federates.

static void DtTestManager::processUnsub ( const DtUnsubInterMsg msg,
void *  usr 
)
staticprotected

Callback to install for processing unsubscribe messages.

static void DtTestManager::queueLatencyTestRequest ( const DtAssistantChangeLatencyTestModeMsg testMsg,
void *  usr 
)
staticprotected

Callback to install for processing initiate latency test messages.

virtual bool DtTestManager::queueMsgForSend ( DtRtiMsg msg) const
virtual

Add testID time stamp to message if necessary.

virtual bool DtTestManager::receiveInteraction ( DtInteractionClassHandle  classHandle,
const DtPhvps &  params 
)
virtual

called by testMgr's installed fedAmbWrapper.

Returns true if Interaction was a networkTest Interaction and has been processed and should be dropped. Else false.

virtual void DtTestManager::removeKnowledgeOfTestId ( unsigned int  testID)
protectedvirtual

Remove knowledge of this testID.

Typically called when we're stored time stamps for a received message and then later determined it was not addressed to us.

virtual void DtTestManager::removeKnownFederate ( DtFederateHandle  unsubscribedFed)
protectedvirtual

Remove the federate from the list of known federates so we don't sent to it anymore.

virtual void DtTestManager::resign ( )
virtual

Perform clean up from test instrumentation.

RTI::RTIambassador* DtTestManager::rtiAmb ( )

Access to the federate's RTI Ambassador.

RTI::RTIambassador* DtTestManager::rtiAmb ( ) const

Const access to the federate's RTI Ambassador.

virtual bool DtTestManager::sendInteraction ( unsigned int  testID,
DtInteractionClassHandle  handle,
const DtPhvps &  params,
unsigned int  payloadSize 
)
protectedvirtual

called by testManager when either a new test interaction is being sent or when a test Interaction is being sent as a response to a received test Interaction.

Returns true if Interaction was a networkTest Interaction and has been processed and should be dropped. Else false.

virtual bool DtTestManager::sendSingleLatencyInteraction ( unsigned int  testID,
DtFederateHandle  recipient,
MAKRti::DtTransportType  transport,
unsigned int  payload 
)
protectedvirtual

Send a single latency interaction.

virtual void DtTestManager::sendStatusMessages ( ) const
virtual

Update the status....

virtual void DtTestManager::setLastSentTestID ( unsigned int  testID)
protectedvirtual

Set the Test ID of the last sent interaction.

virtual void DtTestManager::setTestMgrCurrentlySending ( bool  isSending,
unsigned int  testID = 0 
)
virtual

Mark the test mgr as sending / not sending Also sets / clears the last sent testID.

virtual bool DtTestManager::shouldAddMetadataToMessage ( DtRtiMsg msg) const
protectedvirtual

determine if adding metadata is necessary based on msg type and current state.

virtual bool DtTestManager::testMgrCurrentlySending ( ) const
virtual

returns whether the test Manager is in a sending state.

virtual void DtTestManager::tick ( unsigned long  tickCount)
virtual

Process test activities.

virtual MAKRti::DtTime DtTestManager::time ( ) const
virtual

return the current time.

MAKRti::DtTransportType DtTestManager::transportTypeForTestID ( unsigned int  testID)
protected

look up the transport type for this testID.

Member Data Documentation

float DtTestManager::myAverageTickPeriod
protected

The average period between ticks.

MAKRti::DtClock DtTestManager::myClock
protected

Keep track of time.

DtTestToTimeStampMap DtTestManager::myCompletedAveragedInitiatedTests
protected

Storage of my completed initiated tests.

DtTrialDetails DtTestManager::myContinuousDetails
protected

If so what are the details of the continuous test?

unsigned int DtTestManager::myCurrentTrialID
protected

What is the current trial number.

bool DtTestManager::myEnabled
protected

Is network testing enabled?

DtFederateMgr* DtTestManager::myFedMgr
protected

The federate manager.

unsigned long DtTestManager::myInitialTickCount
protected

the earliest tick count we're using for avgTickPeriod.

float DtTestManager::myInitialTickTime
protected

the earliest tick time we're using for avgTickPeriod.

DtFederateHandle DtTestManager::myInitiatedFedHandle
protected
unsigned int DtTestManager::myInitiatedTrialID
protected

What trials am I waiting to complete?

DtMutex DtTestManager::myInitiatorMutex
protected

lock for the initiator test

DtInitiatorLatencyTest* DtTestManager::myInitiatorTest
protected

Handles initiating tests with other federates.

DtLatencyTestInteraction* DtTestManager::myLatencyInteraction
protected

The latency test interaction.

std::set<DtFederateHandle> DtTestManager::myListOfKnownFederates
protected

Our list of known federates (not including self).

Populated and maintained through DtTestManager::subInterMsg, and DtTestManager::UnsubInterMsg calls which only monitors the interaction class handles of known testInteractions.

unsigned DtTestManager::myNumInitiatedTests
protected

The number of tests this federate has initiated.

unsigned DtTestManager::myNumTestReportsGenerated
protected

The number of test reports this federate has generated.

std::set<DtInitiatorByType> DtTestManager::myObservers
protected

list of observers.

DtMutex DtTestManager::myRecipientMutex
protected
DtRecipientLatencyTest* DtTestManager::myRecipientTest
protected

Handles receiving tests from other federates.

bool DtTestManager::myRunningContinuous
protected

Are we currently running a continuous test?

unsigned long DtTestManager::mySecondTickCount
protected

the second tick count we're using for avgTickPeriod.

float DtTestManager::mySecondTickTime
protected

the second tick time we're using for avgTickPeriod.

bool DtTestManager::mySendingInteraction
protected

Set when testMgr sends a message, is cleared by accessor when connectMgr checks whether the last message was a testMgr msg.

Should ONLY be changed by a test Manager.

bool DtTestManager::mySendSubscribe
protected
DtTestMgrFedAmbWrapper* DtTestManager::myTestFedAmbWrapper
protected

Catches calls to ReceiveInteraction to prevent testInteractions from being delivered to the user.

unsigned int DtTestManager::myTestIDOfLastSentInteraction
protected

The testID of the currently running initiated test.

Undefined when not currently running initiated test.

std::list<DtTrialDetails> DtTestManager::myTrialsToInitiate
protected

List of trials to initiate.


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)