![]() |
VR-Link API Documentation for HLA 1516
|
class DtInteractionWithData: More...
Inheritance diagram for DtInteractionWithData:
Collaboration diagram for DtInteractionWithData:Public Member Functions | |
| DtInteractionWithData () | |
| default constructor More... | |
| virtual | ~DtInteractionWithData () |
| destructor More... | |
| DtInteractionWithData (const DtInteractionWithData &orig) | |
| copy constructor More... | |
| DtInteractionWithData & | operator= (const DtInteractionWithData &orig) |
| assignment operator More... | |
| virtual void | printData () const |
| Print the interaction's data to DtInfo. More... | |
| virtual void | printDataToStream (std::ostream &stream) const |
| Print the interaction's data to the specified stream. More... | |
| virtual int | numFixedFields () const |
| virtual int | numVarFields () const |
| Returns number of variable length fields. More... | |
| virtual DtDatumParam | varDatumId (int index) const |
| Returns the datum param found in the index'th variable datum record. More... | |
| virtual void | setVarDatumId (int index, DtDatumParam id, DtDatumRetCode *retcode=0) |
| virtual DtDatumParam | fixedDatumId (int index) const |
| Returns the datum param found in the index'th fixed datum record. More... | |
| virtual void | setFixedDatumId (int index, DtDatumParam id, DtDatumRetCode *retcode=0) |
| virtual DtDatumParam | datumId (DtDatumRecordType fixedOrVar, int index) const |
| Returns the datum param found in the index'th fixed or variable datum record, depending on whether fixedOrVar is DtFixed or DtVar. More... | |
| virtual int | datumSizeBits (DtDatumRecordType fixedOrVar, int index) const |
| Returns the number of bits of data contained in the value fields of the index'th fixed or variable datum record, depending on whether fixedOrVar is DtFixed or DtVar. More... | |
| virtual int | datumSizeBytes (DtDatumRecordType fixedOrVar, int index) const |
| Returns the number of bytes of data contained in the value fields of the index'th fixed or variable datum record, depending on whether fixedOrVar is DtFixed or DtVar. More... | |
| virtual void | getIndex (DtDatumParam param, DtDatumRecordType *fixedOrVar, int *index, DtDatumRetCode *retcode=0) const |
| Looks through all fixed and variable records for one containing param as the parameter ID. More... | |
| virtual DtFloat32 | datumValFloat32 (DtDatumRecordType fixedOrVar, int index, DtDatumRetCode *retcode=0) const |
| ******* INSPECTING DATUM VALUES BY INDEX ********* If you know the data type of the value contained in a particular record, use one of the following to return it. More... | |
| virtual DtFloat64 | datumValFloat64 (DtDatumRecordType fixedOrVar, int index, DtDatumRetCode *retcode=0) const |
| virtual unsigned long | datumValUnsigned32 (DtDatumRecordType fixedOrVar, int index, DtDatumRetCode *retcode=0) const |
| virtual long | datumValInt32 (DtDatumRecordType fixedOrVar, int index, DtDatumRetCode *retcode=0) const |
| virtual const char * | datumValByteArray (DtDatumRecordType fixedOrVar, int index) const |
| virtual DtFloat32 | datumValFloat32 (DtDatumParam param, DtDatumRetCode *retcode=0) const |
| ******* INSPECTING DATUM VALUES BY PARAM ID ********* If you know the data type of the value contained in a particular record, use one of the following to return it. More... | |
| virtual DtFloat64 | datumValFloat64 (DtDatumParam param, DtDatumRetCode *retcode=0) const |
| virtual unsigned long | datumValUnsigned32 (DtDatumParam param, DtDatumRetCode *retcode=0) const |
| virtual long | datumValInt32 (DtDatumParam param, DtDatumRetCode *retcode=0) const |
| virtual const char * | datumValByteArray (DtDatumParam param, DtDatumRetCode *retcode=0) const |
| virtual void | initDataSection (const DtDatumParam *fixedParams, const DtVarDatumSpec *specList) |
| ****************** MUTATOR FUNCTIONS ****************** More... | |
| virtual void | setNumFixedFields (int newNum) |
| Sets the number of fixed or variable fields to newNum. More... | |
| virtual void | setNumVarFields (int newNum) |
| virtual void | setDatumParam (DtDatumRecordType fixedOrVar, int index, DtDatumParam param, DtDatumRetCode *retcode=0) |
| Set the datum ID in the index'th fixed or variable datum record to param, depending on whether fixedOrVar is DtFixed or DtVar. More... | |
| virtual void | setVarDataBytes (int index, int length, DtDatumRetCode *retcode=0) |
| Allocates length bytes for the index'th variable datum record. More... | |
| virtual void | setDatumValFloat64 (DtDatumRecordType fixedOrVar, int index, DtFloat64 val, DtDatumRetCode *retcode=0) |
| ******* SETTING DATA VALUES BY INDEX ********* Use one of the following to set the data value in a fixed or variable datum record, depending on the data type of your data. More... | |
| virtual void | setDatumValFloat32 (DtDatumRecordType fixedOrVar, int index, DtFloat32 val, DtDatumRetCode *retcode=0) |
| virtual void | setDatumValInt32 (DtDatumRecordType fixedOrVar, int index, long val, DtDatumRetCode *retcode=0) |
| virtual void | setDatumValUnsigned32 (DtDatumRecordType fixedOrVar, int index, unsigned long val, DtDatumRetCode *retcode=0) |
| virtual void | setDatumValByteArray (DtDatumRecordType fixedOrVar, int index, const char *val, DtDatumRetCode *retcode=0) |
| virtual void | setDatumValFloat64 (DtDatumParam param, DtFloat64 val, DtDatumRetCode *retcode=0) |
| ****** SETTING DATA VALUES BY PARAM ID ********* Use one of the following to set the data value in a fixed or variable datum record, depending on the data type of your data. More... | |
| virtual void | setDatumValFloat32 (DtDatumParam param, DtFloat32 val, DtDatumRetCode *retcode=0) |
| virtual void | setDatumValInt32 (DtDatumParam param, long val, DtDatumRetCode *retcode=0) |
| virtual void | setDatumValUnsigned32 (DtDatumParam param, unsigned long val, DtDatumRetCode *retcode=0) |
| virtual void | setDatumValByteArray (DtDatumParam param, const char *val, DtDatumRetCode *retcode=0) |
| virtual DtDatumRecordSet * | datumRecSet () |
| Return the DtDatumRecordSet which an InteractionWithData uses to store its fixed and var records. More... | |
| virtual const DtDatumRecordSet * | datumRecSet () const |
Public Member Functions inherited from DtInteractionWithEncDec | |
| DtInteractionWithEncDec () | |
| default constructor More... | |
| virtual | ~DtInteractionWithEncDec () |
| destructor More... | |
| DtInteractionWithEncDec (const DtInteractionWithEncDec &orig) | |
| copy constructor More... | |
| DtInteractionWithEncDec & | operator= (const DtInteractionWithEncDec &orig) |
| assignment operator More... | |
| virtual void | setExConn (DtExerciseConn *exConn, DtInterClassDesc *classDesc=NULL) |
| Sets the interaction's ExerciseConn and class descriptor. More... | |
| virtual const RTI::ParameterHandleValueMap & | phvm () const |
| Get the parameter handle value pair set for the interaction. More... | |
| virtual void | setFromPhvm (const RTI::ParameterHandleValueMap &pvList) |
| Set contents from a parameter handle value pair set. More... | |
| virtual void | useThese (DtInteractionEncoder *enc, DtInteractionDecoder *dec, DtInteractionRep *data) |
| Specify an encoder, decoder, and interaction data repository to use in encoding and decoding. More... | |
| virtual DtInteractionEncoder * | encoder () const |
| Return the encoder we are using. More... | |
| virtual DtInteractionDecoder * | decoder () const |
| Return the decoder we are using. More... | |
| virtual void | setParameterByHandle (const RTI::ParameterHandle &attrHdl, const char *attrValue, unsigned size) |
| Set the Parameter with the given handle. More... | |
| virtual const char * | getParameterByHandle (const RTI::ParameterHandle &attrHdl, unsigned &size) const |
| Get a pointer to Parameter value for the Parameter with the given handle. More... | |
| virtual void | setParameterByName (const DtString &name, const char *attrValue, unsigned size) |
| Set the Parameter with the given name. More... | |
| virtual const char * | getParameterByName (const DtString &name, unsigned &size) const |
| Get a pointer to Parameter value for the Parameter with the given name. More... | |
Public Member Functions inherited from DtInteraction | |
| DtInteraction () | |
| default constructor More... | |
| virtual | ~DtInteraction () |
| destructor More... | |
| DtInteraction (const DtInteraction &orig) | |
| copy constructor More... | |
| DtInteraction & | operator= (const DtInteraction &orig) |
| assignment operator More... | |
| virtual RTI::InteractionClassHandle | interactionClassHandle () const |
| Get the interaction class handle. Returns 0 if no classDesc. More... | |
| virtual char * | interactionClassName () const |
| Get the interaction class name. Returns NULL if no classDesc. More... | |
| virtual int | numParameters () const |
| Get the number of parameters. Returns 0 if no classDesc. More... | |
| virtual bool | neededByFederation () const |
| Returns true if the interaction class is needed by the federation false otherwise. More... | |
| virtual void | print () const |
| Print the interaction's host rep data, including header. More... | |
| virtual void | printToStream (std::ostream &stream) const |
| Print the interaction to a stream. More... | |
| virtual void | printHeader () const |
| Print the header info. More... | |
| virtual void | printHeaderToStream (std::ostream &stream) const |
| Print the header info to a stream. More... | |
| virtual void | printDataToString (DtString &buff) const |
| Print the interaction's data to the string provided. More... | |
| virtual void | printParams (bool withHex) const |
| Print the header followed by the interaction's parameters. More... | |
| virtual void | printParamsToStream (std::ostream &stream, bool withHex) const |
| Print the header followed by the interaction's parameters to a stream. More... | |
| virtual const char * | name () const =0 |
| Name of the interaction. (Not necessarily the ClassName from the FOM.) More... | |
| virtual DtExerciseConn * | exerciseConn () const |
| Get the current exercise connection. More... | |
| virtual DtInterClassDesc * | classDesc () const |
| Get the current class descriptor we're using for this interaction. More... | |
| virtual bool | customTagSet () const |
| Get whether a custom tag has been set on the interaction or not. More... | |
| virtual void | setCustomTag (const RTI::VariableLengthData &a_tag) |
| Set the user-defined tag. More... | |
| virtual void | setTag (const RTI::VariableLengthData &tag) |
| Set the user-defined tag. More... | |
| virtual const RTI::VariableLengthData & | tag () const |
| Get the user-defined tag. More... | |
| virtual const RTI::RegionHandleSet * | conveyedRegion () const |
| Get & Set the conveyed region of the reflected state message. More... | |
| virtual void | setConveyedRegion (const RTI::RegionHandleSet *sentRegionHandleSet) |
| virtual void | setTimeStamp (DtTime time, DtTimeStampType type=DtTimeStampRelative) |
| Set the time of validity of the message, and whether this represents relative or absolute time. More... | |
| virtual DtTime | timeStamp () const |
| Return the time of validity of the message (in seconds past an hour) as set by setTimeStamp. More... | |
| virtual DtTimeStampType | timeStampType () const |
| Return the type of the time stamp. More... | |
| 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. More... | |
| virtual void | setFedTime (const RTI::LogicalTime &ft) |
| This is used for TSO interactions. More... | |
| 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. More... | |
| virtual void | setMessageRetractionHandle (const RTI::MessageRetractionHandle &handle) |
| Get/Set the MessageRetractionHandle. More... | |
| virtual RTI::MessageRetractionHandle | messageRetractionHandle () const |
| Get the message retraction handle. For more info see setMessageRetractionHandle. More... | |
Protected Attributes | |
| DtDatumRecordSet | myRecSet |
Protected Attributes inherited from DtInteractionWithEncDec | |
| DtInteractionDecoder * | myDecoder |
| DtInteractionEncoder * | myEncoder |
| DtInteractionRep * | myData |
| std::map< RTI::ParameterHandle, DtGenericParameterInfo * > | myParametersByHandle |
| parameters by handle. More... | |
Protected Attributes inherited from DtInteraction | |
| DtInterClassDesc * | myClassDesc |
| DtExerciseConn * | myExConn |
| DtTime | myTime |
| DtTimeStampType | myTimeType |
| RTI::LogicalTime * | myFedTime |
| RTI::ParameterHandleValueMap | myPvList |
| RTI::MessageRetractionHandle | myRetractionHandle |
| RTI::VariableLengthData | myTag |
| const RTI::RegionHandleSet * | myConveyedRegion |
| bool | myCustomTagSet |
Additional Inherited Members | |
Static Public Member Functions inherited from DtInteraction | |
| 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. More... | |
| static bool | tagIsAsciiTime () |
| static void | addCallback (DtExerciseConn *conn, const std::set< DtString > *classes, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP()) |
| Register/Deregister callback function cb with conn, on all interaction class name (char*) contained in classes. More... | |
| static void | removeCallback (DtExerciseConn *conn, const std::set< DtString > *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. More... | |
| static void | removeCallback (DtExerciseConn *conn, const char *className, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP()) |
Protected Member Functions inherited from DtInteractionWithEncDec | |
| virtual DtInteractionDecoder * | createDecoder (DtExerciseConn *exConn) const |
| Called by decoderToUse to obtain a new'ed decoder. More... | |
| virtual DtInteractionEncoder * | createEncoder (DtExerciseConn *exConn) const |
| Called by encoderToUse to obtain a new'ed encoder. More... | |
| virtual DtInteractionDecoder * | decoderToUse (DtExerciseConn *exConn) const |
| Returns a decoder to use for decoding the interaction. More... | |
| virtual DtInteractionEncoder * | encoderToUse (DtExerciseConn *exConn) const |
| Returns an encoder to use for encoding the interaction. More... | |
Protected Member Functions inherited from DtInteraction | |
| virtual const char * | interactionClassToUse (DtExerciseConn *exConn) const |
| Returns the FOM interaction class name to use. More... | |
| virtual RTI::ParameterHandleValueMap & | privPvList () const |
| Returns a pointer to a private pvList that can be used as a return value by phvps. More... | |
| 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). More... | |
Static Protected Attributes inherited from DtInteraction | |
| static bool | theTagIsAsciiTime |
class DtInteractionWithData:
Instances of DtInteractionWithData are used to represent RPR FOM Interactions that use fixed and var datum records.
| DtInteractionWithData::DtInteractionWithData | ( | ) |
default constructor
|
virtual |
destructor
| DtInteractionWithData::DtInteractionWithData | ( | const DtInteractionWithData & | orig | ) |
copy constructor
|
virtual |
Returns the datum param found in the index'th fixed or variable datum record, depending on whether fixedOrVar is DtFixed or DtVar.
Index is between 1 and numRecords. Returns DtDatumParam(0) if index is out of bounds.
|
virtual |
Return the DtDatumRecordSet which an InteractionWithData uses to store its fixed and var records.
In general, the wrapper functions above should be used rather than going directly through the DtDatumRecordSet, which is necessary only when doing encoding and decoding of network representations.
|
virtual |
|
virtual |
Returns the number of bits of data contained in the value fields of the index'th fixed or variable datum record, depending on whether fixedOrVar is DtFixed or DtVar.
If DtFixed, the answer is always 32.
|
virtual |
Returns the number of bytes of data contained in the value fields of the index'th fixed or variable datum record, depending on whether fixedOrVar is DtFixed or DtVar.
If DtFixed, the answer is always 4.
|
virtual |
|
virtual |
|
virtual |
******* INSPECTING DATUM VALUES BY INDEX ********* If you know the data type of the value contained in a particular record, use one of the following to return it.
fixedOrVar (either DtFixed or DtVar) and index (between 1 and numRecords) indicate which record you are inspecting. datumValBytesArray is used when the data type is a character string, or something other than a long, unsigned long, float or double. It returns a pointer to a character string containing the exact bytes in the network representation that represents the value being inspected. The supplied retcode pointer will be filled with DtDatumValid if the value was successfully inspected, and DtDatumBadLength if either the index was invalid, or the size of the data indicated that it could not be interpreted as the chosen data type.
|
virtual |
******* INSPECTING DATUM VALUES BY PARAM ID ********* If you know the data type of the value contained in a particular record, use one of the following to return it.
The particular record inspected will be the first one containing param as the datum ID. datumValByteArray is used when the data type is a character string, or something other than a long, unsigned long, float or double. It returns a pointer to a character string containing the exact bytes in the network representation that represents the value being inspected. The supplied retcode pointer will be filled with DtDatumValid if the value was successfully inspected, and DtDatumBadLength if either param was not found, or the size of the data indicated that it could not be interpreted as the chosen data type.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Returns the datum param found in the index'th fixed datum record.
Index is between 1 and numRecords. Returns DtDatumParam(0) if index is out of bounds.
|
virtual |
Looks through all fixed and variable records for one containing param as the parameter ID.
If it finds one, fills supplied fixedOrVar pointer with DtFixed or DtVar, and index with the index to indicate which record was found, and fills retcode with DtDatumValid. If param was not found, retcode is filled with DtDatumBadId, and index and fixedOrVar are invalid.
|
virtual |
****************** MUTATOR FUNCTIONS ******************
Initialize to reflect the fixed parameters and variable parameters and sizes indicated. fixedParams is a NULL- terminated array of DtDatumParams. specList is an array of DtVarDatumSpecs terminated with the DtNullVarDatumSpec constant. This call can be made instead of calls to setNumVarDatumRecords, setNumFixedDatumRecord, and repeated calls to setDatumParam and setVarDataBytes.
|
virtual |
|
virtual |
Returns number of variable length fields.
| DtInteractionWithData& DtInteractionWithData::operator= | ( | const DtInteractionWithData & | orig | ) |
assignment operator
|
virtual |
Print the interaction's data to DtInfo.
Reimplemented from DtInteraction.
Reimplemented in DtAcousticTransientInteraction, DtDataInteraction, DtEventReportInteraction, DtCommentInteraction, DtActionResponseInteraction, DtSetDataInteraction, and DtActionRequestInteraction.
|
virtual |
Print the interaction's data to the specified stream.
Reimplemented from DtInteraction.
Reimplemented in DtAcousticTransientInteraction, DtDataInteraction, DtEventReportInteraction, DtCommentInteraction, DtActionResponseInteraction, DtSetDataInteraction, and DtActionRequestInteraction.
|
virtual |
Set the datum ID in the index'th fixed or variable datum record to param, depending on whether fixedOrVar is DtFixed or DtVar.
Supplied retcode pointer is filled with DtDatumValid if successful, or DtDatumBadIndex if the index is not valid.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
******* SETTING DATA VALUES BY INDEX ********* Use one of the following to set the data value in a fixed or variable datum record, depending on the data type of your data.
fixedOrVar (either DtFixed or DtVar) and index (between 1 and numRecords) indicate which record you are modifying. setDatumValBytesArray is used when the data type is a character string, or something other than a long, unsigned long, float or double. It takes a pointer to a character string containing the exact bytes that should be used in the network representation. The supplied retcode pointer will be filled with DtDatumValid if the value was successfully set, DtDatumBadIndex if the index is invalid, and DtDatumBadLength if the size of the data indicated that it could not be set from as the chosen data type.
|
virtual |
****** SETTING DATA VALUES BY PARAM ID ********* Use one of the following to set the data value in a fixed or variable datum record, depending on the data type of your data.
The particular record modified will be the first one containing param as its parameter ID. setDatumValBytesArray is used when the data type is a character string, or something other than a long, unsigned long, float or double. It takes a pointer to a character string containing the exact bytes that should be used in the network representation. The supplied retcode pointer will be filled with DtDatumValid if the value was successfully set, DtDatumBadId if param is invalid, and DtDatumBadLength if the size of the data indicated that it could not be set from the chosen data type.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Sets the number of fixed or variable fields to newNum.
Previously existing fixed fields with indices greater than newNum are deleted. If newNum exceeds the number of existing fields, trailing new fields are created with zeros as datum params, sizes (for var only) and values.
|
virtual |
|
virtual |
Allocates length bytes for the index'th variable datum record.
Should be called before using one of the setDatumVal functions to actually set the data. Supplied retcode pointer is set to DtDatumValid if successful, or DtDatumBadIndex if the index is not valid.
|
virtual |
|
virtual |
Returns the datum param found in the index'th variable datum record.
Index is between 1 and numRecords. Returns DtDatumParam(0) if index is out of bounds.
|
protected |