VR-Link API Documentation for HLA 1.3
 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 
154  DtDECLARE_IFF_ATTR_CHECKER(SystemDesignator);
155  DtDECLARE_IFF_ATTR_ENCODER(SystemDesignator);
156 };
157 
158 #endif
159 #endif
160 
161 
DtBaseEmbeddedSystemEncoder & operator=(const DtBaseEmbeddedSystemEncoder &orig)
assignment operator
Instances of DtExerciseConn are used to provide an application's interface or connection to the netwo...
Definition: exerciseConnHLA.h:60
Instances of DtBaseEmbeddedSystemEncoder are used to encode a base embedded system state repository i...
Definition: baseEmbeddedSystemEncoder.h:35
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
#define DtDECLARE_IFF_ATTR_CHECKER(attrName)
We define several macros that can be helpful in defining the class, and the individual decoding funct...
Definition: iffEncoder.h:30
Defines a protocol independent repository of attributes for IFF objects.
Definition: iffStateRepository.h:57
#define DtDECLARE_IFF_ATTR_ENCODER(attrName)
This is used to declare static member functions that perform attribute encoding.
Definition: iffEncoder.h:35
DtHlaStateEncoder is used to provide encoding of a state repository into a state message in an HLA (a...
Definition: hlaStateEncoder.h:30
This file provides a declaration of the class DtBaseEmbeddedSystemEncoder.
An instance of DtObjClassDesc is a "class descriptor" for an HLA Object class.
Definition: objClassDesc13.h:41
The DtIffEncoder class:
Definition: iffEncoder.h:90
static DtHlaStateEncoder * create(DtExerciseConn *exConn, DtObjClassDesc *classDesc)
Create a DtBaseEntityEncoder. Caller is responsible for deletion.

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)