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

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...

Macros

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

Detailed Description

This file contains the declaration of DtHlaStateEncoder.

Macro Definition Documentation

#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 
)
Value:
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 
)
Value:
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 
)
Value:
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 
)
Value:
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 
)
Value:
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); \
}

Document ID: Generated on Wed Jan 7 13:31:29 EST 2015 from SVN revision 149162
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)