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

Instances of DtInteractionDecoder are used to decode interactions from the network. More...

+ Inheritance diagram for DtInteractionDecoder:
+ Collaboration diagram for DtInteractionDecoder:

Public Types

typedef void(* DtParameterDecoder )(DtInteractionRep *inter, const RTI::ParameterHandleValuePairSet &pvlist, int i)
 Parameter decoder function signature.

Public Member Functions

 DtInteractionDecoder (DtExerciseConn *exConn, DtInterClassDesc *classDesc)
 constructor
virtual ~DtInteractionDecoder ()
 destructor
DtParameterDecoder addDecoder (RTI::ParameterHandle handle, DtParameterDecoder proc)
 Add/Remove a decoding function for the parameter specified by handle.
DtParameterDecoder addDecoder (char *name, DtParameterDecoder proc)
 Add/Remove a decoding function for the parameter specified by name.
virtual DtParameterDecoder decoder (RTI::ParameterHandle handle) const
 Get the parameter decoder for the specified handle.
virtual void decode (DtInteractionRep *interaction, const RTI::ParameterHandleValueMap &pvMap)
 Decode the interaction.
virtual RTI::InteractionClassHandle interactionClassHandle ()
 Get the interaction's class handle.
virtual DtInteractionDecoderclone () const
 Returns a new-ed clone of this object.
virtual DtInteractionDecoderclone (DtInterClassDesc *interDesc) const
 Returns a new-ed clone of this object which corresponds to the inter description interDesc.

Static Public Member Functions

static char * decodingBuffer (int length)
 Returns a pointer to a buffer that can be used to copy data obtained from a phvps.
static char * parameterData (const RTI::ParameterHandleValuePairSet &pvList, int index, RTI::ULong &length)
 Returns a pointer to a buffer containing the parameter data.
static char * parameterData (const RTI::ParameterHandleValuePairSet &pvList, int index, RTI::ULong &length, unsigned int expectedDataSize, char *paramName)
 Gets the parameter data and checks the expected size.
static DtNetEventIdeventIdParameterData (const RTI::ParameterHandleValuePairSet &params, int index)
 Get the parameter data as a DtNetEventId (adds defensive null terminator) Returns a pointer to the parameter data.
static void decodeGenericParameter (DtInteractionWithEncDec *inter, const RTI::ParameterHandleValuePairSet &pvlist, int i)
 Generic decoder class.

Static Public Attributes

static bool theUseGetValuePointer

Protected Member Functions

 DtInteractionDecoder (const DtInteractionDecoder &orig)
 copy constructor - not implemented.
DtInteractionDecoderoperator= (const DtInteractionDecoder &orig)
 assignment operator - not implemented.
virtual void decodeParameter (DtInteractionRep *inter, const RTI::ParameterHandleValuePairSet &pvList, int index)
 Process (decode) the specified parameter.

Protected Attributes

DtExerciseConnmyExConn
DtInterClassDescmyClassDesc
RTI::InteractionClassHandle myClassHandle
std::map< RTI::ParameterHandle,
DtParameterDecoder
myList
 myList is an array of classDesc->maxParamHandle() items.

Detailed Description

Instances of DtInteractionDecoder are used to decode interactions from the network.

Member Typedef Documentation

typedef void(* DtInteractionDecoder::DtParameterDecoder)(DtInteractionRep *inter, const RTI::ParameterHandleValuePairSet &pvlist, int i)

Parameter decoder function signature.

Constructor & Destructor Documentation

DtInteractionDecoder::DtInteractionDecoder ( DtExerciseConn exConn,
DtInterClassDesc classDesc 
)

constructor

virtual DtInteractionDecoder::~DtInteractionDecoder ( )
virtual

destructor

DtInteractionDecoder::DtInteractionDecoder ( const DtInteractionDecoder orig)
protected

copy constructor - not implemented.

Member Function Documentation

DtParameterDecoder DtInteractionDecoder::addDecoder ( RTI::ParameterHandle  handle,
DtParameterDecoder  proc 
)

Add/Remove a decoding function for the parameter specified by handle.

Returns the decoding function which is replaced by the add/remove. Note: This is non-virtual, since it is typically called by constructors.

DtParameterDecoder DtInteractionDecoder::addDecoder ( char *  name,
DtParameterDecoder  proc 
)

