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

This file contains the declaration of DtHlaStateDecoder. More...

Go to the source code of this file.

Classes

class  DtHlaStateDecoder
 DtHlaStateDecoder is used to provide decoding of a state message into a state repository in an HLA (as opposed to DIS) environment. More...

Macros

#define DtADD_ATTR_DECODER(attrName)   addDecoder((char *)#attrName, (DtAttributeDecoder) decode##attrName);
 This macro is used to add attribute decoder functions (functions that decode individual attributes) to a DtHlaStateDecoder.
#define DtADD_ATTR_DECODER_QUIET(attrName)   addDecoder((char *)#attrName, (DtAttributeDecoder) decode##attrName, false);
 Same as above, but don't complain if name is not found.
#define DtDECLARE_ATTR_DECODER(stateRepClass, attrName)
 This macro is used to declare attribute decoder functions (members of a derived DtHlaStateDecoder that decode individual attributes) to a DtHlaStateDecoder.
#define DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST(decClass, stateRepClass, attrName, netType, mutator, castExpr)
 Defines a "simple" attribute decoder.
#define DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST_SET(decClass, stateRepClass, attrName, netType, castExpr)
 Defines a "simple" attribute decoder.
#define DtDEFINE_SIMPLE_ATTR_DECODER_MUTATOR(decClass, stateRepClass, attrName, netType, mutator)
 Defines a "simple" attribute decoder.
#define DtDEFINE_SIMPLE_ATTR_DECODER_SET(decClass, stateRepClass, attrName, netType)
 Defines a "simple" attribute decoder.
#define DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST_AND_PARAM(decClass, stateRepClass, attrName, netType, mutator, param, castExpr)
 Defines a "simple" attribute decoder.
#define DtDEFINE_SIMPLE_GLOBAL_OBJECT_DESIGNATOR_ATTR_DECODER(decClass, stateRepClass, attrName, mutator)
#define DtDEFINE_SIMPLE_ATTR_DECODER_BUFF(decClass, stateRepClass, attrName, mutator)
 Defines a char* buffer attribute decoder.
#define DtDEFINE_SIMPLE_ATTR_DECODER(decClass, stateRepClass, attrName, netType, mutator)
 Old name for DtDEFINE_SIMPLE_ATTR_DECODER_MUTATOR, kept for backwards compatibility.

Detailed Description

This file contains the declaration of DtHlaStateDecoder.

Macro Definition Documentation

#define DtADD_ATTR_DECODER (   attrName)    addDecoder((char *)#attrName, (DtAttributeDecoder) decode##attrName);

This macro is used to add attribute decoder functions (functions that decode individual attributes) to a DtHlaStateDecoder.

#define DtADD_ATTR_DECODER_QUIET (   attrName)    addDecoder((char *)#attrName, (DtAttributeDecoder) decode##attrName, false);

Same as above, but don't complain if name is not found.

#define DtDECLARE_ATTR_DECODER (   stateRepClass,
  attrName 
)
Value:
static void decode##attrName(stateRepClass* stateRep, \
const RTI::AttributeHandleValuePairSet& attrs, int pairSetIndex)

This macro is used to declare attribute decoder functions (members of a derived DtHlaStateDecoder that decode individual attributes) to a DtHlaStateDecoder.

#define DtDEFINE_SIMPLE_ATTR_DECODER (   decClass,
  stateRepClass,
  attrName,
  netType,
  mutator 
)
Value:
DtDEFINE_SIMPLE_ATTR_DECODER_MUTATOR(decClass, stateRepClass, \
attrName, netType, mutator)

Old name for DtDEFINE_SIMPLE_ATTR_DECODER_MUTATOR, kept for backwards compatibility.

#define DtDEFINE_SIMPLE_ATTR_DECODER_BUFF (   decClass,
  stateRepClass,
  attrName,
  mutator 
)
Value:
void decClass::decode##attrName( \
stateRepClass* stateRep, \
const RTI::AttributeHandleValuePairSet& attrs, \
int index) \
{ \
RTI::ULong length = 0; \
char* buff = attributeData(attrs, index, length); \
if (length > 0) \
{ \
stateRep->mutator(buff, length); \
} \
}

