VR-Link API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
iffEncoder.h
Go to the documentation of this file.
1 /*********************************************************************
2  * ** Copyright (c) 1992-2010 VT MAK
3  * ** All rights reserved.
4  * *********************************************************************/
5 /*********************************************************************
6  * ** $RCSfile: hIffEnc.h,v $ $Revision: 1.1 $ $State: Exp $
7  * *********************************************************************/
8 
9 #if DtHLA
10 
11 #ifndef DtIffEncoder_H_
12 #define DtIffEncoder_H_
13 
14 
16 
20 
24 
27 
30 #define DtDECLARE_IFF_ATTR_CHECKER(attrName) \
31  DtDECLARE_ATTR_CHECKER(DtIffStateRepository, attrName)
32 
35 #define DtDECLARE_IFF_ATTR_ENCODER(attrName) \
36  DtDECLARE_ATTR_ENCODER(DtIffStateRepository, attrName)
37 
42 #define DtDEFINE_SIMPLE_IFF_ATTR_ENCODER( \
43  attrName, netType, inspector) \
44  DtDEFINE_SIMPLE_ATTR_ENCODER(DtIffEncoder, \
45  DtIffStateRepository, attrName, netType, inspector)
46 
52 #define DtDEFINE_SIMPLE_IFF_ATTR_CHECKER( \
53  attrName, inspector) \
54  DtDEFINE_SIMPLE_ATTR_CHECKER(DtIffEncoder, \
55  DtIffStateRepository, attrName, inspector)
56 
62 #define DtDEFINE_SIMPLE_IFF_ATTR_ENCODER_WITH_PARAM( \
63  encClass, attrName, netType, inspector, param) \
64 void encClass::encode##attrName(const DtIffStateRepository& rep, \
65  RTI::AttributeHandleValuePairSet* attrs, \
66  RTI::AttributeHandle attrHandle) \
67 { \
68  netType netVal; \
69  netVal = rep.inspector(param); \
70  attrs->add(attrHandle, (char*) &netVal, sizeof(netType)); \
71 }
72 
78 #define DtDEFINE_SIMPLE_IFF_ATTR_CHECKER_WITH_PARAM( \
79  encClass, attrName, inspector, param) \
80 bool encClass::need##attrName(const DtIffStateRepository& stateRep, \
81  const DtIffStateRepository& asSeenByRemote) \
82 { \
83  return (bool) !(stateRep.inspector(param) == \
84  asSeenByRemote.inspector(param)); \
85 }
86 
87 
89 
91 {
92 public:
93 
96  DtExerciseConn* exConn,
97  DtObjClassDesc* classDesc);
98 
100  virtual ~DtIffEncoder();
101 
103  DtIffEncoder(const DtIffEncoder& orig);
104 
106  DtIffEncoder& operator=(const DtIffEncoder& orig);
107 
108 public:
109 
110  static DtHlaStateEncoder* create(
111  DtExerciseConn* exConn,
112  DtObjClassDesc* classDesc);
113 
114 protected:
115 
116  DtDECLARE_IFF_ATTR_CHECKER(EventIdentifier);
117  DtDECLARE_IFF_ATTR_CHECKER(SystemMode);
118  DtDECLARE_IFF_ATTR_CHECKER(SystemName);
119  DtDECLARE_IFF_ATTR_CHECKER(SystemType);
120  DtDECLARE_IFF_ATTR_CHECKER(SystemIsOn);
121  DtDECLARE_IFF_ATTR_CHECKER(SystemIsOperational);
122 
124  DtDECLARE_IFF_ATTR_CHECKER(BeamAzimuthCenter);
125  DtDECLARE_IFF_ATTR_CHECKER(BeamAzimuthSweep);
126  DtDECLARE_IFF_ATTR_CHECKER(BeamElevationCenter);
127  DtDECLARE_IFF_ATTR_CHECKER(BeamElevationSweep);
128  DtDECLARE_IFF_ATTR_CHECKER(BeamSweepSync);
129  DtDECLARE_IFF_ATTR_CHECKER(Layer2DataAvailable);
130  DtDECLARE_IFF_ATTR_CHECKER(FundamentalParameterData);
131  DtDECLARE_IFF_ATTR_CHECKER(SecondaryOperationalDataParameter1);
132  DtDECLARE_IFF_ATTR_CHECKER(SecondaryOperationalDataParameter2);
133 
134 
135  DtDECLARE_IFF_ATTR_ENCODER(EventIdentifier);
136  DtDECLARE_IFF_ATTR_ENCODER(SystemMode);
137  DtDECLARE_IFF_ATTR_ENCODER(SystemName);
138  DtDECLARE_IFF_ATTR_ENCODER(SystemType);
139  DtDECLARE_IFF_ATTR_ENCODER(SystemIsOn);
140  DtDECLARE_IFF_ATTR_ENCODER(SystemIsOperational);
141 
143  DtDECLARE_IFF_ATTR_ENCODER(BeamAzimuthCenter);
144  DtDECLARE_IFF_ATTR_ENCODER(BeamAzimuthSweep);
145  DtDECLARE_IFF_ATTR_ENCODER(BeamElevationCenter);
146  DtDECLARE_IFF_ATTR_ENCODER(BeamElevationSweep);
147  DtDECLARE_IFF_ATTR_ENCODER(BeamSweepSync);
148  DtDECLARE_IFF_ATTR_ENCODER(Layer2DataAvailable);
149  DtDECLARE_IFF_ATTR_ENCODER(FundamentalParameterData);
150  DtDECLARE_IFF_ATTR_ENCODER(SecondaryOperationalDataParameter1);
151  DtDECLARE_IFF_ATTR_ENCODER(SecondaryOperationalDataParameter2);
152 
153 };
154 
155 #endif
156 #endif
157 
158 

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)