Add/Remove a decoding function for the parameter specified by name.

Returns the decoding function which is replaced by the add/remove. Note: This is non-virtual, since it is typically called by constructors.

virtual DtInteractionDecoder* DtInteractionDecoder::clone ( ) const
virtual

Returns a new-ed clone of this object.

virtual DtInteractionDecoder* DtInteractionDecoder::clone ( DtInterClassDesc interDesc) const
virtual

Returns a new-ed clone of this object which corresponds to the inter description interDesc.

Use this function if you want a subclass in the FOM to use the same decoder as its parent.

virtual void DtInteractionDecoder::decode ( DtInteractionRep *  interaction,
const RTI::ParameterHandleValueMap &  pvMap 
)
virtual

Decode the interaction.

static void DtInteractionDecoder::decodeGenericParameter ( DtInteractionWithEncDec inter,
const RTI::ParameterHandleValuePairSet pvlist,
int  i 
)
static

Generic decoder class.

Stores data as a generic attributes in the given state repository.

virtual void DtInteractionDecoder::decodeParameter ( DtInteractionRep *  inter,
const RTI::ParameterHandleValuePairSet pvList,
int  index 
)
protectedvirtual

Process (decode) the specified parameter.

virtual DtParameterDecoder DtInteractionDecoder::decoder ( RTI::ParameterHandle  handle) const
virtual

Get the parameter decoder for the specified handle.

char * DtInteractionDecoder::decodingBuffer ( int  length)
inlinestatic

Returns a pointer to a buffer that can be used to copy data obtained from a phvps.

If the buffer isn't large enough to contain the data, more space will be allocated to it.

References DtDecodingBuffer().

Referenced by eventIdParameterData(), and parameterData().

DtNetEventId * DtInteractionDecoder::eventIdParameterData ( const RTI::ParameterHandleValuePairSet params,
int  index 
)
inlinestatic

Get the parameter data as a DtNetEventId (adds defensive null terminator) Returns a pointer to the parameter data.

References decodingBuffer(), rti1516::CompatibleHandleValuePairSet< HandleType, MapType >::getValue(), and rti1516::CompatibleHandleValuePairSet< HandleType, MapType >::getValueLength().

RTI::InteractionClassHandle DtInteractionDecoder::interactionClassHandle ( )
inlinevirtual

Get the interaction's class handle.

References myClassHandle.

DtInteractionDecoder& DtInteractionDecoder::operator= ( const DtInteractionDecoder orig)
protected

assignment operator - not implemented.

char * DtInteractionDecoder::parameterData ( const RTI::ParameterHandleValuePairSet pvList,
int  index,
RTI::ULong length 
)
inlinestatic
char * DtInteractionDecoder::parameterData ( const RTI::ParameterHandleValuePairSet pvList,
int  index,
RTI::ULong length,
unsigned int  expectedDataSize,
char *  paramName 
)
inlinestatic

Gets the parameter data and checks the expected size.

If the data length is too small, no data is collected (0 returned and length set to 0) and a warning is printed. A message is printed if the data length is too large. Returns a pointer to the parameter data (or 0 if length < expected size).

References decodingBuffer(), DtNlVerbose, DtNotifyLevel, DtVerbose, DtWarn, rti1516::CompatibleHandleValuePairSet< HandleType, MapType >::getValue(), rti1516::CompatibleHandleValuePairSet< HandleType, MapType >::getValueLength(), rti1516::CompatibleHandleValuePairSet< HandleType, MapType >::getValuePointer(), and theUseGetValuePointer.

Member Data Documentation

DtInterClassDesc* DtInteractionDecoder::myClassDesc
protected
RTI::InteractionClassHandle DtInteractionDecoder::myClassHandle
protected

Referenced by interactionClassHandle().

DtExerciseConn* DtInteractionDecoder::myExConn
protected
std::map<RTI::ParameterHandle, DtParameterDecoder> DtInteractionDecoder::myList
protected

myList is an array of classDesc->maxParamHandle() items.

bool DtInteractionDecoder::theUseGetValuePointer
static

Referenced by parameterData().


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

Document ID: Generated on Tue Mar 1 02:56:17 EST 2016 from SVN revision 162687
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)