![]() |
VR-Link API Documentation for HLA 1516
|
This file contains the declaration of DtHlaStateEncoder. More...
Go to the source code of this file.
Classes | |
| class | DtHlaStateEncoder |
| DtHlaStateEncoder is used to provide encoding of a state repository into a state message in an HLA (as opposed to DIS) environment. More... | |
Defines | |
| #define | DtADD_ATTR_ENCODER(attrName) addEncoder((char *)#attrName, (DtAttributeEncoder) encode##attrName) |
| This macro is used to add attribute encoder functions (functions that encode individual attributes) to a DtHlaStateEncoder. | |
| #define | DtADD_ATTR_ENCODER_QUIET(attrName) addEncoder((char *)#attrName, (DtAttributeEncoder) encode##attrName, false) |
| Same as above, but don't complain if name is not found. | |
| #define | DtADD_ATTR_CHECKER(attrName) addChecker((char *)#attrName, (DtAttributeChecker) need##attrName) |
| This macro is used to add attribute checker functions (functions that determine whether particular attributes need to be included in an outgoing state update) to a DtHlaStateEncoder. | |
| #define | DtADD_ATTR_CHECKER_QUIET(attrName) addChecker((char *)#attrName, (DtAttributeChecker) need##attrName, false) |
| Same as above, but don't complain if name is not found. | |
| #define | DtDECLARE_ATTR_ENCODER(stateRepClass, attrName) |
| This macro is used to declare attribute encoder functions (members of a derived DtHlaStateEncoder that encode individual attributes) to a DtHlaStateEncoder. | |
| #define | DtDECLARE_ATTR_CHECKER(stateRepClass, attrName) |
| This is used to declare static member functions for determining whether or not an attribute needs to be encoded. | |
| #define | DtDEFINE_SIMPLE_ATTR_ENCODER(encClass, stateRepClass, attrName, netType, inspector) |
| These macros are used to define simple attribute encoder functions (members of a derived DtHlaStateEncoder that encode individual attributes). | |
| #define | DtDEFINE_SIMPLE_GLOBAL_OBJECT_DESIGNATOR_ATTR_ENCODER(encClass, stateRepClass, attrName, inspector) |
| #define | DtDEFINE_SIMPLE_ATTR_CHECKER(encClass, stateRepClass, attrName, inspector) |
| This macro is used to define simple attribute checker functions (members of a derived DtHlaStateEncoder that check whether a particular attribute is out of date.) The simple implementation is to just compare the values returned by the two StateReps' inspector functions. | |
This file contains the declaration of DtHlaStateEncoder.
| #define DtADD_ATTR_CHECKER | ( | attrName | ) | addChecker((char *)#attrName, (DtAttributeChecker) need##attrName) |
This macro is used to add attribute checker functions (functions that determine whether particular attributes need to be included in an outgoing state update) to a DtHlaStateEncoder.
| #define DtADD_ATTR_CHECKER_QUIET | ( | attrName | ) | addChecker((char *)#attrName, (DtAttributeChecker) need##attrName, false) |
Same as above, but don't complain if name is not found.
| #define DtADD_ATTR_ENCODER | ( | attrName | ) | addEncoder((char *)#attrName, (DtAttributeEncoder) encode##attrName) |
This macro is used to add attribute encoder functions (functions that encode individual attributes) to a DtHlaStateEncoder.
| #define DtADD_ATTR_ENCODER_QUIET | ( | attrName | ) | addEncoder((char *)#attrName, (DtAttributeEncoder) encode##attrName, false) |
Same as above, but don't complain if name is not found.
| #define DtDECLARE_ATTR_CHECKER | ( | stateRepClass, | |
| attrName | |||
| ) |
static bool need##attrName(const stateRepClass& stateRep, \ const stateRepClass& asSeenByRemote)
This is used to declare static member functions for determining whether or not an attribute needs to be encoded.
| #define DtDECLARE_ATTR_ENCODER | ( | stateRepClass, | |
| attrName | |||
| ) |
static void encode##attrName(const stateRepClass& rep, \ RTI::AttributeHandleValuePairSet* attrs, \ RTI::AttributeHandle attrHandle)
This macro is used to declare attribute encoder functions (members of a derived DtHlaStateEncoder that encode individual attributes) to a DtHlaStateEncoder.
| #define DtDEFINE_SIMPLE_ATTR_CHECKER | ( | encClass, | |
| stateRepClass, | |||
| attrName, | |||
| inspector | |||
| ) |
bool encClass::need##attrName(const stateRepClass& stateRep, \ const stateRepClass& asSeenByRemote) \ { \ return (bool) !(stateRep.inspector() == asSeenByRemote.inspector()); \ }
This macro is used to define simple attribute checker functions (members of a derived DtHlaStateEncoder that check whether a particular attribute is out of date.) The simple implementation is to just compare the values returned by the two StateReps' inspector functions.
| #define DtDEFINE_SIMPLE_ATTR_ENCODER | ( | encClass, | |
| stateRepClass, | |||
| attrName, | |||
| netType, | |||
| inspector | |||
| ) |
void encClass::encode##attrName(const stateRepClass& rep, \ RTI::AttributeHandleValuePairSet* attrs, \ RTI::AttributeHandle attrHandle) \ { \ netType netVal; \ netVal = rep.inspector(); \ attrs->add(attrHandle, (char*) &netVal, sizeof(netType)); \ }
These macros are used to define simple attribute encoder functions (members of a derived DtHlaStateEncoder that encode individual attributes).
The simple encoding is just to implicitly convert the value returned by the inspector to a netType, and add it to the ahvps.
| #define DtDEFINE_SIMPLE_GLOBAL_OBJECT_DESIGNATOR_ATTR_ENCODER | ( | encClass, | |
| stateRepClass, | |||
| attrName, | |||
| inspector | |||
| ) |
void encClass::encode##attrName(const stateRepClass& rep, \ RTI::AttributeHandleValuePairSet* attrs, \ RTI::AttributeHandle attrHandle) \ { \ DtGlobalObjectDesignator netVal = rep.inspector(); \ attrs->add(attrHandle, (char*) netVal.string(), netVal.length()+1); \ }