![]() |
VR-Link API Documentation for HLA 1.3
|
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... | |
Defines | |
| #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) |
| These macros are used to define simple attribute decoder functions (members of a derived DtHlaStateDecoder that decode individual attributes). | |
| #define | DtDEFINE_SIMPLE_GLOBAL_OBJECT_DESIGNATOR_ATTR_DECODER(decClass, stateRepClass, attrName, mutator) |
| #define | DtDEFINE_SIMPLE_ATTR_DECODER(decClass, stateRepClass, attrName, netType, mutator) |
This file contains the declaration of DtHlaStateDecoder.
| #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 | |||
| ) |
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 | |||
| ) |
DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST(decClass, stateRepClass, \ attrName, netType, mutator, (netType))
| #define DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST | ( | decClass, | |
| stateRepClass, | |||
| attrName, | |||
| netType, | |||
| mutator, | |||
| castExpr | |||
| ) |
void decClass::decode##attrName( \ stateRepClass* stateRep, \ const RTI::AttributeHandleValuePairSet& attrs, \ int pairSetIndex) \ { \ RTI::ULong length = attrs.getValueLength(pairSetIndex); \ netType netVal; \ if (length > sizeof(netType)) \ { \ DtWarn("Size of value decoded from RTI update for attribute %s (%d)\n", \ #attrName, length); \ DtWarn(" is larger than size of %s (%d)\n", #netType, sizeof(netType)); \ return; \ } \ attrs.getValue(pairSetIndex, (char*) &netVal, length); \ stateRep->mutator(castExpr netVal); \ }
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.
| #define DtDEFINE_SIMPLE_GLOBAL_OBJECT_DESIGNATOR_ATTR_DECODER | ( | decClass, | |
| stateRepClass, | |||
| attrName, | |||
| mutator | |||
| ) |
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); \ }