![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2003 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: ifVrfObjData.h,v $ $Revision: 1.16 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00009 #ifndef DtIfVrfObjectData_H_ 00010 #define DtIfVrfObjectData_H_ 00011 00012 #include <vrfExtProtocol/ifaceCont.h> 00013 #include <vlutil/vlString.h> 00014 #include <vrfExtProtocol/objType.h> 00015 #include <vrfExtProtocol/rangeItem.h> 00016 #include <vlpi/disEnums.h> 00017 #include <vl/globalObjDes.h> 00018 00019 const unsigned char DtVrfObjectDataVersion = 6; 00020 00021 struct DtNetIfVrfObjectData_V1 00022 { 00023 DtNetEntityIdentifier myObjectIdentifier;// 48 bytes 00024 DtNetEntityType myEntityType; // 8 bytes 00025 DtNetU8 mySuperType; // 1 byte 00026 DtNetU8 myLabelLength; // 1 byte 00027 DtNetU8 myEchelonIdLength; // 1 bytes 00028 DtNetBoolean myIsSubordinateOfForce; // 1 byte 00029 // DtNetU32 myPadding2; // 4 bytes 00030 }; // Total: 64 bytes 00031 00032 struct DtNetIfVrfObjectData_V2 00033 { 00034 DtNetEntityIdentifier myObjectIdentifier; // 48 bytes 00035 DtNetEntityType myEntityType; // 8 bytes 00036 DtNetU8 mySuperType; // 1 byte 00037 DtNetU8 myLabelLength; // 1 byte 00038 DtNetU8 myEchelonIdLength; // 1 bytes 00039 DtNetBoolean myIsSubordinateOfForce; // 1 byte 00040 DtNetBoolean myIndependentlyTasked; // 1 byte 00041 DtNetU32 myPadding1; // 4 bytes 00042 }; // Total: 64 bytes 00043 00044 struct DtNetIfVrfObjectData_V3 00045 { 00046 DtNetEntityIdentifier myObjectIdentifier; // 6 bytes 00047 DtNetEntityType myEntityType; // 8 bytes 00048 DtNetU8 mySuperType; // 1 byte 00049 DtNetU8 myLabelLength; // 1 byte 00050 DtNetU8 myEchelonIdLength; // 1 bytes 00051 DtNetBoolean myIsSubordinateOfForce; // 1 byte 00052 DtNetBoolean myIndependentlyTasked; // 1 byte 00053 DtNetU8 myVrfObjectDataVersion; // 1 byte 00054 DtNetU8 myOverlayParentLength; // 1 byte 00055 DtNetBoolean myUnderFire; // 1 bytes 00056 }; // Total: 22 bytes 00057 00058 struct DtNetIfVrfObjectData 00059 { 00060 DtNetEntityIdentifier myObjectIdentifier; // 6 bytes 00061 DtNetEntityType myEntityType; // 8 bytes 00062 DtNetU8 mySuperType; // 1 byte 00063 DtNetU8 myLabelLength; // 1 byte 00064 DtNetU8 myEchelonIdLength; // 1 bytes 00065 DtNetBoolean myIsSubordinateOfForce; // 1 byte 00066 DtNetBoolean myIndependentlyTasked; // 1 byte 00067 DtNetU8 myVrfObjectDataVersion; // 1 byte 00068 DtNetU8 myOverlayParentLength; // 1 byte 00069 DtNetBoolean myUnderFire; // 1 byte 00070 DtNetBoolean myVrfSimulated; // 1 byte 00071 DtNetU32 myVrfSessionId; // 4 bytes 00072 // Added version 4 of PDU 00073 DtNetU32 myVrfMessageVersionSupported; // 4 bytes 00074 DtNetBoolean myHasPlan; // 1 byte 00075 DtNetU8 myRulesOfEngagementLength; // 1 byte 00076 DtNetBoolean myIsCurrentlyTasked; // 1 bytes 00077 DtNetBoolean myExecutingPlan; // 1 byte 00078 DtNetU16 myPadding1; // 2 bytes 00079 DtNetU8 myPadding2; // 1 byte 00080 DtNetU8 myPadding3; // 1 byte 00081 DtNetU8 myPadding4; // 1 byte 00082 }; // Total: 40 bytes 00083 00084 // class DtIfVrfObjectData: 00085 // 00086 // Instances of DtIfVrfObjectData are the message content for vrf 00087 // object data messages. The purpose of these messages is to convey 00088 // essential information about a given vrf object that is beyond the 00089 // scope of DIS or the RPR FOM. This message, in combination with the 00090 // corresponding entity, aggregate, or environmental PDU/interaction, provides 00091 // enough information for a remote VR-Forces process to update an existing 00092 // vrf object. 00093 // 00094 // Content-Type: DtVrfObjectDataMessageType 00095 // 00096 #include <vrfExtProtocol/vrfExtProtocolDefines.h> 00097 class DT_DLL_vrfExtProtocol DtIfVrfObjectData : public DtSimInterfaceContent 00098 { 00099 public: 00100 00101 // default constructor 00102 DtIfVrfObjectData(); 00103 00104 // destructor 00105 virtual ~DtIfVrfObjectData(); 00106 00107 // copy constructor 00108 DtIfVrfObjectData(const DtIfVrfObjectData& orig); 00109 00110 // assignment operator 00111 DtIfVrfObjectData& operator=(const DtIfVrfObjectData& orig); 00112 00113 // Returns a newly created instance of a DtIfVrfObjectData. 00114 virtual DtSimInterfaceContent * clone() const; 00115 00116 // Returns the string type of message, DtVrfObjectResponseMessageType 00117 // (defined in msgTypes.h). 00118 virtual int type() const; 00119 00120 // Set/get the object identifier (site:app:object id) of the vrf object. 00121 // Corresponds to entity identifier for individual entities, aggregate Id 00122 // for aggregates, and object identifier for environmental process objects. 00123 virtual void setObjectIdentifier(const DtEntityIdentifier & objectIdentifier); 00124 virtual const DtEntityIdentifier & objectIdentifier() const; 00125 00126 // Set/get the session id. This is the id that is used to say whether or not 00127 // front ends that are running in a particular session can control these objects 00128 virtual void setVrfSessionId(int s); 00129 virtual int vrfSessionId() const; 00130 00131 // Set/get the message version id. This is the message version of the VRF simulator 00132 // that created this object 00133 virtual void setVrfMessageVersionSupported(int s); 00134 virtual int vrfMessageVersionSupported() const; 00135 00136 // Set/get the object label of the vrf object. 00137 virtual void setObjectLabel(const DtString & objectLabel); 00138 virtual const DtString & objectLabel() const; 00139 00140 // Set/get object type 00141 virtual void setObjectType(const DtObjectType& objectType); 00142 virtual const DtObjectType& objectType() const; 00143 00144 virtual void setEchelonIdString(const DtString& echelonId); 00145 virtual const DtString& echelonIdString() const; 00146 00147 virtual void setIsSubordinateOfForce(bool yesNo); 00148 virtual bool isSubordinateOfForce() const; 00149 00150 virtual void setIndependentlyTasked(bool yesNo); 00151 virtual bool independentlyTasked() const; 00152 00153 virtual void setOverlayParent(const DtString& parent); 00154 virtual const DtString& overlayParent() const; 00155 00156 // Does the entity think its currently under-fire. Default is false. 00157 // @{ 00158 virtual void setUnderFire(bool yesNo); 00159 virtual bool underFire() const; 00160 // @} 00161 00162 // Does the entity have a plan 00163 // @{ 00164 virtual void setHasPlan(bool yesNo); 00165 virtual bool hasPlan() const; 00166 // @} 00167 00168 // Indicates whether the entity is executing its plan or not. 00170 virtual void setExecutingPlan(bool yesNo); 00171 virtual bool executingPlan() const; 00173 00174 // Is the entity currently tasked 00175 // @{ 00176 virtual void setIsCurrentlyTasked(bool yesNo); 00177 virtual bool isCurrentlyTasked() const; 00178 // @} 00179 00180 // Entities rules of engagement 00181 // @{ 00182 virtual void setRulesOfEngagement(const DtString&); 00183 virtual const DtString& rulesOfEngagement() const; 00184 // @} 00185 00186 // Set when this entity is simulated by a VR-Force back-end. Default is false. 00187 // Only the VR-Forces back-end engine should set this value. Do not set this 00188 // value to true unless you are planning on handling messages sent by the front-end 00189 // that are supported by the VR-Forces back-end in some manner 00190 // @{ 00191 virtual void setVrfSimulated(bool yesNo); 00192 virtual bool vrfSimulated() const; 00193 // @} 00194 00196 //{@ 00197 virtual void addRangeItem(const DtRangeItem&); 00198 virtual void removeRangeItem(int index); 00199 virtual void setRangeItems(const DtRangeItems&); 00200 const DtRangeItems& rangeItems() const; 00202 00206 virtual void setBoundingVolume(const DtVector&); 00207 virtual const DtVector& boundingVolume() const; 00208 00209 virtual void setBoundingVolumeOffset(const DtVector&); 00210 virtual const DtVector& boundingVolumeOffset() const; 00212 00213 virtual char vrfObjectDataVersion() const; 00214 00215 virtual int netRepSize() const; 00216 virtual bool setFromNet(const char* contentBuffer, 00217 unsigned contentSize); 00218 virtual bool setToNet(); 00219 00220 virtual void printDataToString(DtString& str); 00221 00222 static DtSimInterfaceContent* creator(); 00223 00224 bool operator!=(const DtIfVrfObjectData&) const; 00225 bool operator==(const DtIfVrfObjectData&) const; 00226 00227 // If myDirty flag is true, calls setToNet() before returning buffer. Called 00228 // from equality operator 00229 virtual char* fillInNetRep(); 00230 00231 protected: 00232 virtual bool parseV1Buffer(const char* contentBuffer, 00233 unsigned contentSize); 00234 virtual bool parseV2Buffer(const char* contentBuffer, 00235 unsigned contentSize); 00236 virtual bool parseV3Buffer(const char* contentBuffer, 00237 unsigned contentSize); 00238 00239 protected: 00240 00241 DtEntityIdentifier myObjectIdentifier; 00242 DtObjectType myObjectType; 00243 DtString myObjectLabel; 00244 DtString myEchelonIdString; 00245 DtString myOverlayParent; 00246 int myVrfSessionId; 00247 int myVrfMessageVersionSupported; 00248 bool myIsSubordinateOfForce; 00249 bool myIndependentlyTasked; 00250 char myVrfObjectDataVersion; 00251 bool myUnderFire; 00252 bool myVrfSimulated; 00253 bool myHasPlan; 00254 bool myExecutingPlan; 00255 bool myIsCurrentlyTasked; 00256 DtString myRulesOfEngagement; 00257 00258 // Used for filledInNetRep() method. If myDirty is true, will call 00259 // setToNet() 00260 bool myDirty; 00261 00262 DtRangeItems myRangeItems; 00263 00264 DtVector myBoundingVolume; 00265 DtVector myBoundingVolumeOffset; 00266 }; 00267 00268 #endif