![]() |
VR-Link API Documentation for DIS
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 00006 00009 00010 #ifndef hDtStateMsg_H_ 00011 #define hDtStateMsg_H_ 00012 00013 #if DtHLA 00014 00015 00016 #include <vlutil/vlTimeStampType.h> 00017 00018 #include <vlutil/vlString.h> 00019 #include <vlutil/vlTime.h> 00020 #include "rtiNamespace.h" 00021 #include <vl/region.h> 00022 00023 00024 class DT_DLL_VL DtHlaObject; 00025 class DT_DLL_VL DtExerciseConn; 00026 00027 00032 00033 class DT_DLL_VL DtStateMsg 00034 { 00035 public: 00036 00037 00039 DtStateMsg( 00040 objHandle id, 00041 const HandleValueMap& attrs 00042 ); 00043 00045 DtStateMsg( 00046 objHandle id, 00047 HandleValueMap* attrs 00048 ); 00049 00050 00052 virtual ~DtStateMsg(); 00053 00055 DtStateMsg(const DtStateMsg& orig); 00056 00058 DtStateMsg& operator=(const DtStateMsg& orig); 00059 00061 virtual objHandle objectId() const; 00062 00064 virtual const HandleValueMap& handleMap() const; 00065 00067 virtual HandleValueMap* handleMap(); 00068 00069 #if DtHLA_1516 00070 00072 virtual void setTag(const RTI::VariableLengthData& tag); 00073 virtual void setCustomTag(const RTI::VariableLengthData& tag); 00074 virtual const RTI::VariableLengthData& tag() const; 00075 00076 #if DtHLA_1516_EVOLVED 00077 00078 00079 00080 virtual const DtString& producingFederate() const; 00081 00084 virtual void setProducingFederate(const DtString& fedHandle); 00085 #endif 00086 #else 00087 00089 virtual void setTag(const DtString& tag); 00090 virtual void setCustomTag(const DtString& tag); 00091 virtual const DtString& tag() const; 00092 00093 #endif 00094 00096 virtual bool customTagSet() const; 00097 00099 virtual void print(DtExerciseConn* exConn, 00100 RTI::ObjectClassHandle h) const; 00101 00103 virtual void printToStream(std::ostream& stream,DtExerciseConn* exConn, 00104 RTI::ObjectClassHandle h) const; 00105 00107 virtual void printHeader(DtExerciseConn* exConn, 00108 RTI::ObjectClassHandle classHandle) const; 00109 00111 virtual void printHeaderToStream(std::ostream& stream, DtExerciseConn* exConn, 00112 RTI::ObjectClassHandle classHandle) const; 00113 00115 virtual void printAttrs(DtExerciseConn* exConn, 00116 RTI::ObjectClassHandle classHandle, int withHex) const; 00117 00119 virtual void printAttrsToStream(std::ostream& stream, DtExerciseConn* exConn, 00120 RTI::ObjectClassHandle classHandle, int withHex) const; 00121 00123 virtual void print(DtHlaObject *obj, 00124 bool fullReport = true) const; 00125 00126 00127 00131 virtual void setTimeStamp(DtTime time, 00132 DtTimeStampType type = DtTimeStampRelative); 00133 00136 virtual DtTime timeStamp() const; 00137 00139 virtual DtTimeStampType timeStampType() const; 00140 00145 virtual DtTime guessTimeValid(DtTime referenceTime) const; 00146 00148 00149 #if DtHLA_1516 00150 virtual const std::set<DtDDMRegion>* region() const; 00151 virtual void setRegion(const std::set<DtDDMRegion>& regions); 00152 #else 00153 virtual const DtDDMRegion* region() const; 00154 virtual void setRegion(const DtDDMRegion& region); 00155 #endif 00156 00157 00158 public: 00159 00163 static void setTagIsAsciiTime(bool val); 00164 static bool tagIsAsciiTime(); 00165 00166 protected: 00167 00168 #if DtHLA_1516 00169 HandleValueMap* myAvList; 00170 objHandle myId; 00171 RTI::VariableLengthData myTag; 00172 #if DtHLA_1516_EVOLVED 00173 DtString myProducingFederateName; 00174 #endif 00175 #else 00176 HandleValueMap* myAvList; 00177 DtString myTag; 00178 objHandle myId; 00179 #endif 00180 DtTime myTime; 00181 DtTimeStampType myTimeType; 00182 bool myCustomTagSet; 00183 00184 #if DtHLA_1516 00185 // 1516 00186 std::set<DtDDMRegion>* myRegion; 00187 #else 00188 // 13 00189 DtDDMRegion* myRegion; 00190 #endif 00191 00192 00193 protected: 00194 00195 static bool theTagIsAsciiTime; 00196 }; 00197 00198 inline const HandleValueMap& DtStateMsg::handleMap() const 00199 { 00200 return *myAvList; 00201 } 00202 00203 inline HandleValueMap* DtStateMsg::handleMap() 00204 { 00205 return myAvList; 00206 } 00207 00208 00209 inline objHandle DtStateMsg::objectId() const 00210 { 00211 return myId; 00212 } 00213 00214 #endif 00215 #endif 00216