![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 2003 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: reflCtrlObj.h,v $ $Revision: 1.10 $ $State: Exp $ 00007 *********************************************************************/ 00008 00009 #ifndef REFLCTRLOBJ_H 00010 #define REFLCTRLOBJ_H 00011 00012 #if DtHLA 00013 #include <vl/hReflectedObj.h> 00014 #define DtCOReflectedObjectType DtReflectedObject 00015 #elif DtDIS 00016 #include <vl/dReflEnvProc.h> 00017 #define DtCOReflectedObjectType DtReflectedEnvironmentProcess 00018 #elif DtTENA 00019 #include <vl/tReflEnvProc.h> 00020 #define DtCOReflectedObjectType DtReflectedEnvironmentProcess 00021 #else 00022 # pragma message ( "No protocol defined." ) 00023 #endif 00024 00025 #include <vrfExtObjects/controlObjSR.h> 00026 00027 // Callback function that takes a DtReflectedControlObject 00028 // and usr data. 00029 00030 class DtReflectedControlObject; 00031 00032 typedef void (*DtControlObjectCallbackFunction) 00033 ( 00034 DtReflectedControlObject* obj, void* userData 00035 ); 00036 00037 class DtExerciseConn; 00038 00039 #include <vrfExtObjects/vrfExtObjectsDefines.h> 00040 class DT_DLL_vrfExtObjects DtReflectedControlObject : public DtCOReflectedObjectType 00041 { 00042 public: 00043 #if DtHLA 00044 // constructor 00045 DtReflectedControlObject(DtHlaObject* obj, DtExerciseConn* conn); 00046 #elif (DtDIS || DtTENA) 00047 // constructor 00048 DtReflectedControlObject 00049 ( 00050 DtExerciseConn* conn, 00051 const DtEntityIdentifier& id, 00052 const DtEntityType& type 00053 ); 00054 #else 00055 # pragma message ( "No protocol defined." ) 00056 #endif 00057 00058 // destructor 00059 virtual ~DtReflectedControlObject(); 00060 00061 // Returns ptr to environmentProcessStateRepository -- 00062 // through which you can inspect current state info. 00063 virtual DtControlObjectRepository* controlObjectStateRep() const; 00064 00065 // Synonym for environmentStateRep. 00066 virtual DtControlObjectRepository* cosr() const; 00067 00068 // Implementation for abstract base class. Calls cosr(). 00069 virtual DtStateRepository* stateRep() const; 00070 00071 #if DtDIS 00072 // Process an environment process state PDU. 00073 // Calls processEnvironmentProcess(). 00074 virtual void processStateMessage(const DtStateMsg& msg); 00075 #endif 00076 00077 // Get the next and previous elements in the reflected 00078 // cwenvironment process list. 00079 virtual DtReflectedControlObject* nextCO() const; 00080 virtual DtReflectedControlObject* prevCO() const; 00081 00082 // Get the next and previous elements, wrap at the ends of the list. 00083 virtual DtReflectedControlObject* wrapNextCO() const; 00084 virtual DtReflectedControlObject* wrapPrevCO() const; 00085 00086 // Environment Process callback registration/deregistration. 00087 virtual void addPostUpdateCallback 00088 ( 00089 DtControlObjectCallbackFunction cb, void* userData 00090 ); 00091 virtual void removePostUpdateCallback 00092 ( 00093 DtControlObjectCallbackFunction cb, void* userData 00094 ); 00095 00096 static void postUpdateCallback 00097 ( 00098 DtReflectedControlObject* obj, void* userData 00099 ); 00100 00101 virtual void processPostUpdateCallback(DtReflectedControlObject* obj); 00102 00103 // updateExtensions() 00104 // extracts the extended environmental process state information, 00105 // if present, from the state repository 00106 virtual void updateExtensions(); 00107 00108 private: 00109 // not implemented. 00110 DtReflectedControlObject(const DtReflectedControlObject& orig); 00111 DtReflectedControlObject& operator=(const DtReflectedControlObject& orig); 00112 00113 }; 00114 00115 #endif