VR-Link API Documentation for HLA 1516
hReflectedObj.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *********************************************************************/
00005 
00006 
00007 #if DtHLA 
00008 
00009 #ifndef DtHlaReflectedObject_H_
00010 #define DtHlaReflectedObject_H_
00011 
00012 
00013 #include "globalObjDes.h"
00014 #include "hlaObjWithSR.h"
00015 #include "refObjCbInfo.h"
00016 #include "objectId.h"
00017 
00022 
00023 class DT_DLL_VL DtStateRepository;
00024 class DT_DLL_VL DtExerciseConn;
00025 class DT_DLL_VL DtHlaStateDecoder;
00026 class DT_DLL_VL DtStateMsg;
00027 class DT_DLL_VL DtReflectedObject;
00028 
00034 
00035 class DT_DLL_VL DtReflectedObject : public DtListedObj
00036 {
00037 
00038 public:
00039 
00041    typedef DtStateRepository* (*DtBaseStateRepCreator)();
00042 
00043 public:
00044 
00046    DtReflectedObject(DtExerciseConn* conn, 
00047       DtStateRepository* stateRep);
00048 
00051    DtReflectedObject(DtHlaObject* obj, 
00052       DtExerciseConn* conn, DtBaseStateRepCreator creator);
00053 
00056    DtReflectedObject(const DtObjectId& id, 
00057       const DtGlobalObjectDesignator& des,
00058       DtExerciseConn* conn, DtBaseStateRepCreator creator);
00059 
00061    virtual ~DtReflectedObject();
00062 
00065    virtual DtStateRepository* stateRep() const;
00066 
00068    virtual DtStateRepository* sr() const;
00069 
00072    virtual DtHlaStateDecoder* decoder();
00073 
00076    virtual DtHlaObjectWithStateRep* hlaObject() const;
00077 
00079    virtual const DtObjectId& objectId() const;
00080 
00082    virtual const DtObjectId& id() const;
00083 
00085    virtual const DtObjectId& localId() const;
00086 
00088    virtual const DtString& name() const;
00089 
00092    virtual const DtGlobalObjectDesignator& globalId() const;
00093 
00094 #if DtHLA_1516_EVOLVED
00095 
00096 
00097 
00098    virtual const DtString& lastProducingFederate() const;
00099 #endif
00100 
00101 #if DtHLA_1516
00102 
00103 
00104 
00105 
00106    virtual const std::set<DtDDMRegion>& lastRegionInformation() const;
00107 #endif
00108 
00111    virtual DtTime lastSimTimeUpdated() const;
00112 
00113 
00116    virtual DtTime lastReceivedTimeStamp() const;
00117 
00119    virtual void baseAddPostUpdateCallback(
00120       DtReflectedObjectCallbackFunction cb, void* userData);
00121    virtual void baseRemovePostUpdateCallback(
00122       DtReflectedObjectCallbackFunction cb, void* userData);
00123 
00125    virtual DtReflectedObject* nextObj() const;
00126 
00128    virtual DtReflectedObject* prevObj() const;
00129 
00132    virtual DtReflectedObject* wrapNextObj() const;
00133 
00136    virtual DtReflectedObject* wrapPrevObj() const;
00137 
00142    void setHlaObject(DtHlaObject* obj, 
00143       DtHlaStateDecoder* decoder = NULL);
00144 
00147    virtual void setNoHlaObject(const DtObjectId& id,
00148       const DtGlobalObjectDesignator& des);
00149    
00152    void detachHlaObject();
00153 
00155    virtual void requestUpdate();
00156 
00157 protected:
00158 
00160    DtReflectedObject(const DtReflectedObject& orig);
00161 
00163    DtReflectedObject& operator=(const DtReflectedObject& orig);
00164 
00166    virtual void processPostUpdateCallbacks();
00167 
00168 protected:
00169 
00171    static void requestUpdatePostDrainCb(void* usr);
00172 
00174    static void processPostUpdateCallbacksCb(
00175       const DtStateMsg& stateMsg, 
00176       DtHlaObject* obj,
00177       void* usr);
00178 
00179 protected:
00180 
00181    DtExerciseConn* myExConn;
00182    DtHlaObjectWithStateRep* myHlaObj;
00183    DtStateRepository* myStateRep;
00184    DtHlaStateDecoder* myDecoder;
00185    bool myRequestCbRegistered;
00186    DtIntrusiveList myStateUpdateCallbacks;
00187    DtObjectId myId;
00188    DtString myName;
00189 };
00190 
00191 
00192 inline const DtObjectId& DtReflectedObject::localId() const
00193 {
00194    return id();
00195 }
00196 
00197 inline DtStateRepository* DtReflectedObject::stateRep() const
00198 {
00199    return myStateRep;
00200 }
00201 
00202 inline DtStateRepository* DtReflectedObject::sr() const
00203 {
00204    return myStateRep;
00205 }
00206 
00207 inline DtHlaObjectWithStateRep* DtReflectedObject::hlaObject() const
00208 {
00209    return myHlaObj;
00210 }
00211 
00212 inline DtReflectedObject* DtReflectedObject::nextObj() const
00213 { 
00214    return (DtReflectedObject*) DtListedObj::next(); 
00215 }
00216 
00217 inline DtReflectedObject* DtReflectedObject::prevObj() const
00218 { 
00219    return (DtReflectedObject*) DtListedObj::prev(); 
00220 }
00221 
00222 inline DtReflectedObject* DtReflectedObject::wrapNextObj() const
00223 { 
00224    return (DtReflectedObject*) DtListedObj::wrapNext(); 
00225 }
00226 
00227 inline DtReflectedObject* DtReflectedObject::wrapPrevObj() const
00228 { 
00229    return (DtReflectedObject*) DtListedObj::wrapPrev(); 
00230 }
00231 
00232 #endif
00233 #endif
00234 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)