VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros
baseEntityDecoder.h File Reference

This file provides a declaration of the class DtBaseEntityDecoder. More...

Go to the source code of this file.

Classes

class  DtBaseEntityDecoder
 Instances of DtBaseEntityDecoder are used to decode a base entity state message into a state repository in an HLA (as opposed to DIS) environment. More...

Macros

#define DtDECLARE_ENTITY_ATTR_DECODER(attrName)   DtDECLARE_ATTR_DECODER(DtEntityStateRepository, attrName)
 This is used to declare attribute decoding functions which are members of the class.
#define DtDECLARE_AGGREGATE_ATTR_DECODER(attrName)   DtDECLARE_ATTR_DECODER(DtAggregateStateRepository, attrName)
 This is used to declare attribute decoding functions which are members of the class.
#define DtDECLARE_BASE_ENTITY_ATTR_DECODER(attrName)   DtDECLARE_ATTR_DECODER(DtBaseEntityStateRepository, attrName)
 This is used to declare attribute decoding functions which are members of the class.
#define DtDEFINE_SIMPLE_BASE_ENTITY_ATTR_DECODER_WITH_CAST(attrName, netType, mutator, castExpr)
 These macros are used to define simple attribute decoder functions (members of a derived DtHlaStateDecoder that decode individual attributes).
#define DtDEFINE_SIMPLE_BASE_ENTITY_ATTR_DECODER(attrName, netType, inspector)
#define DtDEFINE_SIMPLE_BASE_ENTITY_ATTR_DECODER_MUTATOR_WITH_TIME(attrName, netType, mutator)
 Defines a "simple" attribute decoder.

Detailed Description

This file provides a declaration of the class DtBaseEntityDecoder.

Macro Definition Documentation

#define DtDECLARE_AGGREGATE_ATTR_DECODER (   attrName)    DtDECLARE_ATTR_DECODER(DtAggregateStateRepository, attrName)

This is used to declare attribute decoding functions which are members of the class.

#define DtDECLARE_BASE_ENTITY_ATTR_DECODER (   attrName)    DtDECLARE_ATTR_DECODER(DtBaseEntityStateRepository, attrName)

This is used to declare attribute decoding functions which are members of the class.

#define DtDECLARE_ENTITY_ATTR_DECODER (   attrName)    DtDECLARE_ATTR_DECODER(DtEntityStateRepository, attrName)

This is used to declare attribute decoding functions which are members of the class.

#define DtDEFINE_SIMPLE_BASE_ENTITY_ATTR_DECODER (   attrName,
  netType,
  inspector 
)
Value:
#define DtDEFINE_SIMPLE_BASE_ENTITY_ATTR_DECODER_MUTATOR_WITH_TIME (   attrName,
  netType,
  mutator 
)
Value:
const RTI::AttributeHandleValuePairSet& attrs, \
int index) \
{ \
RTI::ULong length = attrs.getValueLength(index); \
if (length < sizeof(netType)) \
{ \
DtWarn("Cannot decode attribute %s.\n" \
"Size of data (%d) is smaller than size of %s (%d).\n", \
#attrName, length, #netType, sizeof(netType)); \
return; \
} \
else if (length > sizeof(netType) && DtNotifyLevel >= DtNlVerbose) \
{ \
DtVerbose("When decoding attribute %s,\n" \
"found size of data (%d) is larger than size of %s (%d).\n", \
#attrName, length, #netType, sizeof(netType)); \
return; \
} \
netType netVal; \
attrs.getValue(index, (char*) &netVal, length); \
stateRep->mutator(netVal, stateRep->timeForSets()); \
}

Defines a "simple" attribute decoder.

One in which we merely extracts the data from the AHVPS into a variable of the named network type. The network variable is passed to the named repository mutator. The network type must have an implicit cast to the type expected by the mutator. Arguments are the decoder class, the state repository class, the attribute name, the network type, and the mutator.

#define DtDEFINE_SIMPLE_BASE_ENTITY_ATTR_DECODER_WITH_CAST (   attrName,
  netType,
  mutator,
  castExpr 
)
Value:

These macros are used to define simple attribute decoder functions (members of a derived DtHlaStateDecoder that decode individual attributes).

The simple decoding is just to convert the value pulled out of the ahvps to a host type using the cast expression castExpr, and pass it to the mutator function.


Document ID: Generated on Fri May 15 06:36:13 EDT 2015 from SVN revision 153263
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)