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) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 #include <vlutil/vlString.h>
12 #include <vlpi/disEnums.h>
13 #include <vl/globalObjectDesignator.h>
14 
15 const unsigned char DtVrfObjectDataVersion = 13;
16 
18 {
19  DtNetEntityIdentifier myObjectIdentifier;// 48 bytes
20  DtNetEntityType myEntityType; // 8 bytes
21  DtNetU8 mySuperType; // 1 byte
22  DtNetU8 myLabelLength; // 1 byte
23  DtNetU8 myEchelonIdLength; // 1 bytes
24  DtNetBoolean myIsSubordinateOfForce; // 1 byte
25 // DtNetU32 myPadding2; // 4 bytes
26 }; // Total: 64 bytes
27 
29 {
30  DtNetEntityIdentifier myObjectIdentifier; // 48 bytes
31  DtNetEntityType myEntityType; // 8 bytes
32  DtNetU8 mySuperType; // 1 byte
33  DtNetU8 myLabelLength; // 1 byte
34  DtNetU8 myEchelonIdLength; // 1 bytes
35  DtNetBoolean myIsSubordinateOfForce; // 1 byte
36  DtNetBoolean myIndependentlyTasked; // 1 byte
37  DtNetU32 myPadding1; // 4 bytes
38 }; // Total: 64 bytes
39 
41 {
42  DtNetEntityIdentifier myObjectIdentifier; // 6 bytes
43  DtNetEntityType myEntityType; // 8 bytes
44  DtNetU8 mySuperType; // 1 byte
45  DtNetU8 myLabelLength; // 1 byte
46  DtNetU8 myEchelonIdLength; // 1 bytes
47  DtNetBoolean myIsSubordinateOfForce; // 1 byte
48  DtNetBoolean myIndependentlyTasked; // 1 byte
49  DtNetU8 myVrfObjectDataVersion; // 1 byte
50  DtNetU8 myOverlayParentLength; // 1 byte
51  DtNetBoolean myUnderFire; // 1 bytes
52 }; // Total: 22 bytes
53 
55 {
56  DtNetEntityIdentifier myObjectIdentifier; // 6 bytes
57  DtNetU16 myUnused1; // 4 bytes
58  DtNetU16 myUnused2; // 4 bytes
59  DtNetU8 myUnused3; // 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() override;
119 
120  // copy constructor
122 
123  // assignment operator
125 
126  // Returns a newly created instance of a DtIfVrfObjectData.
127  virtual DtSimInterfaceContent *clone() const override;
128 
129  // Returns the string type of message, DtVrfObjectResponseMessageType
130  // (defined in msgTypes.h).
131  virtual int type() const override;
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  virtual void setEchelonIdString(const DtString& echelonId);
154  virtual const DtString& echelonIdString() const;
155 
156  virtual void setIsSubordinateOfForce(bool yesNo);
157  virtual bool isSubordinateOfForce() const;
158 
159  virtual void setIndependentlyTasked(bool yesNo);
160  virtual bool independentlyTasked() const;
161 
162  virtual void setOverlayParent(const DtString& parent);
163  virtual const DtString& overlayParent() const;
164 
165  // Does the entity think its currently under-fire. Default is false.
166  // @{
167  virtual void setUnderFire(bool yesNo);
168  virtual bool underFire() const;
169  // @}
170 
171  // Does the entity have a plan
172  // @{
173  virtual void setHasPlan(bool yesNo);
174  virtual bool hasPlan() const;
175  // @}
176 
177  // Indicates whether the entity is executing its plan or not.
179  virtual void setExecutingPlan(bool yesNo);
180  virtual bool executingPlan() const;
182 
183  // Is the entity currently tasked
184  // @{
185  virtual void setIsCurrentlyTasked(bool yesNo);
186  virtual bool isCurrentlyTasked() const;
187  // @}
188 
189  // Is this a clutter entity
190  // @{
191  virtual void setIsClutterEntity(bool yesNo);
192  virtual bool isClutterEntity() const;
193  // @}
194 
195  // The extended data. Used for entities only. Aggregates and environmental
196  // have their extended data
197  // @{
198  virtual void setExtendedData(const std::map<DtString, DtString>&);
199  virtual void setExtendedData(const DtString& key, const DtString& value);
200  virtual const std::map<DtString, DtString>& extendedData() const;
201  virtual DtString extendedData(const DtString& key) const;
202 
203  // Entities rules of engagement
204  // @{
205  virtual void setRulesOfEngagement(const DtString&);
206  virtual const DtString& rulesOfEngagement() const;
207  // @}
208 
209  // Set when this entity is simulated by a VR-Force back-end. Default is false.
210  // Only the VR-Forces back-end engine should set this value. Do not set this
211  // value to true unless you are planning on handling messages sent by the front-end
212  // that are supported by the VR-Forces back-end in some manner
213  // @{
214  virtual void setVrfSimulated(bool yesNo);
215  virtual bool vrfSimulated() const;
216  // @}
217 
219  //{@
220  virtual void addRangeItem(const DtRangeItem&);
221  virtual void removeRangeItem(int index);
222  virtual void setRangeItems(const DtRangeItems&);
223  const DtRangeItems& rangeItems() const;
225 
229  virtual void setBoundingVolume(const DtVector32&);
230  virtual const DtVector32& boundingVolume() const;
231 
232  virtual void setBoundingVolumeOffset(const DtVector32&);
233  virtual const DtVector32& boundingVolumeOffset() const;
235 
236  virtual char vrfObjectDataVersion() const;
237 
238  virtual int netRepSize() const override;
239  virtual bool setFromNet(const char *contentBuffer,
240  unsigned contentSize) override;
241  virtual bool setToNet() override;
242 
243  virtual void printDataToString(DtString &str) override;
244 
245  static DtSimInterfaceContent* creator();
246 
247  bool operator!=(const DtIfVrfObjectData&) const;
248  bool operator==(const DtIfVrfObjectData&) const;
249 
250  // If myDirty flag is true, calls setToNet() before returning buffer. Called
251  // from equality operator
252  virtual char* fillInNetRep();
253 
254 protected:
255  virtual bool parseV1Buffer(const char* contentBuffer,
256  unsigned contentSize);
257  virtual bool parseV2Buffer(const char* contentBuffer,
258  unsigned contentSize);
259  virtual bool parseV3Buffer(const char* contentBuffer,
260  unsigned contentSize);
261 
262 protected:
263 
264  DtEntityIdentifier myObjectIdentifier;
275  bool myHasPlan;
280 
281  // Used for filledInNetRep() method. If myDirty is true, will call
282  // setToNet()
283  bool myDirty;
284 
287 
288  DtVector32 myBoundingVolume;
290 
292 };
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Definition: simInterfaceContent.h:78
bool myHasPlan
Definition: ifVrfObjectData.h:275
DtNetU16 myPadding1
Definition: ifVrfObjectData.h:75
DtNetU8 myEchelonIdLength
Definition: ifVrfObjectData.h:46
virtual int netRepSize() const
Definition: simInterfaceContent.h:76
Definition: ifVrfObjectData.h:110
DtNetU32 myPadding1
Definition: ifVrfObjectData.h:37
DtNetU8 myLabelLength
Definition: ifVrfObjectData.h:33
DtNetU8 myLabelLength
Definition: ifVrfObjectData.h:45
DtNetEntityIdentifier myObjectIdentifier
Definition: ifVrfObjectData.h:56
virtual int type() const =0
#define DT_DEFINE_VRF_FLAG(flagName, shiftVal)
Definition: ifVrfObjectData.h:83
DtNetU8 myOverlayParentLength
Definition: ifVrfObjectData.h:50
DtNetEntityType myEntityType
Definition: ifVrfObjectData.h:43
DtNetBoolean myIndependentlyTasked
Definition: ifVrfObjectData.h:63
DtRangeItems_V1 myRangeItems_V1
Definition: ifVrfObjectData.h:285
DtNetU16 myUnused1
Definition: ifVrfObjectData.h:57
DtNetEntityType myEntityType
Definition: ifVrfObjectData.h:20
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
DtNetBoolean myIsSubordinateOfForce
Definition: ifVrfObjectData.h:35
DtNetU8 myEchelonIdLength
Definition: ifVrfObjectData.h:34
bool myDirty
Definition: ifVrfObjectData.h:283
Definition: vrfExtendedRecordData.h:18
bool myIndependentlyTasked
Definition: ifVrfObjectData.h:271
DtNetU8 myPadding3
Definition: ifVrfObjectData.h:77
DtNetU8 myEchelonIdLength
Definition: ifVrfObjectData.h:23
Definition: rangeItem.h:74
const unsigned char DtVrfObjectDataVersion
Definition: ifVrfObjectData.h:15
DtVector32 myBoundingVolume
Definition: ifVrfObjectData.h:288
DtNetU8 mySuperType
Definition: ifVrfObjectData.h:32
DtNetU8 myUnused3
Definition: ifVrfObjectData.h:59
bool myIsClutterEntity
Definition: ifVrfObjectData.h:278
bool myExecutingPlan
Definition: ifVrfObjectData.h:276
virtual void printDataToString(DtString &str)
Definition: ifVrfObjectData.h:40
DtNetU8 myEchelonIdLength
Definition: ifVrfObjectData.h:61
DtString myEchelonIdString
Definition: ifVrfObjectData.h:266
Definition: rangeItem.h:149
DtNetEntityIdentifier myObjectIdentifier
Definition: ifVrfObjectData.h:19
DtNetU8 mySuperType
Definition: ifVrfObjectData.h:21
bool myUnderFire
Definition: ifVrfObjectData.h:273
DtNetU8 mySuperType
Definition: ifVrfObjectData.h:44
DtNetBoolean myUnderFire
Definition: ifVrfObjectData.h:66
DtNetU8 myVrfObjectDataVersion
Definition: ifVrfObjectData.h:64
bool myIsCurrentlyTasked
Definition: ifVrfObjectData.h:277
DtNetBoolean myVrfSimulated
Definition: ifVrfObjectData.h:67
DtNetU8 myLabelLength
Definition: ifVrfObjectData.h:22
DtNetBoolean myIndependentlyTasked
Definition: ifVrfObjectData.h:36
int myVrfSessionId
Definition: ifVrfObjectData.h:268
const DtSimInterfaceContent & operator=(const DtSimInterfaceContent &orig)
DtNetBoolean myExecutingPlan
Definition: ifVrfObjectData.h:74
DtNetU8 myRulesOfEngagementLength
Definition: ifVrfObjectData.h:72
DtString myOverlayParent
Definition: ifVrfObjectData.h:267
char myVrfObjectDataVersion
Definition: ifVrfObjectData.h:272
bool myIsSubordinateOfForce
Definition: ifVrfObjectData.h:270
Definition: ifVrfObjectData.h:54
Definition: rangeItem.h:206
DtVector32 myBoundingVolumeOffset
Definition: ifVrfObjectData.h:289
DtEntityIdentifier myObjectIdentifier
Definition: ifVrfObjectData.h:264
#define DT_DLL_vrfExtProtocol
Definition: vrfExtProtocolDefines.h:23
DtNetBoolean myUnderFire
Definition: ifVrfObjectData.h:51
DtNetBoolean myHasPlan
Definition: ifVrfObjectData.h:71
DtNetEntityIdentifier myObjectIdentifier
Definition: ifVrfObjectData.h:42
DtNetU32 myVrfMessageVersionSupported
Definition: ifVrfObjectData.h:70
DtNetEntityIdentifier myObjectIdentifier
Definition: ifVrfObjectData.h:30
Definition: ifVrfObjectData.h:28
DtNetU8 myVrfObjectDataVersion
Definition: ifVrfObjectData.h:49
DtVrfExtendedRecordData myExtendedData
Definition: ifVrfObjectData.h:291
DtNetU32 myVrfSessionId
Definition: ifVrfObjectData.h:68
DtNetBoolean myIsSubordinateOfForce
Definition: ifVrfObjectData.h:62
virtual bool setToNet()
Definition: simInterfaceContent.h:83
DtNetU16 myUnused2
Definition: ifVrfObjectData.h:58
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:286
DtNetEntityType myEntityType
Definition: ifVrfObjectData.h:31
int myVrfMessageVersionSupported
Definition: ifVrfObjectData.h:269
virtual DtSimInterfaceContent * clone() const =0
DtU32 DtVrfFlag
Definition: ifVrfObjectData.h:82
DtNetBoolean myIsCurrentlyTasked
Definition: ifVrfObjectData.h:73
bool myVrfSimulated
Definition: ifVrfObjectData.h:274
DtNetBoolean myIsSubordinateOfForce
Definition: ifVrfObjectData.h:47
DtString myObjectLabel
Definition: ifVrfObjectData.h:265
DtString myRulesOfEngagement
Definition: ifVrfObjectData.h:279
DtNetBoolean myIsSubordinateOfForce
Definition: ifVrfObjectData.h:24
DtNetBoolean myIndependentlyTasked
Definition: ifVrfObjectData.h:48
DtNetU8 myLabelLength
Definition: ifVrfObjectData.h:60
DtNetU8 myPadding4
Definition: ifVrfObjectData.h:78
DtNetU8 myPadding2
Definition: ifVrfObjectData.h:76
Definition: ifVrfObjectData.h:17

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)