VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ifVrfObjectData.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 #include <vlutil/vlString.h>
13 #include <vlpi/disEnums.h>
14 #include <vl/globalObjectDesignator.h>
15 
16 const unsigned char DtVrfObjectDataVersion = 12;
17 
19 {
20  DtNetEntityIdentifier myObjectIdentifier;// 48 bytes
21  DtNetEntityType myEntityType; // 8 bytes
22  DtNetU8 mySuperType; // 1 byte
23  DtNetU8 myLabelLength; // 1 byte
24  DtNetU8 myEchelonIdLength; // 1 bytes
25  DtNetBoolean myIsSubordinateOfForce; // 1 byte
26 // DtNetU32 myPadding2; // 4 bytes
27 }; // Total: 64 bytes
28 
30 {
31  DtNetEntityIdentifier myObjectIdentifier; // 48 bytes
32  DtNetEntityType myEntityType; // 8 bytes
33  DtNetU8 mySuperType; // 1 byte
34  DtNetU8 myLabelLength; // 1 byte
35  DtNetU8 myEchelonIdLength; // 1 bytes
36  DtNetBoolean myIsSubordinateOfForce; // 1 byte
37  DtNetBoolean myIndependentlyTasked; // 1 byte
38  DtNetU32 myPadding1; // 4 bytes
39 }; // Total: 64 bytes
40 
42 {
43  DtNetEntityIdentifier myObjectIdentifier; // 6 bytes
44  DtNetEntityType myEntityType; // 8 bytes
45  DtNetU8 mySuperType; // 1 byte
46  DtNetU8 myLabelLength; // 1 byte
47  DtNetU8 myEchelonIdLength; // 1 bytes
48  DtNetBoolean myIsSubordinateOfForce; // 1 byte
49  DtNetBoolean myIndependentlyTasked; // 1 byte
50  DtNetU8 myVrfObjectDataVersion; // 1 byte
51  DtNetU8 myOverlayParentLength; // 1 byte
52  DtNetBoolean myUnderFire; // 1 bytes
53 }; // Total: 22 bytes
54 
56 {
57  DtNetEntityIdentifier myObjectIdentifier; // 6 bytes
58  DtNetEntityType myEntityType; // 8 bytes
59  DtNetU8 mySuperType; // 1 byte
60  DtNetU8 myLabelLength; // 1 byte
61  DtNetU8 myEchelonIdLength; // 1 bytes
62  DtNetBoolean myIsSubordinateOfForce; // 1 byte
63  DtNetBoolean myIndependentlyTasked; // 1 byte
64  DtNetU8 myVrfObjectDataVersion; // 1 byte
65  DtNetU8 myOverlayParentLength; // 1 byte
66  DtNetBoolean myUnderFire; // 1 byte
67  DtNetBoolean myVrfSimulated; // 1 byte
68  DtNetU32 myVrfSessionId; // 4 bytes
69  // Added version 4 of PDU
70  DtNetU32 myVrfMessageVersionSupported; // 4 bytes
71  DtNetBoolean myHasPlan; // 1 byte
72  DtNetU8 myRulesOfEngagementLength; // 1 byte
73  DtNetBoolean myIsCurrentlyTasked; // 1 bytes
74  DtNetBoolean myExecutingPlan; // 1 byte
75  DtNetU16 myPadding1; // 2 bytes
76  DtNetU8 myPadding2; // 1 byte
77  DtNetU8 myPadding3; // 1 byte
78  DtNetU8 myPadding4; // 1 byte
79 }; // Total: 40 bytes
80 
81 // Define the bits in the VRF Flags
82 typedef DtU32 DtVrfFlag;
83 #define DT_DEFINE_VRF_FLAG(flagName, shiftVal) \
84  const unsigned flagName##BitShift = shiftVal; \
85  const DtVrfFlag flagName = 0x01 << shiftVal;
86 
87 DT_DEFINE_VRF_FLAG(DtVrfFlagVrfSimulated, 0)
88 DT_DEFINE_VRF_FLAG(DtVrfFlagIsSubordinateOfForce, 1)
89 DT_DEFINE_VRF_FLAG(DtVrfFlagIndependentlyTasked, 2)
90 DT_DEFINE_VRF_FLAG(DtVrfFlagUnderFire, 3)
91 DT_DEFINE_VRF_FLAG(DtVrfFlagHasPlan, 4)
92 DT_DEFINE_VRF_FLAG(DtVrfFlagExecutingPlan, 5)
93 DT_DEFINE_VRF_FLAG(DtVrfFlagIsCurrentlyTasked, 6)
94 DT_DEFINE_VRF_FLAG(DtVrfFlagIsClutterEntity, 7)
95 
96 
97 // class DtIfVrfObjectData:
98 //
99 // Instances of DtIfVrfObjectData are the message content for vrf
100 // object data messages. The purpose of these messages is to convey
101 // essential information about a given vrf object that is beyond the
102 // scope of DIS or the RPR FOM. This message, in combination with the
103 // corresponding entity, aggregate, or environmental PDU/interaction, provides
104 // enough information for a remote VR-Forces process to update an existing
105 // vrf object.
106 //
107 // Content-Type: DtVrfObjectDataMessageType
108 //
109 #include <vrfExtProtocol/vrfExtProtocolDefines.h>
111 {
112 public:
113 
114  // default constructor
116 
117  // destructor
118  virtual ~DtIfVrfObjectData();
119 
120  // copy constructor
122 
123  // assignment operator
125 
126  // Returns a newly created instance of a DtIfVrfObjectData.
127  virtual DtSimInterfaceContent * clone() const;
128 
129  // Returns the string type of message, DtVrfObjectResponseMessageType
130  // (defined in msgTypes.h).
131  virtual int type() const;
132 
133  // Set/get the object identifier (site:app:object id) of the vrf object.
134  // Corresponds to entity identifier for individual entities, aggregate Id
135  // for aggregates, and object identifier for environmental process objects.
136  virtual void setObjectIdentifier(const DtEntityIdentifier & objectIdentifier);
137  virtual const DtEntityIdentifier & objectIdentifier() const;
138 
139  // Set/get the session id. This is the id that is used to say whether or not
140  // front ends that are running in a particular session can control these objects
141  virtual void setVrfSessionId(int s);
142  virtual int vrfSessionId() const;
143 
144  // Set/get the message version id. This is the message version of the VRF simulator
145  // that created this object
146  virtual void setVrfMessageVersionSupported(int s);
147  virtual int vrfMessageVersionSupported() const;
148 
149  // Set/get the object label of the vrf object.
150  virtual void setObjectLabel(const DtString & objectLabel);
151  virtual const DtString & objectLabel() const;
152 
153  // Set/get object type
154  virtual void setObjectType(const DtObjectType& objectType);
155  virtual const DtObjectType& objectType() const;
156 
157  virtual void setEchelonIdString(const DtString& echelonId);
158  virtual const DtString& echelonIdString() const;
159 
160  virtual void setIsSubordinateOfForce(bool yesNo);
161  virtual bool isSubordinateOfForce() const;
162 
163  virtual void setIndependentlyTasked(bool yesNo);
164  virtual bool independentlyTasked() const;
165 
166  virtual void setOverlayParent(const DtString& parent);
167  virtual const DtString& overlayParent() const;
168 
169  // Does the entity think its currently under-fire. Default is false.
170  // @{
171  virtual void setUnderFire(bool yesNo);
172  virtual bool underFire() const;
173  // @}
174 
175  // Does the entity have a plan
176  // @{
177  virtual void setHasPlan(bool yesNo);
178  virtual bool hasPlan() const;
179  // @}
180 
181  // Indicates whether the entity is executing its plan or not.
183  virtual void setExecutingPlan(bool yesNo);
184  virtual bool executingPlan() const;
186 
187  // Is the entity currently tasked
188  // @{
189  virtual void setIsCurrentlyTasked(bool yesNo);
190  virtual bool isCurrentlyTasked() const;
191  // @}
192 
193  // Is this a clutter entity
194  // @{
195  virtual void setIsClutterEntity(bool yesNo);
196  virtual bool isClutterEntity() const;
197  // @}
198 
199  // The extended data. Used for entities only. Aggregates and environmental
200  // have their extended data
201  // @{
202  virtual void setExtendedData(const std::map<DtString, DtString>&);
203  virtual void setExtendedData(const DtString& key, const DtString& value);
204  virtual const std::map<DtString, DtString>& extendedData() const;
205  virtual DtString extendedData(const DtString& key) const;
206 
207  // Entities rules of engagement
208  // @{
209  virtual void setRulesOfEngagement(const DtString&);
210  virtual const DtString& rulesOfEngagement() const;
211  // @}
212 
213  // Set when this entity is simulated by a VR-Force back-end. Default is false.
214  // Only the VR-Forces back-end engine should set this value. Do not set this
215  // value to true unless you are planning on handling messages sent by the front-end
216  // that are supported by the VR-Forces back-end in some manner
217  // @{
218  virtual void setVrfSimulated(bool yesNo);
219  virtual bool vrfSimulated() const;
220  // @}
221 
223  //{@
224  virtual void addRangeItem(const DtRangeItem&);
225  virtual void removeRangeItem(int index);
226  virtual void setRangeItems(const DtRangeItems&);
227  const DtRangeItems& rangeItems() const;
229 
233  virtual void setBoundingVolume(const DtVector32&);
234  virtual const DtVector32& boundingVolume() const;
235 
236  virtual void setBoundingVolumeOffset(const DtVector32&);
237  virtual const DtVector32& boundingVolumeOffset() const;
239 
240  virtual char vrfObjectDataVersion() const;
241 
242  virtual int netRepSize() const;
243  virtual bool setFromNet(const char* contentBuffer,
244  unsigned contentSize);
245  virtual bool setToNet();
246 
247  virtual void printDataToString(DtString& str);
248 
249  static DtSimInterfaceContent* creator();
250 
251  bool operator!=(const DtIfVrfObjectData&) const;
252  bool operator==(const DtIfVrfObjectData&) const;
253 
254  // If myDirty flag is true, calls setToNet() before returning buffer. Called
255  // from equality operator
256  virtual char* fillInNetRep();
257 
258 protected:
259  virtual bool parseV1Buffer(const char* contentBuffer,
260  unsigned contentSize);
261  virtual bool parseV2Buffer(const char* contentBuffer,
262  unsigned contentSize);
263  virtual bool parseV3Buffer(const char* contentBuffer,
264  unsigned contentSize);
265 
266 protected:
267 
268  DtEntityIdentifier myObjectIdentifier;
280  bool myHasPlan;
285 
286  // Used for filledInNetRep() method. If myDirty is true, will call
287  // setToNet()
288  bool myDirty;
289 
292 
293  DtVector32 myBoundingVolume;
295 
297 };
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Definition: simInterfaceContent.h:78
bool myHasPlan
Definition: ifVrfObjectData.h:280
DtNetU16 myPadding1
Definition: ifVrfObjectData.h:75
DtNetU8 myEchelonIdLength
Definition: ifVrfObjectData.h:47
virtual int netRepSize() const
Definition: simInterfaceContent.h:76
Definition: ifVrfObjectData.h:110
DtNetU32 myPadding1
Definition: ifVrfObjectData.h:38
DtNetU8 myLabelLength
Definition: ifVrfObjectData.h:34
DtNetU8 myLabelLength
Definition: ifVrfObjectData.h:46
DtNetEntityIdentifier myObjectIdentifier
Definition: ifVrfObjectData.h:57
virtual int type() const =0
#define DT_DEFINE_VRF_FLAG(flagName, shiftVal)
Definition: ifVrfObjectData.h:83
DtNetU8 myOverlayParentLength
Definition: ifVrfObjectData.h:51
DtNetEntityType myEntityType
Definition: ifVrfObjectData.h:44
DtNetBoolean myIndependentlyTasked
Definition: ifVrfObjectData.h:63
DtRangeItems_V1 myRangeItems_V1
Definition: ifVrfObjectData.h:290
DtNetEntityType myEntityType
Definition: ifVrfObjectData.h:21
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
DtNetBoolean myIsSubordinateOfForce
Definition: ifVrfObjectData.h:36
DtNetU8 myEchelonIdLength
Definition: ifVrfObjectData.h:35
bool myDirty
Definition: ifVrfObjectData.h:288
DtNetEntityType myEntityType
Definition: ifVrfObjectData.h:58
Definition: vrfExtendedRecordData.h:18
bool myIndependentlyTasked
Definition: ifVrfObjectData.h:276
DtNetU8 mySuperType
Definition: ifVrfObjectData.h:59
DtNetU8 myPadding3
Definition: ifVrfObjectData.h:77
DtNetU8 myEchelonIdLength
Definition: ifVrfObjectData.h:24
Definition: rangeItem.h:74
const unsigned char DtVrfObjectDataVersion
Definition: ifVrfObjectData.h:16
DtVector32 myBoundingVolume
Definition: ifVrfObjectData.h:293
DtNetU8 mySuperType
Definition: ifVrfObjectData.h:33
Definition: objectType.h:27
bool myIsClutterEntity
Definition: ifVrfObjectData.h:283
bool myExecutingPlan
Definition: ifVrfObjectData.h:281
virtual void printDataToString(DtString &str)
Definition: ifVrfObjectData.h:41
DtNetU8 myEchelonIdLength
Definition: ifVrfObjectData.h:61
DtString myEchelonIdString
Definition: ifVrfObjectData.h:271
Definition: rangeItem.h:149
DtNetEntityIdentifier myObjectIdentifier
Definition: ifVrfObjectData.h:20
DtNetU8 mySuperType
Definition: ifVrfObjectData.h:22
DtObjectType myObjectType
Definition: ifVrfObjectData.h:269
bool myUnderFire
Definition: ifVrfObjectData.h:278
DtNetU8 mySuperType
Definition: ifVrfObjectData.h:45
DtNetBoolean myUnderFire
Definition: ifVrfObjectData.h:66
DtNetU8 myVrfObjectDataVersion
Definition: ifVrfObjectData.h:64
bool myIsCurrentlyTasked
Definition: ifVrfObjectData.h:282
DtNetBoolean myVrfSimulated
Definition: ifVrfObjectData.h:67
DtNetU8 myLabelLength
Definition: ifVrfObjectData.h:23
DtNetBoolean myIndependentlyTasked
Definition: ifVrfObjectData.h:37
int myVrfSessionId
Definition: ifVrfObjectData.h:273
const DtSimInterfaceContent & operator=(const DtSimInterfaceContent &orig)
DtNetBoolean myExecutingPlan
Definition: ifVrfObjectData.h:74
DtNetU8 myRulesOfEngagementLength
Definition: ifVrfObjectData.h:72
DtString myOverlayParent
Definition: ifVrfObjectData.h:272
char myVrfObjectDataVersion
Definition: ifVrfObjectData.h:277
bool myIsSubordinateOfForce
Definition: ifVrfObjectData.h:275
Definition: ifVrfObjectData.h:55
Definition: rangeItem.h:206
DtVector32 myBoundingVolumeOffset
Definition: ifVrfObjectData.h:294
DtEntityIdentifier myObjectIdentifier
Definition: ifVrfObjectData.h:268
#define DT_DLL_vrfExtProtocol
Definition: vrfExtProtocolDefines.h:23
DtNetBoolean myUnderFire
Definition: ifVrfObjectData.h:52
DtNetBoolean myHasPlan
Definition: ifVrfObjectData.h:71
DtNetEntityIdentifier myObjectIdentifier
Definition: ifVrfObjectData.h:43
DtNetU32 myVrfMessageVersionSupported
Definition: ifVrfObjectData.h:70
DtNetEntityIdentifier myObjectIdentifier
Definition: ifVrfObjectData.h:31
Definition: ifVrfObjectData.h:29
DtNetU8 myVrfObjectDataVersion
Definition: ifVrfObjectData.h:50
DtVrfExtendedRecordData myExtendedData
Definition: ifVrfObjectData.h:296
DtNetU32 myVrfSessionId
Definition: ifVrfObjectData.h:68
DtNetBoolean myIsSubordinateOfForce
Definition: ifVrfObjectData.h:62
virtual bool setToNet()
Definition: simInterfaceContent.h:83
DT_DLL_terrainCS bool operator!=(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
Definition: simInterfaceContent.h:45
DtNetU8 myOverlayParentLength
Definition: ifVrfObjectData.h:65
DtRangeItems myRangeItems
Definition: ifVrfObjectData.h:291
DtNetEntityType myEntityType
Definition: ifVrfObjectData.h:32
int myVrfMessageVersionSupported
Definition: ifVrfObjectData.h:274
virtual DtSimInterfaceContent * clone() const =0
DtU32 DtVrfFlag
Definition: ifVrfObjectData.h:82
DtNetBoolean myIsCurrentlyTasked
Definition: ifVrfObjectData.h:73
bool myVrfSimulated
Definition: ifVrfObjectData.h:279
DtNetBoolean myIsSubordinateOfForce
Definition: ifVrfObjectData.h:48
DtString myObjectLabel
Definition: ifVrfObjectData.h:270
DtString myRulesOfEngagement
Definition: ifVrfObjectData.h:284
DtNetBoolean myIsSubordinateOfForce
Definition: ifVrfObjectData.h:25
DtNetBoolean myIndependentlyTasked
Definition: ifVrfObjectData.h:49
DtNetU8 myLabelLength
Definition: ifVrfObjectData.h:60
DtNetU8 myPadding4
Definition: ifVrfObjectData.h:78
DtNetU8 myPadding2
Definition: ifVrfObjectData.h:76
Definition: ifVrfObjectData.h:18

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)