Defines a char* buffer attribute decoder.

One in which we merely extract the data from the AHVPS and pass it and the length to the named state rep. mutator. Arguments are the decoder class, the interaction class, the parameter name, the network type, and the mutator.

#define DtDEFINE_SIMPLE_ATTR_DECODER_MUTATOR (   decClass,
  stateRepClass,
  attrName,
  netType,
  mutator 
)
Value:
void decClass::decode##attrName( \
stateRepClass* stateRep, \
const RTI::AttributeHandleValuePairSet& attrs, \
int index) \
{ \
RTI::ULong length = 0; \
netType* netValPtr = (netType*)attributeData(attrs, index, length, sizeof(netType), #attrName); \
if (netValPtr) \
{ \
stateRep->mutator(*netValPtr); \
} \
}

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_ATTR_DECODER_SET (   decClass,
  stateRepClass,
  attrName,
  netType 
)
Value:
decClass, stateRepClass, attrName, netType, set##attrName)

Defines a "simple" attribute decoder.

One in which we merely extract the data from the AHVPS into a variable of the named network type. The network variable is passed to the repository mutator named setAttrName. 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, and the network type.

#define DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST (   decClass,
  stateRepClass,
  attrName,
  netType,
  mutator,
  castExpr 
)
Value:
void decClass::decode##attrName( \
stateRepClass* stateRep, \
const RTI::AttributeHandleValuePairSet& attrs, \
int index) \
{ \
RTI::ULong length = 0; \
netType* netValPtr = (netType*)attributeData(attrs, index, length, sizeof(netType), #attrName); \
if (netValPtr) \
{ \
stateRep->mutator(castExpr *netValPtr); \
} \
}

Defines a "simple" attribute decoder.

One in which we merely extract the data from the AHVPS into a variable of the named network type, and pass it to a named repository mutator method using the given cast expression. This works when the network type used to store the FOM representation can be converted to the native type expected by the mutator. Arguments are the decoder class, the state repository class, the attribute name, the network type, the mutator, and the cast operation.

#define DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST_AND_PARAM (   decClass,
  stateRepClass,
  attrName,
  netType,
  mutator,
  param,
  castExpr 
)
Value:
void decClass::decode##attrName( \
stateRepClass* stateRep, \
const RTI::AttributeHandleValuePairSet& attrs, \
int index) \
{ \
RTI::ULong length = 0; \
netType* netValPtr = (netType*)attributeData(attrs, index, length, sizeof(netType), #attrName); \
if (netValPtr) \
{ \
stateRep->mutator(param, castExpr *netValPtr); \
} \
}

Defines a "simple" attribute decoder.

One in which we merely extract the data from the AHVPS into a variable of the named network type, and pass it to a named repository mutator using the given cast expression and along with the given additional parameter. This works when the network type used to store the FOM representation can be converted to the native type expected by the mutator. Arguments are the decoder class, the state repository class, the attribute name, the network type, the mutator, the parameter, and the cast operation.

#define DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST_SET (   decClass,
  stateRepClass,
  attrName,
  netType,
  castExpr 
)
Value:
decClass, stateRepClass, attrName, netType, set##attrName, castExpr)

Defines a "simple" attribute decoder.

One in which we merely extract the data from the AHVPS into a variable of the named network type, and pass it to a repository mutator named setAttrName using the given cast expression. This works when the network type used to store the FOM representation can be converted to the native type expected by the mutator. Arguments are the decoder class, the state repository class, the attribute name, the network type, and the cast operation.

#define DtDEFINE_SIMPLE_GLOBAL_OBJECT_DESIGNATOR_ATTR_DECODER (   decClass,
  stateRepClass,
  attrName,
  mutator 
)
Value:
void decClass::decode##attrName( \
stateRepClass* stateRep, \
const RTI::AttributeHandleValuePairSet& attrs, \
int pairSetIndex) \
{ \
RTI::ULong length = 0; \
DtGlobalObjectDesignator objName = (char*) attrs.getValuePointer(pairSetIndex, length); \
stateRep->mutator(objName); \
}

Document ID: Generated on Thu Feb 22 04:26:36 EST 2018 from SVN revision 186468
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)