VR-Link API Documentation for HLA Evolved
hIffDec.h
Go to the documentation of this file.
1 /*********************************************************************
2  * ** Copyright (c) 1992-2010 VT MAK
3  * ** All rights reserved.
4  * *********************************************************************/
5 /*********************************************************************
6  * ** $RCSfile: hIffDec.h,v $ $Revision: 1.1 $ $State: Exp $
7  * *********************************************************************/
8 
9 #if DtHLA
10 
11 #ifndef DtIffDecoder_H_
12 #define DtIffDecoder_H_
13 
14 
15 #include "hBaseEmbedDec.h"
16 
20 
24 
27 
31 #define DtDECLARE_IFF_ATTR_DECODER(attrName) \
32  DtDECLARE_ATTR_DECODER(DtIffStateRepository, attrName)
33 
41 #define DtDEFINE_SIMPLE_IFF_ATTR_DECODER( \
42  attrName, netType, inspector) \
43  DtDEFINE_SIMPLE_IFF_ATTR_DECODER_WITH_CAST( \
44  attrName, netType, inspector, (netType))
45 
51 #define DtDEFINE_SIMPLE_IFF_ATTR_DECODER_WITH_CAST( \
52  attrName, netType, mutator, castExpr) \
53  DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST( \
54  DtIffDecoder, DtIffStateRepository, \
55  attrName, netType, mutator, castExpr)
56 
57 #define DtDEFINE_SIMPLE_IFF_ATTR_DECODER_WITH_CAST_AND_PARAM( \
58  decClass, attrName, netType, mutator, param, castExpr) \
59 void decClass::decode##attrName( \
60  DtIffStateRepository* stateRep, \
61  const RTI::AttributeHandleValuePairSet& attrs, \
62  int pairSetIndex) \
63 { \
64  RTI::ULong length = attrs.getValueLength(pairSetIndex); \
65  netType netVal; \
66  if (length > sizeof(netType)) \
67  { \
68  DtWarn("Size of value decoded from RTI update for attribute %s (%d)\n", \
69  #attrName, length); \
70  DtWarn(" is larger than size of %s (%d)\n", #netType, sizeof(netType)); \
71  return; \
72  } \
73  attrs.getValue(pairSetIndex, (char*) &netVal, length); \
74  stateRep->mutator(param, castExpr netVal); \
75 }
76 
78 
80 {
81 public:
82 
85  DtExerciseConn* exConn,
86  DtObjClassDesc* classDesc);
87 
89  virtual ~DtIffDecoder();
90 
92  DtIffDecoder(const DtIffDecoder& orig);
93 
95  DtIffDecoder& operator=(const DtIffDecoder& orig);
96 
97 public:
98 
99  static DtHlaStateDecoder* create(
100  DtExerciseConn* exConn,
101  DtObjClassDesc* classDesc);
102 
103 protected:
104 
105  DtDECLARE_IFF_ATTR_DECODER(EventIdentifier);
106  DtDECLARE_IFF_ATTR_DECODER(SystemMode);
107  DtDECLARE_IFF_ATTR_DECODER(SystemName);
108  DtDECLARE_IFF_ATTR_DECODER(SystemType);
109  DtDECLARE_IFF_ATTR_DECODER(SystemIsOn);
110  DtDECLARE_IFF_ATTR_DECODER(SystemIsOperational);
111 
113  DtDECLARE_IFF_ATTR_DECODER(BeamAzimuthCenter);
114  DtDECLARE_IFF_ATTR_DECODER(BeamAzimuthSweep);
115  DtDECLARE_IFF_ATTR_DECODER(BeamElevationCenter);
116  DtDECLARE_IFF_ATTR_DECODER(BeamElevationSweep);
117  DtDECLARE_IFF_ATTR_DECODER(BeamSweepSync);
118  DtDECLARE_IFF_ATTR_DECODER(Layer2DataAvailable);
119  DtDECLARE_IFF_ATTR_DECODER(FundamentalParameterData);
120  DtDECLARE_IFF_ATTR_DECODER(SecondaryOperationalDataParameter1);
121  DtDECLARE_IFF_ATTR_DECODER(SecondaryOperationalDataParameter2);
122 };
123 
124 #endif
125 #endif
126 
127 

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)