VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
DtInteractionWithEncDec Class Reference

class DtInteractionWithEncDec: More...

+ Inheritance diagram for DtInteractionWithEncDec:
+ Collaboration diagram for DtInteractionWithEncDec:

Public Member Functions

 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.
virtual void setParameterByHandle (const RTI::ParameterHandle &attrHdl, const char *attrValue, unsigned size)
 Set the Parameter with the given handle.
virtual const char * getParameterByHandle (const RTI::ParameterHandle &attrHdl, unsigned &size) const
 Get a pointer to Parameter value for the Parameter with the given handle.
virtual void setParameterByName (const DtString &name, const char *attrValue, unsigned size)
 Set the Parameter with the given name.
virtual const char * getParameterByName (const DtString &name, unsigned &size) const
 Get a pointer to Parameter value for the Parameter with the given name.
- 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 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 RTI::Region * conveyedRegion () const
 Get & Set the conveyed region of the reflected state message.
virtual void setConveyedRegion (const RTI::Region *region)
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 Member Functions

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.
- Protected Member Functions inherited from DtInteraction
virtual const 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

DtInteractionDecodermyDecoder
DtInteractionEncodermyEncoder
DtInteractionRep * myData
std::map< RTI::ParameterHandle,
DtGenericParameterInfo * > 
myParametersByHandle
 parameters by handle.
- Protected Attributes inherited from DtInteraction
DtInterClassDescmyClassDesc
DtExerciseConnmyExConn
DtTime myTime
DtTimeStampType myTimeType
DtString myTag
RTI::ParameterHandleValuePairSet * myPvList
int myPvListMaxSize
RTI::FedTime * myFedTime
RTI::EventRetractionHandle myRetractionHandle
const RTI::Region * myConveyedRegion
bool myCustomTagSet

Private Attributes

DtInteractionDecodermyMutableCreatedDecoder
 These data members are changed in const functions.
