VR-Link API Documentation for HLA Evolved
List of all members | Public Member Functions | Protected Attributes
DtInteractionWithData Class Reference

class DtInteractionWithData: More...

+ Inheritance diagram for DtInteractionWithData:
+ Collaboration diagram for DtInteractionWithData:

Public Member Functions

 DtInteractionWithData ()
 default constructor
virtual ~DtInteractionWithData ()
 destructor
 DtInteractionWithData (const DtInteractionWithData &orig)
 copy constructor
DtInteractionWithDataoperator= (const DtInteractionWithData &orig)
 assignment operator
virtual void printData () const
 Print the interaction's data to DtInfo.
virtual void printDataToStream (std::ostream &stream) const
 Print the interaction's data to the specified stream.
virtual int numFixedFields () const
virtual int numVarFields () const
 Returns number of variable length fields.
virtual DtDatumParam varDatumId (int index) const
 Returns the datum param found in the index'th variable datum record.
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.
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.
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.
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.
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.
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.
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.
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 ******************
virtual void setNumFixedFields (int newNum)
 Sets the number of fixed or variable fields to newNum.
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.
virtual void setVarDataBytes (int index, int length, DtDatumRetCode *retcode=0)
 Allocates length bytes for the index'th variable datum record.
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.
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.
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 DtDatumRecordSetdatumRecSet ()
 Return the DtDatumRecordSet which an InteractionWithData uses to store its fixed and var records.
virtual const DtDatumRecordSetdatumRecSet () const
- Public Member Functions inherited from DtInteractionWithEncDec
 DtInteractionWithEncDec ()
 default constructor
virtual ~DtInteractionWithEncDec ()
 destructor
 DtInteractionWithEncDec (const DtInteractionWithEncDec &orig)
 copy constructor
DtInteractionWithEncDecoperator= (const DtInteractionWithEncDec &orig)
 assignment operator
virtual void setExConn (DtExerciseConn *exConn, DtInterClassDesc *classDesc=NULL)
 Sets the interaction's ExerciseConn and class descriptor.
virtual const
RTI::ParameterHandleValuePairSet & 
phvps () const
 Get the parameter handle value pair set for the interaction.
virtual void setFromPhvps (const RTI::ParameterHandleValuePairSet &pvList)
 Set contents from a parameter handle value pair set.
virtual void useThese (DtInteractionEncoder *enc, DtInteractionDecoder *dec, DtInteractionRep *data)
 Specify an encoder, decoder, and interaction data repository to use in encoding and decoding.
virtual DtInteractionEncoderencoder () const
 Return the encoder we are using.
virtual DtInteractionDecoderdecoder () const
 Return the decoder we are using.
- Public Member Functions inherited from DtInteraction
 DtInteraction ()
 default constructor
virtual ~DtInteraction ()
 destructor
 DtInteraction (const DtInteraction &orig)
 copy constructor
DtInteractionoperator= (const DtInteraction &orig)
 assignment operator
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 printDataToString (DtString &buff) const
 Print the interaction's data to the string provided.
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.

Protected Attributes

DtDatumRecordSet myRecSet
- Protected Attributes inherited from DtInteractionWithEncDec
DtInteractionDecodermyDecoder
DtInteractionEncodermyEncoder
DtInteractionRep * myData
- Protected Attributes inherited from DtInteraction
DtInterClassDescmyClassDesc
DtExerciseConnmyExConn
DtTime myTime
DtTimeStampType myTimeType
DtString myTag
RTI::ParameterHandleValuePairSet * myPvList
int myPvListMaxSize
RTI::FedTime * myFedTime
RTI::EventRetractionHandle myRetractionHandle
DtDDMRegionmyRegion
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.
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 inherited from DtInteractionWithEncDec
virtual DtInteractionDecodercreateDecoder (DtExerciseConn *exConn) const
 Called by decoderToUse to obtain a new'ed decoder.
virtual DtInteractionEncodercreateEncoder (DtExerciseConn *exConn) const
 Called by encoderToUse to obtain a new'ed encoder.
virtual DtInteractionDecoderdecoderToUse (DtExerciseConn *exConn) const
 Returns a decoder to use for decoding the interaction.
virtual DtInteractionEncoderencoderToUse (DtExerciseConn *exConn) const
 Returns an encoder to use for encoding the interaction.
- Static Protected Attributes inherited from DtInteraction
static bool theTagIsAsciiTime

Detailed Description

class DtInteractionWithData:

Instances of DtInteractionWithData are used to represent RPR FOM Interactions that use fixed and var datum records.

Constructor & Destructor Documentation

DtInteractionWithData::DtInteractionWithData ( )

default constructor

virtual DtInteractionWithData::~DtInteractionWithData ( )
virtual

destructor

DtInteractionWithData::DtInteractionWithData ( const DtInteractionWithData orig)

copy constructor

Member Function Documentation

