![]() |
VR-Link API Documentation for DIS
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 00006 00007 #if DtDIS 00008 00009 00012 00013 #ifndef dGridDataPub_H_ 00014 #define dGridDataPub_H_ 00015 00016 00017 #include "pdu.h" 00018 #include "dObjPub.h" 00019 #include "gridDataSR.h" 00020 #include "dGridDataEnc.h" 00021 #include "dGridDataDec.h" 00022 #include <vlutil/vlPrint.h> 00023 00024 00025 class DT_DLL_VL DtGriddedDataPublisher : public DtObjectPublisher 00026 { 00027 public: 00028 00030 typedef DtGriddedDataRepository* (*DtStateRepCreator)(); 00031 00032 public: 00033 00034 00036 DtGriddedDataPublisher( 00037 DtGriddedDataRepository *stateRepToUse, 00038 DtExerciseConn* conn, 00039 const DtObjectId& id = DtObjectId::defaultId()); 00040 00042 DtGriddedDataPublisher( 00043 DtExerciseConn* conn, 00044 const DtObjectId& id = DtObjectId::defaultId()); 00045 00047 virtual ~DtGriddedDataPublisher(); 00048 00052 virtual void tick(); 00053 00056 virtual DtGriddedDataRepository* gridDataStateRep(); 00057 00059 virtual DtGriddedDataRepository* gdsr(); 00060 00064 virtual DtGriddedDataDecoder* decoder(); 00065 00068 virtual DtGriddedDataEncoder* encoder(); 00069 00071 virtual const DtObjectId& id() const; 00072 00074 virtual const DtObjectId& localId() const; 00075 00077 virtual const DtGlobalObjectDesignator& globalId() const; 00078 00082 virtual void sendFinalPduOnDestruction(bool onOff); 00083 00086 virtual void forceUpdate(); 00087 00088 public: 00089 00091 static void setStateRepCreator(DtStateRepCreator creator); 00092 static DtStateRepCreator stateRepCreator(void); 00093 00094 static void setClassDfltTimeThreshold(DtTime threshold); 00095 00096 protected: 00097 00099 void sendFinalPdu(); 00100 00102 void init( const DtEntityIdentifier& vehId); 00103 00105 DtGriddedDataPublisher(const DtGriddedDataPublisher& orig); 00106 00108 DtGriddedDataPublisher& operator=(const DtGriddedDataPublisher& orig); 00109 00110 protected: 00111 00112 DtObjectId myId; 00113 DtGriddedDataDecoder* myDecoder; 00114 DtGriddedDataEncoder* myEncoder; 00115 bool mySendFinalInDtor; 00116 00117 protected: 00118 static DtStateRepCreator theStateRepCreator; 00119 static DtTime theClassDfltTimeThreshold; 00120 static bool theClassDfltIsSetFlag; 00121 }; 00122 00123 inline DtGriddedDataRepository* DtGriddedDataPublisher::gridDataStateRep() 00124 { 00125 return gdsr(); 00126 } 00127 00128 inline DtGriddedDataRepository* DtGriddedDataPublisher::gdsr() 00129 { 00130 return static_cast<DtGriddedDataRepository*>(myStateRep); 00131 } 00132 00133 inline DtGriddedDataEncoder* DtGriddedDataPublisher::encoder() 00134 { 00135 return myEncoder; 00136 } 00137 00138 inline DtGriddedDataDecoder* DtGriddedDataPublisher::decoder() 00139 { 00140 return myDecoder; 00141 } 00142 00143 inline void DtGriddedDataPublisher::sendFinalPduOnDestruction(bool onOff) 00144 { 00145 mySendFinalInDtor = onOff; 00146 } 00147 00148 inline const DtObjectId& DtGriddedDataPublisher::id() const 00149 { 00150 return myId; 00151 } 00152 00153 inline const DtObjectId& DtGriddedDataPublisher::localId() const 00154 { 00155 return id(); 00156 } 00157 00158 #endif 00159 #endif 00160