VR-Link API Documentation for HLA Evolved
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtInteraction Class Reference

DtInteraction is an abstract base class for representing HLA interactions (or events) (as opposed to HLA objects). More...

+ Inheritance diagram for DtInteraction:
+ Collaboration diagram for DtInteraction:

List of all members.

Public Member Functions

 DtInteraction ()
 default constructor
virtual ~DtInteraction ()
 destructor
 DtInteraction (const DtInteraction &orig)
 copy constructor
DtInteractionoperator= (const DtInteraction &orig)
 assignment operator
virtual const
RTI::ParameterHandleValuePairSet & 
phvps () const =0
 Get the parameter handle value pair set for the interaction.
virtual void setFromPhvps (const RTI::ParameterHandleValuePairSet &pvList)=0
 Set contents from a parameter handle value pair set.
virtual void setExConn (DtExerciseConn *exConn, DtInterClassDesc *classDesc=0)
 Sets the interaction's ExerciseConn and class descriptor.
virtual RTI::InteractionClassHandle interactionClassHandle () const
 Get the interaction class handle. Returns 0 if no classDesc.
virtual char * interactionClassName () const
 Get the interaction class name. Returns NULL if no classDesc.
virtual int numParameters () const
 Get the number of parameters. Returns 0 if no classDesc.
virtual bool neededByFederation () const
 Returns true if the interaction class is needed by the federation false otherwise.
virtual void print () const
 Print the interaction's host rep data, including header.
virtual void printToStream (std::ostream &stream) const
 Print the interaction to a stream.
virtual void printHeader () const
 Print the header info.
virtual void printHeaderToStream (std::ostream &stream) const
 Print the header info to a stream.
virtual void printData () const
 Print the interaction's data to DtInfo.
virtual void printDataToString (DtString &buff) const
 Print the interaction's data to the string provided.
virtual void printDataToStream (std::ostream &stream) const
 Print the interaction's data to the stream.
virtual void printParams (bool withHex) const
 Print the header followed by the interaction's parameters.
virtual void printParamsToStream (std::ostream &stream, bool withHex) const
 Print the header followed by the interaction's parameters to a stream.
virtual const char * name () const =0
 Name of the interaction. (Not necessarily the ClassName from the FOM.)
virtual DtExerciseConnexerciseConn () const
 Get the current exercise connection.
virtual DtInterClassDescclassDesc () const
 Get the current class descriptor we're using for this interaction.
virtual bool customTagSet () const
 Get whether a custom tag has been set on the interaction or not.
virtual void setCustomTag (const DtString &a_tag)
 Set the user-defined tag.
virtual void setTag (const DtString &tag)
 Set the user-defined tag.
virtual const DtStringtag () const
 Get the user-defined tag.
virtual const DtDDMRegionregion () const
virtual DtDDMRegionregion ()
virtual void setRegion (const DtDDMRegion &region)
virtual const DtStringproducingFederate () const
virtual void setProducingFederate (const DtString &fedName)
virtual void setTimeStamp (DtTime time, DtTimeStampType type=DtTimeStampRelative)
 Set the time of validity of the message, and whether this represents relative or absolute time.
virtual DtTime timeStamp () const
 Return the time of validity of the message (in seconds past an hour) as set by setTimeStamp.
virtual DtTimeStampType timeStampType () const
 Return the type of the time stamp.
virtual DtTime guessTimeValid (DtTime referenceTime) const
 Since timestamp only represents number of seconds past the hour, guessTimeValid chooses the hour that would make the timestamp closest to reference time, and returns a time that is timestamp seconds past that hour.
virtual void setFedTime (const RTI::FedTime &ft)
 This is used for TSO interactions.
virtual const RTI::FedTime * fedTime () const
 When the interaction is received, if the federate sending the interaction had TSO set then the fedTime will be set.
virtual void setEventRetractionHandle (const RTI::EventRetractionHandle &handle)
 Get/Set the EventRetractionHandle.
virtual RTI::EventRetractionHandle eventRetractionHandle () const
 Get the event retraction handle. For more info see setEventRetractionHandle.

Static Public Member Functions

static void setTagIsAsciiTime (bool val)
 Set/Get flag that tells us whether we're using the RPR FOM convention that the UserDefinedTag in updates and interactions represents a DIS-style timestamp.
