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. More...
 
#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. More...
 
#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. More...
 
#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). More...
 
#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. More...
 

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:
attrName, netType, inspector, (netType))
#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 DtHlaStateDe...
Definition: baseEntityDecoder.h:121
static const xmlChar * attrName
Definition: xmlFedTags.h:117
#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()); \
}
virtual void decode(const DtStateMsg &msg, DtStateRepository *stateRep) const
Virtual function override that sets some timestamping info, then calls down to the base class to perf...
Instances of DtBaseEntityStateRepository are used to maintain basic state information needed by all k...
Definition: baseEntityStateRepository.h:36
Definition: vlPrint.h:44
int DtNotifyLevel
DtNotifyLevel is used to control the level of diagnostics output by VR-Link.
DtOutputStream DtVerbose
These DtOutputStream instances are used for all print messaging in VR-Link.
DtOutputStream DtWarn
These DtOutputStream instances are used for all print messaging in VR-Link.
static const xmlChar * attrName
Definition: xmlFedTags.h:117

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:
attrName, netType, mutator, castExpr)
Instances of DtBaseEntityDecoder are used to decode a base entity state message into a state reposito...
Definition: baseEntityDecoder.h:41
Instances of DtBaseEntityStateRepository are used to maintain basic state information needed by all k...
Definition: baseEntityStateRepository.h:36
static const xmlChar * attrName
Definition: xmlFedTags.h:117
#define DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST(decClass, stateRepClass, attrName, netType, mutator, castExpr)
Defines a &quot;simple&quot; attribute decoder.
Definition: hlaStateDecoder.h:279

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 Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)