VR-Forces 4.7 Class Documentation
 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 = 8;
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 // class DtIfVrfObjectData:
82 //
83 // Instances of DtIfVrfObjectData are the message content for vrf
84 // object data messages. The purpose of these messages is to convey
85 // essential information about a given vrf object that is beyond the
86 // scope of DIS or the RPR FOM. This message, in combination with the
87 // corresponding entity, aggregate, or environmental PDU/interaction, provides
88 // enough information for a remote VR-Forces process to update an existing
89 // vrf object.
90 //
91 // Content-Type: DtVrfObjectDataMessageType
92 //
95 {
96 public:
97 
98  // default constructor
100 
101  // destructor
102  virtual ~DtIfVrfObjectData();
103 
104  // copy constructor
106 
107  // assignment operator
109 
110  // Returns a newly created instance of a DtIfVrfObjectData.
111  virtual DtSimInterfaceContent * clone() const;
112 
113  // Returns the string type of message, DtVrfObjectResponseMessageType
114  // (defined in msgTypes.h).
115  virtual int type() const;
116 
117  // Set/get the object identifier (site:app:object id) of the vrf object.
118  // Corresponds to entity identifier for individual entities, aggregate Id
119  // for aggregates, and object identifier for environmental process objects.
120  virtual void setObjectIdentifier(const DtEntityIdentifier & objectIdentifier);
121  virtual const DtEntityIdentifier & objectIdentifier() const;
122 
123  // Set/get the session id. This is the id that is used to say whether or not
124  // front ends that are running in a particular session can control these objects
125  virtual void setVrfSessionId(int s);
126  virtual int vrfSessionId() const;
127 
128  // Set/get the message version id. This is the message version of the VRF simulator
129  // that created this object
130  virtual void setVrfMessageVersionSupported(int s);
131  virtual int vrfMessageVersionSupported() const;
132 
133  // Set/get the object label of the vrf object.
134  virtual void setObjectLabel(const DtString & objectLabel);
135  virtual const DtString & objectLabel() const;
136 
137  // Set/get object type
138  virtual void setObjectType(const DtObjectType& objectType);
139  virtual const DtObjectType& objectType() const;
140 
141  virtual void setEchelonIdString(const DtString& echelonId);
142  virtual const DtString& echelonIdString() const;
143 
144  virtual void setIsSubordinateOfForce(bool yesNo);
145  virtual bool isSubordinateOfForce() const;
146 
147  virtual void setIndependentlyTasked(bool yesNo);
148  virtual bool independentlyTasked() const;
149 
150  virtual void setOverlayParent(const DtString& parent);
151  virtual const DtString& overlayParent() const;
152 
153  // Does the entity think its currently under-fire. Default is false.
154  // @{
155  virtual void setUnderFire(bool yesNo);
156  virtual bool underFire() const;
157  // @}
158 
159  // Does the entity have a plan
160  // @{
161  virtual void setHasPlan(bool yesNo);
162  virtual bool hasPlan() const;
163  // @}
164 
165  // Indicates whether the entity is executing its plan or not.
167  virtual void setExecutingPlan(bool yesNo);
168  virtual bool executingPlan() const;
170 
171  // Is the entity currently tasked
172  // @{
173  virtual void setIsCurrentlyTasked(bool yesNo);
174  virtual bool isCurrentlyTasked() const;
175  // @}
176 
177  // The extended data. Used for entities only. Aggregates and environmentals
178  // have their extended data
179  // @{
180  virtual void setExtendedData(const std::map<DtString, DtString>&);
181  virtual void setExtendedData(const DtString& key, const DtString& value);
182  virtual const std::map<DtString, DtString>& extendedData() const;
183  virtual DtString extendedData(const DtString& key) const;
184 
185  // Entities rules of engagement
186  // @{
187  virtual void setRulesOfEngagement(const DtString&);
188  virtual const DtString& rulesOfEngagement() const;
189  // @}
190 
191  // Set when this entity is simulated by a VR-Force back-end. Default is false.
192  // Only the VR-Forces back-end engine should set this value. Do not set this
193  // value to true unless you are planning on handling messages sent by the front-end
194  // that are supported by the VR-Forces back-end in some manner
195  // @{
196  virtual void setVrfSimulated(bool yesNo);
197  virtual bool vrfSimulated() const;
198  // @}
199 
201  //{@
202  virtual void addRangeItem(const DtRangeItem&);
203  virtual void removeRangeItem(int index);
204  virtual void setRangeItems(const DtRangeItems&);
205  const DtRangeItems& rangeItems() const;
207 
211  virtual void setBoundingVolume(const DtVector32&);
212  virtual const DtVector32& boundingVolume() const;
213 
214  virtual void setBoundingVolumeOffset(const DtVector32&);
215  virtual const DtVector32& boundingVolumeOffset() const;
217 
218  virtual char vrfObjectDataVersion() const;
219 
220  virtual int netRepSize() const;
221  virtual bool setFromNet(const char* contentBuffer,
222  unsigned contentSize);
223  virtual bool setToNet();
224 
225  virtual void printDataToString(DtString& str);
226 
227  static DtSimInterfaceContent* creator();
228 
229  bool operator!=(const DtIfVrfObjectData&) const;
230  bool operator==(const DtIfVrfObjectData&) const;
231 
232  // If myDirty flag is true, calls setToNet() before returning buffer. Called
233  // from equality operator
234  virtual char* fillInNetRep();
235 
236 protected:
237  virtual bool parseV1Buffer(const char* contentBuffer,
238  unsigned contentSize);
239  virtual bool parseV2Buffer(const char* contentBuffer,
240  unsigned contentSize);
241  virtual bool parseV3Buffer(const char* contentBuffer,
242  unsigned contentSize);
243 
244 protected:
245 
246  DtEntityIdentifier myObjectIdentifier;
258  bool myHasPlan;
262 
263  // Used for filledInNetRep() method. If myDirty is true, will call
264  // setToNet()
265  bool myDirty;
266 
269 
270  DtVector32 myBoundingVolume;
272 
274 };

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)