DtInteractionEncodermyMutableCreatedEncoder
RTI::InteractionClassHandle myMutableEncoderClassHandle
RTI::InteractionClassHandle myMutableDecoderClassHandle

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 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.
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.
static void removeCallback (DtExerciseConn *conn, const char *className, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
- Static Protected Attributes inherited from DtInteraction
static bool theTagIsAsciiTime

Detailed Description

class DtInteractionWithEncDec:

DtInteractionWithEncDec is a DtInteraction that uses an encoder and decoder to implement the virtual functions phvps and setFromPhvps.

Constructor & Destructor Documentation

DtInteractionWithEncDec::DtInteractionWithEncDec ( )

default constructor

virtual DtInteractionWithEncDec::~DtInteractionWithEncDec ( )
virtual

destructor

DtInteractionWithEncDec::DtInteractionWithEncDec ( const DtInteractionWithEncDec orig)

copy constructor

Member Function Documentation

virtual DtInteractionDecoder* DtInteractionWithEncDec::createDecoder ( DtExerciseConn exConn) const
protectedvirtual

Called by decoderToUse to obtain a new'ed decoder.

Default implementation is to ask the FOM Mapper. The object is automatically deleted in the interaction's destructor.

Reimplemented in DtL16RadioSignalInteraction, TestInteraction, DtJtidsLetRadioSignalInteraction, DtJtidsMessageRadioSignalInteraction, DtVmfRadioSignalInteraction, DtJtidsVoiceCvsdRadioSignalInteraction, DtJtidsVoiceLpc10RadioSignalInteraction, DtJtidsVoiceLpc12RadioSignalInteraction, DtRttabRadioSignalInteraction, and DtRttReplyRadioSignalInteraction.

virtual DtInteractionEncoder* DtInteractionWithEncDec::createEncoder ( DtExerciseConn exConn) const
protectedvirtual

Called by encoderToUse to obtain a new'ed encoder.

Default implementation is to ask the FOM Mapper. The object is automatically deleted in the interaction's destructor.

Reimplemented in DtL16RadioSignalInteraction, TestInteraction, DtJtidsLetRadioSignalInteraction, DtJtidsMessageRadioSignalInteraction, DtVmfRadioSignalInteraction, DtJtidsVoiceCvsdRadioSignalInteraction, DtJtidsVoiceLpc10RadioSignalInteraction, DtJtidsVoiceLpc12RadioSignalInteraction, DtRttabRadioSignalInteraction, and DtRttReplyRadioSignalInteraction.

DtInteractionDecoder * DtInteractionWithEncDec::decoder ( ) const
inlinevirtual

Return the decoder we are using.

References myDecoder.

virtual DtInteractionDecoder* DtInteractionWithEncDec::decoderToUse ( DtExerciseConn exConn) const
protectedvirtual

Returns a decoder to use for decoding the interaction.

DtInteractionEncoder * DtInteractionWithEncDec::encoder ( ) const
inlinevirtual

Return the encoder we are using.

References myEncoder.

virtual DtInteractionEncoder* DtInteractionWithEncDec::encoderToUse ( DtExerciseConn exConn) const
protectedvirtual

Returns an encoder to use for encoding the interaction.

virtual const char* DtInteractionWithEncDec::getParameterByHandle ( const RTI::ParameterHandle &  attrHdl,
unsigned &  size 
) const
virtual

Get a pointer to Parameter value for the Parameter with the given handle.

virtual const char* DtInteractionWithEncDec::getParameterByName ( const DtString name,
unsigned &  size 
) const
virtual

Get a pointer to Parameter value for the Parameter with the given name.

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

assignment operator

virtual const RTI::ParameterHandleValuePairSet& DtInteractionWithEncDec::phvps ( ) const
virtual

Get the parameter handle value pair set for the interaction.

This is a slow function as the phvps is regenerated every time its called. Please do not count on the data in the phvps being correct after the function is called the second time.

Implements DtInteraction.

virtual void DtInteractionWithEncDec::setExConn ( DtExerciseConn exConn,
DtInterClassDesc classDesc = NULL 
)
virtual

Sets the interaction's ExerciseConn and class descriptor.

If classDesc is NULL, a default is chosen by calling interactionClassToUse(). 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 from DtInteraction.

virtual void DtInteractionWithEncDec::setFromPhvps ( const RTI::ParameterHandleValuePairSet &  pvList)
virtual

Set contents from a parameter handle value pair set.

Implements DtInteraction.

virtual void DtInteractionWithEncDec::setParameterByHandle ( const RTI::ParameterHandle &  attrHdl,
const char *  attrValue,
unsigned  size 
)
virtual

Set the Parameter with the given handle.

virtual void DtInteractionWithEncDec::setParameterByName ( const DtString name,
const char *  attrValue,
unsigned  size 
)
virtual

Set the Parameter with the given name.

virtual void DtInteractionWithEncDec::useThese ( DtInteractionEncoder enc,
DtInteractionDecoder dec,
DtInteractionRep *  data 
)
virtual

Specify an encoder, decoder, and interaction data repository to use in encoding and decoding.

Called by setExConn (using encoder and decoder obtained through encoderToUse() and decoderToUse()) so call AFTER setExConn if you want to override defaults. Caller is responsible for deleting enc, dec and data, but should do so only after they are no longer used by the interaction.

Member Data Documentation

DtInteractionRep* DtInteractionWithEncDec::myData
protected
DtInteractionDecoder* DtInteractionWithEncDec::myDecoder
protected

Referenced by decoder().

DtInteractionEncoder* DtInteractionWithEncDec::myEncoder
protected

Referenced by encoder().

DtInteractionDecoder* DtInteractionWithEncDec::myMutableCreatedDecoder
mutableprivate

These data members are changed in const functions.

They are computed when we go to send an interaction and are cashed.

DtInteractionEncoder* DtInteractionWithEncDec::myMutableCreatedEncoder
mutableprivate
RTI::InteractionClassHandle DtInteractionWithEncDec::myMutableDecoderClassHandle
mutableprivate
RTI::InteractionClassHandle DtInteractionWithEncDec::myMutableEncoderClassHandle
mutableprivate
std::map<RTI::ParameterHandle, DtGenericParameterInfo*> DtInteractionWithEncDec::myParametersByHandle
protected

parameters by handle.

This list stores all generic parameters that are not decoded or encoded but still passed in this interaction.


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

Document ID: Generated on Fri Dec 2 02:42:08 EST 2016 from SVN revision 171416
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)