8 #ifndef DtNatoIffEncoder_H_
9 #define DtNatoIffEncoder_H_
26 #define DtDECLARE_NATO_IFF_ATTR_CHECKER(attrName) \
27 DtDECLARE_ATTR_CHECKER(DtIffStateRepository, attrName)
31 #define DtDECLARE_NATO_IFF_ATTR_ENCODER(attrName) \
32 DtDECLARE_ATTR_ENCODER(DtIffStateRepository, attrName)
38 #define DtDEFINE_SIMPLE_NATO_IFF_ATTR_ENCODER( \
39 attrName, netType, inspector) \
40 DtDEFINE_SIMPLE_ATTR_ENCODER(DtNatoIffEncoder, \
41 DtIffStateRepository, attrName, netType, inspector)
48 #define DtDEFINE_SIMPLE_NATO_IFF_ATTR_CHECKER( \
49 attrName, inspector) \
50 DtDEFINE_SIMPLE_ATTR_CHECKER(DtNatoIffEncoder, \
51 DtIffStateRepository, attrName, inspector)
58 #define DtDEFINE_SIMPLE_NATO_IFF_ATTR_ENCODER_WITH_PARAM( \
59 attrName, netType, inspector, param) \
60 DtDEFINE_SIMPLE_IFF_ATTR_ENCODER_WITH_PARAM( \
61 DtNatoIffEncoder, attrName, netType, inspector, param)
68 #define DtDEFINE_SIMPLE_NATO_IFF_ATTR_CHECKER_WITH_PARAM( \
69 attrName, inspector, param) \
70 DtDEFINE_SIMPLE_IFF_ATTR_CHECKER_WITH_PARAM( \
71 DtNatoIffEncoder, attrName, inspector, param)
83 #define DtDECLARE_NATO_IFF_MODE4_ATTR_CHECKER(attrName) \
84 DtDECLARE_ATTR_CHECKER(DtIffStateRepository, attrName)
88 #define DtDECLARE_NATO_IFF_MODE4_ATTR_ENCODER(attrName) \
89 DtDECLARE_ATTR_ENCODER(DtIffStateRepository, attrName)
96 #define DtDEFINE_SIMPLE_MODE4_ATTR_ENCODER(\
97 encClass, stateRepClass, attrName, netType, inspector) \
98 void encClass::encode##attrName(const stateRepClass& rep, \
99 RTI::AttributeHandleValuePairSet* attrs, \
100 RTI::AttributeHandle attrHandle) \
104 netVal = rep.mode4()->inspector(); \
105 attrs->add(attrHandle, (char*) &netVal, sizeof(netType)); \
114 #define DtDEFINE_SIMPLE_MODE4_ATTR_CHECKER( \
115 encClass, stateRepClass, attrName, inspector) \
116 bool encClass::need##attrName(const stateRepClass& stateRep, \
117 const stateRepClass& asSeenByRemote) \
119 return (bool) (stateRep.mode4() && asSeenByRemote.mode4() && !(stateRep.mode4()->inspector() == \
120 asSeenByRemote.mode4()->inspector())); \
127 #define DtDEFINE_SIMPLE_NATO_IFF_MODE4_ATTR_ENCODER( \
128 attrName, netType, inspector) \
129 DtDEFINE_SIMPLE_MODE4_ATTR_ENCODER(DtNatoIffEncoder, \
130 DtIffStateRepository, attrName, netType, inspector)
137 #define DtDEFINE_SIMPLE_NATO_IFF_MODE4_ATTR_CHECKER( \
138 attrName, inspector) \
139 DtDEFINE_SIMPLE_MODE4_ATTR_CHECKER(DtNatoIffEncoder, \
140 DtIffStateRepository, attrName, inspector)
147 #define DtDEFINE_SIMPLE_NATO_IFF_MODE4_ATTR_ENCODER_WITH_PARAM( \
148 attrName, netType, inspector, param) \
149 DtDEFINE_SIMPLE_IFF_ATTR_ENCODER_WITH_PARAM( \
150 DtNatoIffEncoder, attrName, netType, inspector, param)
157 #define DtDEFINE_SIMPLE_NATO_IFF_MODE4_ATTR_CHECKER_WITH_PARAM( \
158 attrName, inspector, param) \
159 DtDEFINE_SIMPLE_IFF_ATTR_CHECKER_WITH_PARAM( \
160 DtNatoIffEncoder, DtMode4StateRepository, attrName, inspector, param)
175 #define DtDECLARE_NATO_IFF_TCAS_ATTR_CHECKER(attrName) \
176 DtDECLARE_ATTR_CHECKER(DtIffStateRepository, attrName)
180 #define DtDECLARE_NATO_IFF_TCAS_ATTR_ENCODER(attrName) \
181 DtDECLARE_ATTR_ENCODER(DtIffStateRepository, attrName)
188 #define DtDEFINE_SIMPLE_TCAS_ATTR_ENCODER( \
189 encClass, stateRepClass, attrName, netType, inspector) \
190 void encClass::encode##attrName(const stateRepClass& rep, \
191 RTI::AttributeHandleValuePairSet* attrs, \
192 RTI::AttributeHandle attrHandle) \
194 if (rep.tcasData()) { \
196 netVal = rep.tcasData()->inspector(); \
197 attrs->add(attrHandle, (char*) &netVal, sizeof(netType)); \
205 #define DtDEFINE_SIMPLE_NATO_IFF_TCAS_ATTR_ENCODER( \
206 attrName, netType, inspector) \
207 DtDEFINE_SIMPLE_TCAS_ATTR_ENCODER(DtNatoIffEncoder, \
208 DtIffStateRepository, attrName, netType, inspector)
215 #define DtDEFINE_SIMPLE_TCAS_ATTR_CHECKER( \
216 encClass, stateRepClass, attrName, inspector) \
217 bool encClass::need##attrName(const stateRepClass& stateRep, \
218 const stateRepClass& asSeenByRemote) \
220 return (bool) (stateRep.tcasData() && asSeenByRemote.tcasData() && !(stateRep.tcasData()->inspector() == \
221 asSeenByRemote.tcasData()->inspector())); \
229 #define DtDEFINE_SIMPLE_NATO_IFF_TCAS_ATTR_CHECKER( \
230 attrName, inspector) \
231 DtDEFINE_SIMPLE_TCAS_ATTR_CHECKER(DtNatoIffEncoder, \
232 DtIffStateRepository, attrName, inspector)
239 #define DtDEFINE_SIMPLE_NATO_IFF_TCAS_ATTR_ENCODER_WITH_PARAM( \
240 attrName, netType, inspector, param) \
241 DtDEFINE_SIMPLE_IFF_ATTR_ENCODER_WITH_PARAM( \
242 DtNatoIffEncoder, attrName, netType, inspector, param)
249 #define DtDEFINE_SIMPLE_NATO_IFF_TCAS_ATTR_CHECKER_WITH_PARAM( \
250 attrName, inspector, param) \
251 DtDEFINE_SIMPLE_IFF_ATTR_CHECKER_WITH_PARAM( \
252 DtNatoIffEncoder, DtTCASDataStateRepository, attrName, inspector, param)
Instances of DtTCASDataStateRepository are used to store state data for IFFData.TCASData objects...
Definition: iffTCASDataStateRepository.h:29
Instances of DtExerciseConn are used to provide an application's interface or connection to the netwo...
Definition: exerciseConnHLA.h:61
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
This file provides a declaration of the class DtIffEncoder.
Defines a protocol independent repository of attributes for IFF objects.
Definition: iffStateRepository.h:39
DtHlaStateEncoder is used to provide encoding of a state repository into a state message in an HLA (a...
Definition: hlaStateEncoder.h:30
An instance of DtObjClassDesc is a "class descriptor" for an HLA Object class.
Definition: objClassDesc13.h:41
#define DtDECLARE_NATO_IFF_ATTR_CHECKER(attrName)
We define several macros that can be helpful in defining the class, and the individual decoding funct...
Definition: natoIffEncoder.h:26
#define DtDECLARE_NATO_IFF_MODE4_ATTR_CHECKER(attrName)
We define several macros that can be helpful in defining the class, and the individual decoding funct...
Definition: natoIffEncoder.h:83
#define DtDECLARE_NATO_IFF_TCAS_ATTR_CHECKER(attrName)
We define several macros that can be helpful in defining the class, and the individual decoding funct...
Definition: natoIffEncoder.h:175
#define DtDECLARE_NATO_IFF_TCAS_ATTR_ENCODER(attrName)
This is used to declare static member functions that perform attribute encoding.
Definition: natoIffEncoder.h:180
The DtIffEncoder class:
Definition: iffEncoder.h:69
Instances of DtMode4StateRepository are used to store state data for IFFData.Mode4 objects...
Definition: iffMode4StateRepository.h:29
Mode TCAS Specific Attribute Decoder Macros.
Definition: natoIffEncoder.h:256
static DtHlaStateEncoder * create(DtExerciseConn *exConn, DtObjClassDesc *classDesc)
DtIffEncoder & operator=(const DtIffEncoder &orig)
assignment operator
#define DtDECLARE_NATO_IFF_MODE4_ATTR_ENCODER(attrName)
This is used to declare static member functions that perform attribute encoding.
Definition: natoIffEncoder.h:88
#define DtDECLARE_NATO_IFF_ATTR_ENCODER(attrName)
This is used to declare static member functions that perform attribute encoding.
Definition: natoIffEncoder.h:31