VR-Link API Documentation for DIS
dObjPub.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *********************************************************************/
00005 
00009 
00010 #if DtDIS 
00011 
00012 
00013 #ifndef DtDISObjectPublisher_H_
00014 #define DtDISObjectPublisher_H_
00015 
00016 
00017 #include <vlutil/vlMachineTypes.h>
00018 #include "objectId.h"
00019 #include <vlutil/vlTime.h>
00020 
00021 class DT_DLL_VL DtStateRepository;
00022 class DT_DLL_VL DtExerciseConn;
00023 class DT_DLL_VL DtPdu;
00024 
00030 class DT_DLL_VL DtObjectPublisher
00031 {
00032 public:
00033 
00039    DtObjectPublisher(DtExerciseConn* conn,
00040       DtStateRepository* stateRep,
00041       DtStateRepository* asSeenByRemote, 
00042       bool okToDeleteStateRep = true);
00043 
00045    virtual ~DtObjectPublisher();
00046 
00047 private:
00048 
00050    DtObjectPublisher(const DtObjectPublisher& orig);
00051 
00053    DtObjectPublisher& operator= (const DtObjectPublisher& orig);
00054 
00055 public:
00056    
00059    virtual DtStateRepository* stateRep();
00060 
00063    virtual DtStateRepository* sr();
00064 
00066    virtual DtExerciseConn* exerciseConn();
00067 
00069    virtual const DtObjectId& localId() const = 0;
00071    virtual const DtObjectId& id() const = 0;
00073    virtual const DtGlobalObjectDesignator& globalId() const = 0;
00074 
00076    virtual void forceUpdate()=0;
00077 
00079    virtual void tick() = 0;
00080 
00083    virtual void setTimeThreshold(DtTime time);
00085    virtual DtTime timeThreshold() const; 
00086 
00091    virtual DtStateRepository* approximateRemoteStateRep();
00092 
00095    virtual DtTime lastTimeUpdated() const;
00096 
00099    virtual DtTime lastSimTimeUpdated() const;
00100 
00101 public:
00102 
00107    static void setDfltTimeThreshold(DtTime time);
00108 
00110    static DtTime dfltTimeThreshold();
00111 
00112 protected:
00113 
00114 
00116    void send(DtPdu* pdu) const;
00117 
00118 
00119 protected:
00120 
00121    DtExerciseConn    *myExConn;
00122    DtStateRepository *myStateRep;
00123    DtStateRepository *myAsSeenByRemote;
00124    bool               myOkToDeleteStateRepFlag;
00125 
00126    DtTime             myTimeThreshold;
00127 
00129    mutable DtTime     mySimTimeLastUpdate;
00130 
00132    mutable DtTime     myRealTimeLastUpdate;
00133 
00134 protected:
00135 
00136    static DtTime      theDfltTimeThreshold;
00137 
00138 };
00139 
00140 inline DtStateRepository* DtObjectPublisher::stateRep()
00141 {
00142    return myStateRep;
00143 }
00144 
00145 inline DtStateRepository* DtObjectPublisher::sr()
00146 {
00147    return myStateRep;
00148 }
00149 
00150 inline DtExerciseConn* DtObjectPublisher::exerciseConn()
00151 {
00152    return myExConn;
00153 }
00154 
00155 inline DtStateRepository* DtObjectPublisher::approximateRemoteStateRep()
00156 {
00157   return myAsSeenByRemote;
00158 }
00159 
00160 #endif   //DtObjectPublisher_H_
00161 #endif   //DtDIS
00162 

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)