![]() |
VR-Link API Documentation for DIS
|
00001 //******************************************************************** 00004 //******************************************************************** 00005 //******************************************************************** 00007 //******************************************************************** 00008 #ifndef tAmoInterface_H_ 00009 #define tAmoInterface_H_ 00010 00014 00015 #if DtTENA 00016 00017 #include "coLromMapExport.h" 00018 #include <vlutil/vlMachineTypes.h> 00019 #include <vl/tObjectInterface.h> 00020 #include <vl/amoSR.h> 00021 #include <vl/globalObjDes.h> 00022 00023 #include <TENA/AMO/ServantPtr.h> 00024 #include <TENA/AMO/ProxyPtr.h> 00025 #include <TENA/AMO/ImmutablePublicationStatePtr.h> 00026 #include <TENA/AMO/SubscriptionInfoPtr.h> 00027 #include <TENA/UniqueID/Includes.h> 00028 00029 #include <map> 00030 #include <list> 00031 00037 class DT_DLL_COMMONLROM DtAmoInterface: public DtObjectInterface 00038 { 00039 protected: 00040 00043 class DtAmoServantObject : public DtTenaServantObject 00044 { 00045 public: 00047 DtAmoServantObject( TENA::AMO::ServantPtr sp):myServantPtr(sp){} 00048 00050 virtual ~DtAmoServantObject() {} 00051 00053 virtual const TENA::AMO::ServantPtr servant() const { return myServantPtr;} 00054 00056 virtual TENA::AMO::ServantPtr servant() { return myServantPtr;} 00057 00058 protected: 00059 TENA::AMO::ServantPtr myServantPtr; 00060 }; 00061 00062 public: 00064 DtAmoInterface(DtExerciseConn* exConn); 00065 00067 virtual ~DtAmoInterface(); 00068 00069 private: 00071 DtAmoInterface(const DtAmoInterface &other); 00072 00074 DtAmoInterface& operator=(const DtAmoInterface &other); 00075 00076 public: 00077 00080 virtual DtTenaServantObject* createServantObject(DtExerciseConn* exConn); 00081 00083 virtual void processServantCleanup(DtTenaServantObject* servantObject); 00084 00086 virtual void subscribe(); 00087 00089 virtual bool needUpdate(const DtStateRepository& stateRep, 00090 const DtStateRepository& asSeenByRemote, 00091 bool useThresholding = true); 00092 00094 virtual void decode(const DtTenaServantObject* servant, 00095 DtStateRepository* stateRep)const; 00096 00098 virtual void encode(DtTenaServantObject* servant, 00099 const DtStateRepository* stateRep, 00100 TENA::Time::Pointer timeForStamping, 00101 bool forceUpdate = false); 00102 00104 virtual DtReflectedObject *createReflectedObject()const; 00105 00107 virtual void processAddition(TENA::AMO::ProxyPtr const &proxy); 00108 00110 virtual void processUpdate(TENA::AMO::ProxyPtr const &proxy); 00111 00113 virtual void processRemoval(TENA::AMO::ProxyPtr const &proxy); 00114 00115 00116 protected: 00118 virtual void decode(const TENA::AMO::ImmutablePublicationStatePtr pubStatePtr, 00119 DtStateRepository* stateRep)const; 00120 00121 protected: 00122 00124 TENA::AMO::SubscriptionInfoPtr mySubscriptionInfoPtr; 00125 typedef std::map<TENA::AMO::ProxyPtr, DtReflectedObject *> ProxyToRefObjMap; 00126 ProxyToRefObjMap myRefAmoMap; 00127 ProxyToRefObjMap myAmoWaitList; 00128 }; 00129 00130 00131 #endif 00132 #endif 00133 00134 00135