virtual DtDatumParam DtInteractionWithData::datumId ( DtDatumRecordType  fixedOrVar,
int  index 
) const
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 DtDatumRecordSet* DtInteractionWithData::datumRecSet ( )
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 const DtDatumRecordSet* DtInteractionWithData::datumRecSet ( ) const
virtual
virtual int DtInteractionWithData::datumSizeBits ( DtDatumRecordType  fixedOrVar,
int  index 
) const
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 int DtInteractionWithData::datumSizeBytes ( DtDatumRecordType  fixedOrVar,
int  index 
) const
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 const char* DtInteractionWithData::datumValByteArray ( DtDatumRecordType  fixedOrVar,
int  index 
) const
virtual
virtual const char* DtInteractionWithData::datumValByteArray ( DtDatumParam  param,
DtDatumRetCode retcode = 0 
) const
virtual
virtual DtFloat32 DtInteractionWithData::datumValFloat32 ( DtDatumRecordType  fixedOrVar,
int  index,
DtDatumRetCode retcode = 0 
) const
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 DtFloat32 DtInteractionWithData::datumValFloat32 ( DtDatumParam  param,
DtDatumRetCode retcode = 0 
) const
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 DtFloat64 DtInteractionWithData::datumValFloat64 ( DtDatumRecordType  fixedOrVar,
int  index,
DtDatumRetCode retcode = 0 
) const
virtual
virtual DtFloat64 DtInteractionWithData::datumValFloat64 ( DtDatumParam  param,
DtDatumRetCode retcode = 0 
) const
virtual
virtual long DtInteractionWithData::datumValInt32 ( DtDatumRecordType  fixedOrVar,
int  index,
DtDatumRetCode retcode = 0 
) const
virtual
virtual long DtInteractionWithData::datumValInt32 ( DtDatumParam  param,
DtDatumRetCode retcode = 0 
) const
virtual
virtual unsigned long DtInteractionWithData::datumValUnsigned32 ( DtDatumRecordType  fixedOrVar,
int  index,
DtDatumRetCode retcode = 0 
) const
virtual
virtual unsigned long DtInteractionWithData::datumValUnsigned32 ( DtDatumParam  param,
DtDatumRetCode retcode = 0 
) const
virtual
virtual DtDatumParam DtInteractionWithData::fixedDatumId ( int  index) const
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 void DtInteractionWithData::getIndex ( DtDatumParam  param,
DtDatumRecordType fixedOrVar,
int *  index,
DtDatumRetCode retcode = 0 
) const
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 void DtInteractionWithData::initDataSection ( const DtDatumParam fixedParams,
const DtVarDatumSpec specList 
)
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 int DtInteractionWithData::numFixedFields ( ) const
virtual
virtual int DtInteractionWithData::numVarFields ( ) const
virtual

Returns number of variable length fields.

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

assignment operator

virtual void DtInteractionWithData::printData ( ) const
virtual
virtual void DtInteractionWithData::printDataToStream ( std::ostream &  stream) const
virtual

Print the interaction's data to the specified stream.

Reimplemented from DtInteraction.

Reimplemented in DtDataInteraction, DtEventReportInteraction, DtCommentInteraction, DtActionResponseInteraction, DtSetDataInteraction, and DtActionRequestInteraction.

virtual void DtInteractionWithData::setDatumParam ( DtDatumRecordType  fixedOrVar,
int  index,
DtDatumParam  param,
DtDatumRetCode retcode = 0 
)
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 void DtInteractionWithData::setDatumValByteArray ( DtDatumRecordType  fixedOrVar,
int  index,
const char *  val,
DtDatumRetCode retcode = 0 
)
virtual
virtual void DtInteractionWithData::setDatumValByteArray ( DtDatumParam  param,
const char *  val,
DtDatumRetCode retcode = 0 
)
virtual
virtual void DtInteractionWithData::setDatumValFloat32 ( DtDatumRecordType  fixedOrVar,
int  index,
DtFloat32  val,
DtDatumRetCode retcode = 0 
)
virtual
virtual void DtInteractionWithData::setDatumValFloat32 ( DtDatumParam  param,
DtFloat32  val,
DtDatumRetCode retcode = 0 
)
virtual
virtual void DtInteractionWithData::setDatumValFloat64 ( DtDatumRecordType  fixedOrVar,
int  index,
DtFloat64  val,
DtDatumRetCode retcode = 0 
)
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 void DtInteractionWithData::setDatumValFloat64 ( DtDatumParam  param,
DtFloat64  val,
DtDatumRetCode retcode = 0 
)
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 void DtInteractionWithData::setDatumValInt32 ( DtDatumRecordType  fixedOrVar,
int  index,
long  val,
DtDatumRetCode retcode = 0 
)
virtual
virtual void DtInteractionWithData::setDatumValInt32 ( DtDatumParam  param,
long  val,
DtDatumRetCode retcode = 0 
)
virtual
virtual void DtInteractionWithData::setDatumValUnsigned32 ( DtDatumRecordType  fixedOrVar,
int  index,
unsigned long  val,
DtDatumRetCode retcode = 0 
)
virtual
virtual void DtInteractionWithData::setDatumValUnsigned32 ( DtDatumParam  param,
unsigned long  val,
DtDatumRetCode retcode = 0 
)
virtual
virtual void DtInteractionWithData::setFixedDatumId ( int  index,
DtDatumParam  id,
DtDatumRetCode retcode = 0 
)
virtual
virtual void DtInteractionWithData::setNumFixedFields ( int  newNum)
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 void DtInteractionWithData::setNumVarFields ( int  newNum)
virtual
virtual void DtInteractionWithData::setVarDataBytes ( int  index,
int  length,
DtDatumRetCode retcode = 0 
)
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 void DtInteractionWithData::setVarDatumId ( int  index,
DtDatumParam  id,
DtDatumRetCode retcode = 0 
)
virtual
virtual DtDatumParam DtInteractionWithData::varDatumId ( int  index) const
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.

Member Data Documentation

DtDatumRecordSet DtInteractionWithData::myRecSet
protected

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

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)