![]() |
VR-Link API Documentation for HLA 1.3
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 00006 00007 #ifndef DtHlaObjectWithStateRep_H_ 00008 #define DtHlaObjectWithStateRep_H_ 00009 00010 #if DtHLA 00011 00012 00013 #include "hlaObj.h" 00014 00018 00019 class DT_DLL_VL DtHlaStateEncoder; 00020 class DT_DLL_VL DtHlaStateDecoder; 00021 class DT_DLL_VL DtStateRepository; 00022 00027 00028 class DT_DLL_VL DtHlaObjectWithStateRep : public DtHlaObject 00029 { 00030 public: 00031 00033 DtHlaObjectWithStateRep(DtExerciseConn* conn, 00034 #if DtHLA_1516 00035 RTI::ObjectInstanceHandle id, 00036 #else 00037 RTI::ObjectHandle id, 00038 #endif 00039 const char* name, 00040 DtObjClassDesc &classDesc, 00041 bool reflecting); 00043 DtHlaObjectWithStateRep(DtExerciseConn* conn, 00044 const char* name, 00045 DtObjClassDesc &classDesc, 00046 bool reflecting); 00047 00049 virtual ~DtHlaObjectWithStateRep(); 00050 00054 00058 virtual void useTheseForUpdating(DtStateRepository* stateRep, 00059 DtStateRepository* asSeenByRemote, 00060 DtHlaStateEncoder* encoder, 00061 DtHlaStateDecoder* decoder); 00062 00069 virtual void generateUpdate( 00070 const RTI::AttributeHandleSet& eligibleAttrs, 00071 const RTI::AttributeHandleSet& requiredAttrs, 00072 DtStateMsg* stateMsg); 00073 00075 virtual DtStateRepository* stateRepForUpdating() const; 00076 00081 virtual DtStateRepository* stateRepForReflecting() const; 00082 00083 00085 virtual DtStateRepository* asSeenByRemote() const; 00086 00090 00093 virtual void useTheseForReflecting(DtStateRepository* stateRep, 00094 DtHlaStateDecoder* decoder); 00095 00097 virtual void stopUsingTheseForReflecting( 00098 DtStateRepository* stateRep, 00099 DtHlaStateDecoder* decoder); 00100 00107 virtual void reflect(const DtStateMsg& stateMsg); 00108 00112 virtual void reflectLocal(const DtStateMsg& stateMsg); 00113 00117 virtual void printMsg(const DtStateMsg& msg, bool fullReport) const; 00118 00119 public: 00120 00122 static inline DtHlaObject* create(DtExerciseConn* conn, 00123 #if DtHLA_1516 00124 RTI::ObjectInstanceHandle id, 00125 #else 00126 RTI::ObjectHandle id, 00127 #endif 00128 const char* name, 00129 DtObjClassDesc &classDesc, 00130 bool reflecting); 00131 00132 protected: 00133 00135 DtHlaObjectWithStateRep(const DtHlaObjectWithStateRep& orig); 00136 00138 DtHlaObjectWithStateRep& operator=(const DtHlaObjectWithStateRep& orig); 00139 00140 protected: 00141 00143 DtHlaStateDecoder* myDecoder; 00144 DtHlaStateEncoder* myEncoder; 00145 DtStateRepository* myStateRepForUpdating; 00146 DtStateRepository* myAsSeenByRemote; 00147 00150 DtList myDecList; 00151 }; 00152 00153 inline DtHlaObject* DtHlaObjectWithStateRep::create( 00154 DtExerciseConn* conn, 00155 #if DtHLA_1516 00156 RTI::ObjectInstanceHandle id, 00157 #else 00158 RTI::ObjectHandle id, 00159 #endif 00160 const char* a_name, 00161 DtObjClassDesc &classDesc, 00162 bool reflecting) 00163 { 00164 return new DtHlaObjectWithStateRep(conn, id, a_name, classDesc, reflecting); 00165 } 00166 00167 inline DtStateRepository* 00168 DtHlaObjectWithStateRep::stateRepForUpdating() const 00169 { 00170 return myStateRepForUpdating; 00171 } 00172 00173 inline DtStateRepository* 00174 DtHlaObjectWithStateRep::asSeenByRemote() const 00175 { 00176 return myAsSeenByRemote; 00177 } 00178 00179 #endif 00180 #endif 00181