![]() |
VR-Link API Documentation for HLA 1516
|
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:Public Member Functions | |
| DtInteraction () | |
| default constructor | |
| virtual | ~DtInteraction () |
| destructor | |
| DtInteraction (const DtInteraction &orig) | |
| copy constructor | |
| DtInteraction & | operator= (const DtInteraction &orig) |
| assignment operator | |
| virtual const RTI::ParameterHandleValueMap & | phvm () const =0 |
| Get the parameter handle value pair set for the interaction. | |
| virtual void | setFromPhvm (const RTI::ParameterHandleValueMap &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 DtExerciseConn * | exerciseConn () const |
| Get the current exercise connection. | |
| virtual DtInterClassDesc * | classDesc () 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 RTI::VariableLengthData &a_tag) |
| Set the user-defined tag. | |
| virtual void | setTag (const RTI::VariableLengthData &tag) |
| Set the user-defined tag. | |
| virtual const RTI::VariableLengthData & | tag () const |
| Get the user-defined tag. | |
| virtual const std::set < DtDDMRegion > * | region () const |
| virtual void | setRegion (const std::set< DtDDMRegion > ®ion) |
| 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::LogicalTime &ft) |
| This is used for TSO interactions. | |
| virtual const RTI::LogicalTime * | fedTime () const |
| When the interaction is received, if the federate sending the interaction had TSO set then the fedTime will be set. | |
| virtual void | setMessageRetractionHandle (const RTI::MessageRetractionHandle &handle) |
| Get/Set the MessageRetractionHandle. | |
| virtual RTI::MessageRetractionHandle | messageRetractionHandle () const |
| Get the message retraction handle. For more info see setMessageRetractionHandle. | |
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::ParameterHandleValueMap & | privPvList () const |
| Returns a pointer to a private pvList that can be used as a return value by phvps. | |
| DtInteraction * | self () 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 | |
| DtInterClassDesc * | myClassDesc |
| DtExerciseConn * | myExConn |
| DtTime | myTime |
| DtTimeStampType | myTimeType |
| RTI::LogicalTime * | myFedTime |
| RTI::ParameterHandleValueMap | myPvList |
| RTI::MessageRetractionHandle | myRetractionHandle |
| RTI::VariableLengthData | myTag |
| std::set< DtDDMRegion > * | myRegion |
| bool | myCustomTagSet |
Static Protected Attributes | |
| static bool | theTagIsAsciiTime |
DtInteraction is an abstract base class for representing HLA interactions (or events) (as opposed to HLA objects).
default constructor
| virtual DtInteraction::~DtInteraction | ( | ) | [virtual] |
destructor
| DtInteraction::DtInteraction | ( | const DtInteraction & | orig | ) |
copy constructor
| 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.
| DtExerciseConn * DtInteraction::exerciseConn | ( | ) | const [inline, virtual] |
Get the current exercise connection.
References myExConn.
| virtual const RTI::LogicalTime* 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] |
Returns the FOM interaction class name to use.
Default implementation is to ask the fomMapper.
Reimplemented in TestSimpleInteraction, DtL16RadioSignalInteraction, TestInteraction, DtJtidsLetRadioSignalInteraction, DtJtidsMessageRadioSignalInteraction, DtVmfRadioSignalInteraction, DtJtidsVoiceCvsdRadioSignalInteraction, DtJtidsVoiceLpc10RadioSignalInteraction, DtJtidsVoiceLpc12RadioSignalInteraction, DtRttabRadioSignalInteraction, and DtRttReplyRadioSignalInteraction.
| RTI::MessageRetractionHandle DtInteraction::messageRetractionHandle | ( | ) | const [inline, virtual] |
Get the message retraction handle. For more info see setMessageRetractionHandle.
References myRetractionHandle.
| virtual const char* DtInteraction::name | ( | ) | const [pure virtual] |
Name of the interaction. (Not necessarily the ClassName from the FOM.)
Implemented in DtSignalInteraction, DtDetonationInteraction, DtPointObjectTransaction, DtLinearObjectTransaction, DtFireInteraction, DtAttributeChangeReqInter, DtDataQueryInteraction, DtAttributeChangeResInter, DtRecordRInteraction, DtCreateObjReqInter, DtServiceRequestInteraction, DtTransferControlInteraction, DtResupplyOfferInteraction, DtArealObjectTransaction, DtResupplyRecInteraction, DtStopFreezeInteraction, DtStartResumeInteraction, DtCollisionInteraction, DtUnknownInteraction, DtSetRecordInteraction, TestSimpleInteraction, DtEnvironmentObjectTransaction, DtRemoveObjectRequestInter, DtAcknowledgeInteraction, DtActionRequestToObjInter, DtActionResponseInteraction, DtActionRequestInteraction, DtCommentInteraction, DtDataInteraction, DtEventReportInteraction, DtRepairCompleteInteraction, DtRepairResponseInteraction, DtSetDataInteraction, DtRemoveEntityInteraction, DtCreateEntityInteraction, DtRemoveObjectResultInter, DtResupplyCancelInteraction, DtCreateObjectResultInter, DtActionResponseFromObjInter, TestInteraction, DtJtidsLetRadioSignalInteraction, DtJtidsMessageRadioSignalInteraction, DtJtidsVoiceCvsdRadioSignalInteraction, DtJtidsVoiceLpc10RadioSignalInteraction, DtJtidsVoiceLpc12RadioSignalInteraction, DtL16RadioSignalInteraction, DtRttReplyRadioSignalInteraction, DtVmfRadioSignalInteraction, and DtRttabRadioSignalInteraction.
| 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::ParameterHandleValueMap& DtInteraction::phvm | ( | ) | 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] |
Print the interaction's data to DtInfo.
Reimplemented in TestSimpleInteraction, DtUnknownInteraction, DtLinearObjectTransaction, TestInteraction, DtResupplyOfferInteraction, DtDetonationInteraction, DtServiceRequestInteraction, DtSignalInteraction, DtResupplyRecInteraction, DtDataInteraction, DtEventReportInteraction, DtCommentInteraction, DtRemoveObjectRequestInter, DtActionRequestToObjInter, DtActionResponseInteraction, DtAttributeChangeReqInter, DtDataQueryInteraction, DtRemoveObjectResultInter, DtRepairCompleteInteraction, DtRepairResponseInteraction, DtResupplyCancelInteraction, DtSetDataInteraction, DtActionRequestInteraction, DtArealObjectTransaction, DtCreateObjectResultInter, DtPointObjectTransaction, DtRemoveEntityInteraction, DtStartResumeInteraction, DtStopFreezeInteraction, DtAttributeChangeResInter, DtCollisionInteraction, DtCreateEntityInteraction, DtFireInteraction, DtAcknowledgeInteraction, DtActionResponseFromObjInter, DtEnvironmentObjectTransaction, DtRecordRInteraction, DtCreateObjReqInter, DtTransferControlInteraction, DtInteractionWithData, DtSetRecordInteraction, and MyFireInteraction.
| void DtInteraction::printDataToStream | ( | std::ostream & | stream | ) | const [inline, virtual] |
Print the interaction's data to the stream.
Reimplemented in DtLinearObjectTransaction, DtDetonationInteraction, DtResupplyOfferInteraction, DtServiceRequestInteraction, DtSignalInteraction, DtResupplyRecInteraction, DtDataInteraction, DtEventReportInteraction, DtCommentInteraction, DtRemoveObjectRequestInter, DtActionRequestToObjInter, DtActionResponseInteraction, DtAttributeChangeReqInter, DtDataQueryInteraction, DtRemoveObjectResultInter, DtRepairCompleteInteraction, DtRepairResponseInteraction, DtResupplyCancelInteraction, DtSetDataInteraction, DtActionRequestInteraction, DtArealObjectTransaction, DtCreateObjectResultInter, DtPointObjectTransaction, DtRemoveEntityInteraction, DtStartResumeInteraction, DtStopFreezeInteraction, DtAttributeChangeResInter, DtCollisionInteraction, DtCreateEntityInteraction, DtFireInteraction, DtAcknowledgeInteraction, DtActionResponseFromObjInter, DtEnvironmentObjectTransaction, DtRecordRInteraction, DtCreateObjReqInter, DtTransferControlInteraction, DtInteractionWithData, DtSetRecordInteraction, DtJtidsLetRadioSignalInteraction, DtJtidsMessageRadioSignalInteraction, DtJtidsVoiceCvsdRadioSignalInteraction, DtJtidsVoiceLpc10RadioSignalInteraction, DtJtidsVoiceLpc12RadioSignalInteraction, DtL16RadioSignalInteraction, DtRttReplyRadioSignalInteraction, DtVmfRadioSignalInteraction, and DtRttabRadioSignalInteraction.
| 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::ParameterHandleValueMap& 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 std::set<DtDDMRegion>* DtInteraction::region | ( | ) | const [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 RTI::VariableLengthData & | a_tag | ) | [virtual] |
Set the user-defined tag.
| 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::LogicalTime & | 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::setFromPhvm | ( | const RTI::ParameterHandleValueMap & | pvList | ) | [pure virtual] |
Set contents from a parameter handle value pair set.
Implemented in TestSimpleInteraction, DtUnknownInteraction, and DtInteractionWithEncDec.
| void DtInteraction::setMessageRetractionHandle | ( | const RTI::MessageRetractionHandle & | handle | ) | [inline, virtual] |
Get/Set the MessageRetractionHandle.
This value is set if the interaction is sent with TSO. If not, this value is undefined.
References myRetractionHandle.
| virtual void DtInteraction::setRegion | ( | const std::set< DtDDMRegion > & | region | ) | [virtual] |
| virtual void DtInteraction::setTag | ( | const RTI::VariableLengthData & | 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 RTI::VariableLengthData& 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.
DtInterClassDesc* DtInteraction::myClassDesc [protected] |
Referenced by classDesc(), interactionClassHandle(), interactionClassName(), and numParameters().
bool DtInteraction::myCustomTagSet [protected] |
DtExerciseConn* DtInteraction::myExConn [protected] |
Referenced by exerciseConn().
RTI::LogicalTime* DtInteraction::myFedTime [protected] |
RTI::ParameterHandleValueMap DtInteraction::myPvList [protected] |
std::set<DtDDMRegion>* DtInteraction::myRegion [protected] |
RTI::MessageRetractionHandle DtInteraction::myRetractionHandle [protected] |
Referenced by messageRetractionHandle(), and setMessageRetractionHandle().
RTI::VariableLengthData DtInteraction::myTag [protected] |
DtTime DtInteraction::myTime [protected] |
DtTimeStampType DtInteraction::myTimeType [protected] |
bool DtInteraction::theTagIsAsciiTime [static, protected] |