![]() |
VR-Link API Documentation for DIS
|
00001 /******************************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 00006 00010 00011 #ifndef dIffPub_H_ 00012 #define dIffPub_H_ 00013 00014 #if DtDIS 00015 00016 00017 #include "dObjPub.h" 00018 #include "hostStructs.h" 00019 #include "iffSR.h" 00020 #include "dIffEnc.h" 00021 #include "dIffDec.h" 00022 00023 00024 class DT_DLL_VL DtIffPublisher; 00025 00026 #ifdef __GNUC__ 00027 #define DT_CANT_USE_STATIC_MEMBER_FCN_AS_DFLT_ARG 1 00028 #endif 00029 00030 #if DT_CANT_USE_STATIC_MEMBER_FCN_AS_DFLT_ARG 00031 00032 00033 static inline const DtObjectId& iffFindOwnId(); 00034 #else 00035 #define iffFindOwnId() DtIffPublisher::findOwnId() 00036 #endif 00037 00041 class DT_DLL_VL DtIffPublisher : public DtObjectPublisher 00042 { 00043 00044 public: 00045 00047 typedef DtIffStateRepository* (*DtStateRepCreator)(); 00048 00049 public: 00050 00052 DtIffPublisher( 00053 DtIffStateRepository *stateRepToUse, 00054 DtExerciseConn* conn, 00055 const DtObjectId& id = iffFindOwnId()); 00056 00058 DtIffPublisher( 00059 DtIffAtcNavaidsSysType type, 00060 DtExerciseConn* conn, 00061 const DtObjectId& id = iffFindOwnId()); 00062 00064 DtIffPublisher( 00065 DtExerciseConn* conn, 00066 const DtObjectId& id = iffFindOwnId()); 00067 00069 DtIffPublisher( 00070 DtExerciseConn* conn, 00071 const char* name, 00072 const DtObjectId& id = iffFindOwnId()); 00073 00075 virtual ~DtIffPublisher(); 00076 00077 00079 virtual void tick(); 00080 00083 virtual void forceUpdate(); 00084 00086 virtual DtIffStateRepository* iffStateRep(); 00087 virtual DtIffStateRepository* isr(); 00088 00090 virtual const DtObjectId& id() const; 00091 00093 virtual const DtObjectId& localId() const; 00094 00096 virtual const DtGlobalObjectDesignator& globalId() const; 00097 00098 public: 00099 00101 static void setStateRepCreator(DtStateRepCreator creator); 00102 static DtStateRepCreator stateRepCreator(void); 00103 00104 static void setClassDfltTimeThreshold(DtTime threshold); 00105 00107 static const DtObjectId& findOwnId(); 00108 00109 protected: 00110 00112 void init(const char* name, 00113 const DtEntityIdentifier& id); 00114 00116 DtIffPublisher(const DtIffPublisher& orig); 00117 00119 DtIffPublisher& operator=(const DtIffPublisher& orig); 00120 protected: 00121 00122 DtObjectId myId; 00123 DtIffStateDecoder* myIffDecoder; 00124 DtIffStateEncoder* myIffEncoder; 00125 00126 protected: 00127 static DtStateRepCreator theStateRepCreator; 00128 static DtTime theClassDfltTimeThreshold; 00129 static bool theClassDfltIsSetFlag; 00130 char *myName; 00131 }; 00132 00133 inline DtIffStateRepository* DtIffPublisher::isr() 00134 { 00135 return static_cast<DtIffStateRepository*>(myStateRep); 00136 } 00137 00138 inline const DtObjectId& DtIffPublisher::localId() const 00139 { 00140 return id(); 00141 } 00142 00143 #if DT_CANT_USE_STATIC_MEMBER_FCN_AS_DFLT_ARG 00144 inline const DtObjectId& iffFindOwnId() 00145 { 00146 return DtIffPublisher::findOwnId(); 00147 } 00148 #else 00149 #undef iffFindOwnId 00150 #endif 00151 00152 00153 #endif 00154 #endif 00155