static bool tagIsAsciiTime ()
static void addCallback (DtExerciseConn *conn, const DtList *classes, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
 Register/Deregister callback function cb with conn, on all interaction class name (char*) contained in classes.
static void removeCallback (DtExerciseConn *conn, const DtList *classes, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
static void addCallback (DtExerciseConn *conn, const char *className, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
 Can be used instead of above for a single class.
static void removeCallback (DtExerciseConn *conn, const char *className, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())

Protected Member Functions

virtual char * interactionClassToUse (DtExerciseConn *exConn) const
 Returns the FOM interaction class name to use.
virtual
RTI::ParameterHandleValuePairSet * 
privPvList () const
 Returns a pointer to a private pvList that can be used as a return value by phvps.
DtInteractionself () const
 Get rid of const-ness on the "this" pointer in order to access non-const functions from const member functions (such as simple accessors).

Protected Attributes

DtInterClassDescmyClassDesc
DtExerciseConnmyExConn
DtTime myTime
DtTimeStampType myTimeType
DtString myTag
RTI::ParameterHandleValuePairSet * myPvList
int myPvListMaxSize
RTI::FedTime * myFedTime
RTI::EventRetractionHandle myRetractionHandle
DtDDMRegionmyRegion
bool myCustomTagSet

Static Protected Attributes

static bool theTagIsAsciiTime

Detailed Description

DtInteraction is an abstract base class for representing HLA interactions (or events) (as opposed to HLA objects).

Examples

Constructor & Destructor Documentation

default constructor

virtual DtInteraction::~DtInteraction ( ) [virtual]

destructor

copy constructor


Member Function Documentation

static void DtInteraction::addCallback ( DtExerciseConn conn,
const DtList classes,
DtReceiveInteractionCb  cb,
void *  usr,
DtDDMRegionSP  region = DtDDMRegionSP() 
) [static]

Register/Deregister callback function cb with conn, on all interaction class name (char*) contained in classes.

static void DtInteraction::addCallback ( DtExerciseConn conn,
const char *  className,
DtReceiveInteractionCb  cb,
void *  usr,
DtDDMRegionSP  region = DtDDMRegionSP() 
) [static]

Can be used instead of above for a single class.

DtInterClassDesc * DtInteraction::classDesc ( ) const [inline, virtual]

Get the current class descriptor we're using for this interaction.

References myClassDesc.

virtual bool DtInteraction::customTagSet ( ) const [virtual]

Get whether a custom tag has been set on the interaction or not.

RTI::EventRetractionHandle DtInteraction::eventRetractionHandle ( ) const [inline, virtual]

Get the event retraction handle. For more info see setEventRetractionHandle.

References myRetractionHandle.

DtExerciseConn * DtInteraction::exerciseConn ( ) const [inline, virtual]

Get the current exercise connection.

References myExConn.

virtual const RTI::FedTime* DtInteraction::fedTime ( ) const [virtual]

When the interaction is received, if the federate sending the interaction had TSO set then the fedTime will be set.

If not you can compute time sent using timeStamp()

virtual DtTime DtInteraction::guessTimeValid ( DtTime  referenceTime) const [virtual]

Since timestamp only represents number of seconds past the hour, guessTimeValid chooses the hour that would make the timestamp closest to reference time, and returns a time that is timestamp seconds past that hour.

RTI::InteractionClassHandle DtInteraction::interactionClassHandle ( ) const [inline, virtual]

Get the interaction class handle. Returns 0 if no classDesc.

References DtInterClassDesc::handle(), and myClassDesc.

char * DtInteraction::interactionClassName ( ) const [inline, virtual]

Get the interaction class name. Returns NULL if no classDesc.

References myClassDesc, and DtInterClassDesc::name().

virtual char* DtInteraction::interactionClassToUse ( DtExerciseConn exConn) const [protected, virtual]
virtual const char* DtInteraction::name ( ) const [pure virtual]
virtual bool DtInteraction::neededByFederation ( ) const [virtual]

Returns true if the interaction class is needed by the federation false otherwise.

Returns false if no classDesc.

int DtInteraction::numParameters ( ) const [inline, virtual]

Get the number of parameters. Returns 0 if no classDesc.

References myClassDesc, and DtInterClassDesc::numParameters().

DtInteraction& DtInteraction::operator= ( const DtInteraction orig)

assignment operator

virtual const RTI::ParameterHandleValuePairSet& DtInteraction::phvps ( ) const [pure virtual]

Get the parameter handle value pair set for the interaction.

Implemented in TestSimpleInteraction, DtUnknownInteraction, and DtInteractionWithEncDec.

virtual void DtInteraction::print ( ) const [virtual]

Print the interaction's host rep data, including header.

void DtInteraction::printData ( ) const [inline, virtual]
void DtInteraction::printDataToStream ( std::ostream &  stream) const [inline, virtual]
void DtInteraction::printDataToString ( DtString buff) const [inline, virtual]

Print the interaction's data to the string provided.

Reimplemented in DtDetonationInteraction, and DtFireInteraction.

virtual void DtInteraction::printHeader ( ) const [virtual]

Print the header info.

virtual void DtInteraction::printHeaderToStream ( std::ostream &  stream) const [virtual]

Print the header info to a stream.

virtual void DtInteraction::printParams ( bool  withHex) const [virtual]

Print the header followed by the interaction's parameters.

virtual void DtInteraction::printParamsToStream ( std::ostream &  stream,
bool  withHex 
) const [virtual]

Print the header followed by the interaction's parameters to a stream.

virtual void DtInteraction::printToStream ( std::ostream &  stream) const [virtual]

Print the interaction to a stream.

virtual RTI::ParameterHandleValuePairSet* DtInteraction::privPvList ( ) const [protected, virtual]

Returns a pointer to a private pvList that can be used as a return value by phvps.

It's guaranteed to be able to fit at least numParameters() parameters.

virtual const DtString& DtInteraction::producingFederate ( ) const [virtual]
virtual const DtDDMRegion* DtInteraction::region ( ) const [virtual]
virtual DtDDMRegion* DtInteraction::region ( ) [virtual]
static void DtInteraction::removeCallback ( DtExerciseConn conn,
const DtList classes,
DtReceiveInteractionCb  cb,
void *  usr,
DtDDMRegionSP  region = DtDDMRegionSP() 
) [static]
static void DtInteraction::removeCallback ( DtExerciseConn conn,
const char *  className,
DtReceiveInteractionCb  cb,
void *  usr,
DtDDMRegionSP  region = DtDDMRegionSP() 
) [static]
DtInteraction * DtInteraction::self ( ) const [inline, protected]

Get rid of const-ness on the "this" pointer in order to access non-const functions from const member functions (such as simple accessors).

This should be used sparingly since it bypasses the const protection. Note: This is essentially like an operator and is non-virtual since can't override based on return type. Allows derived classes to also define this member.

virtual void DtInteraction::setCustomTag ( const DtString a_tag) [virtual]

Set the user-defined tag.

void DtInteraction::setEventRetractionHandle ( const RTI::EventRetractionHandle &  handle) [inline, virtual]

Get/Set the EventRetractionHandle.

This value is set if the interaction is sent with TSO. If not this value is undefined.

References myRetractionHandle.

virtual void DtInteraction::setExConn ( DtExerciseConn exConn,
DtInterClassDesc classDesc = 0 
) [virtual]

Sets the interaction's ExerciseConn and class descriptor.

If classDesc is NULL, derived class's versions choose a reasonable default. Without being told what ExConn or class descriptor to use, many of the HLA-specific functions won't work properly. However, it is usually not necessary for application code to call this function, since it is called by DtExerciseConn::send on the outgoing side, and by the DtInteractionFactory on the incoming side.

Reimplemented in DtUnknownInteraction, and DtInteractionWithEncDec.

virtual void DtInteraction::setFedTime ( const RTI::FedTime &  ft) [virtual]

This is used for TSO interactions.

It is set with the value of clock()->simTime() before the interaction is sent. When an interaction is received, If its received with a FedTime this will be set.

virtual void DtInteraction::setFromPhvps ( const RTI::ParameterHandleValuePairSet &  pvList) [pure virtual]

Set contents from a parameter handle value pair set.

Implemented in TestSimpleInteraction, DtUnknownInteraction, and DtInteractionWithEncDec.

virtual void DtInteraction::setProducingFederate ( const DtString fedName) [virtual]
virtual void DtInteraction::setRegion ( const DtDDMRegion region) [virtual]
virtual void DtInteraction::setTag ( const DtString tag) [virtual]

Set the user-defined tag.

static void DtInteraction::setTagIsAsciiTime ( bool  val) [static]

Set/Get flag that tells us whether we're using the RPR FOM convention that the UserDefinedTag in updates and interactions represents a DIS-style timestamp.

virtual void DtInteraction::setTimeStamp ( DtTime  time,
DtTimeStampType  type = DtTimeStampRelative 
) [virtual]

Set the time of validity of the message, and whether this represents relative or absolute time.

Time is in seconds, but only time modulo an hour is stored.

virtual const DtString& DtInteraction::tag ( ) const [virtual]

Get the user-defined tag.

static bool DtInteraction::tagIsAsciiTime ( ) [static]
virtual DtTime DtInteraction::timeStamp ( ) const [virtual]

Return the time of validity of the message (in seconds past an hour) as set by setTimeStamp.

virtual DtTimeStampType DtInteraction::timeStampType ( ) const [virtual]

Return the type of the time stamp.


Member Data Documentation

Referenced by exerciseConn().

RTI::FedTime* DtInteraction::myFedTime [protected]
RTI::ParameterHandleValuePairSet* DtInteraction::myPvList [protected]
RTI::EventRetractionHandle DtInteraction::myRetractionHandle [protected]
bool DtInteraction::theTagIsAsciiTime [static, protected]

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

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)