VR-Link API Documentation for DIS
dDesignatrPub.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 
00006 
00009 
00010 #ifndef DtDisDesignatorPublisher_H_
00011 #define DtDisDesignatorPublisher_H_
00012 
00013 #if DtDIS
00014 
00015 
00016 #include "dObjPub.h"
00017 #include "pdu.h"
00018 #include "designatorSR.h"
00019 #include "dDesignatrDec.h"
00020 #include "dDesignatrEnc.h"
00021 #include <vlutil/vlPrint.h>
00022 
00023 
00024 class DT_DLL_VL DtDesignatorPublisher : public DtObjectPublisher
00025 {
00026 public:
00027 
00029    typedef DtDesignatorRepository* (*DtStateRepCreator)();
00030  
00031 public:
00032 
00034    DtDesignatorPublisher(
00035       DtDesignatorRepository *stateRepToUse, 
00036       DtExerciseConn* conn,
00037       const DtObjectId& entityId = DtObjectId::defaultId());
00038 
00040    DtDesignatorPublisher(DtExerciseConn* conn,
00041                          const DtObjectId &entityId = DtObjectId::defaultId());
00042 
00044    virtual ~DtDesignatorPublisher();
00045 
00046 public:
00050    virtual void tick();
00051 
00054    virtual inline DtDesignatorRepository* designatorStateRep();
00055 
00057    virtual inline DtDesignatorRepository* dsr();
00058 
00061    virtual inline DtDesignatorDecoder* decoder() { return myDecoder; }
00062 
00065    virtual inline DtDesignatorEncoder* encoder() { return myEncoder; }
00066 
00068    virtual const DtObjectId& id() const;
00069 
00071    virtual inline const DtObjectId& localId() const { return id(); }
00072 
00074    virtual inline const DtGlobalObjectDesignator& globalId() const { return id(); }
00075 
00078    virtual inline void sendFinalPduOnDestruction( bool onOff );
00079 
00082    virtual inline void forceUpdate();
00083 
00085    virtual void setRelPosThreshold( double val );
00086    virtual double relPosThreshold() const;
00087 
00089    virtual void setAbsPosThreshold( double val );
00090    virtual double absPosThreshold() const;
00091 
00093    virtual void setAccelThreshold( double val );
00094    virtual double accelThreshold() const;
00095 
00096 public:
00097 
00099    static inline void setDfltRelPosThreshold( double val );
00100    static inline double dfltRelPosThreshold();
00101 
00103    static inline void setDfltAbsPosThreshold( double val );
00104    static inline double dfltAbsPosThreshold();
00105 
00107    static inline void setDfltAccelThreshold( double val );
00108    static inline double dfltAccelThreshold();
00109 
00111    static void setStateRepCreator(DtStateRepCreator creator);
00112    static DtStateRepCreator stateRepCreator(void);
00113 
00114    static void setClassDfltTimeThreshold(DtTime threshold);
00115 
00116 protected: 
00117 
00119    void init( const DtObjectId&);
00120 
00122    void sendFinalPdu();
00123 
00125    DtDesignatorPublisher( const DtDesignatorPublisher& );
00126 
00128    DtDesignatorPublisher& operator=( const DtDesignatorPublisher& );
00129 
00130 protected:
00131    DtDesignatorDecoder*    myDecoder;
00132    DtDesignatorEncoder*    myEncoder;
00133    bool mySendFinalInDtor;
00134    bool myStateRepPassedFlag;
00135 
00136 protected:
00137 
00138    static double theDfltRelPosThreshold;
00139    static double theDfltAbsPosThreshold;
00140    static double theDfltAccelThreshold;
00141    static DtStateRepCreator theStateRepCreator;
00142    static DtTime            theClassDfltTimeThreshold;
00143    static bool              theClassDfltIsSetFlag;
00144 };
00145 
00146 inline DtDesignatorRepository* DtDesignatorPublisher::designatorStateRep() 
00147 { 
00148    return dsr(); 
00149 }
00150 
00151 inline DtDesignatorRepository* DtDesignatorPublisher::dsr() 
00152 { 
00153    return static_cast<DtDesignatorRepository*>(myStateRep); 
00154 }
00155 
00156 inline void DtDesignatorPublisher::forceUpdate() 
00157 { 
00158    myEncoder->setSendNeeded(); 
00159 }
00160 
00161 inline void DtDesignatorPublisher::sendFinalPduOnDestruction( bool onOff ) 
00162 { 
00163    mySendFinalInDtor = onOff; 
00164 }
00165 
00166 inline void DtDesignatorPublisher::setDfltRelPosThreshold( double val ) 
00167 { 
00168    theDfltRelPosThreshold = val; 
00169 }
00170 
00171 inline double DtDesignatorPublisher::dfltRelPosThreshold() 
00172 { 
00173    return theDfltRelPosThreshold; 
00174 }
00175 
00176 inline void DtDesignatorPublisher::setDfltAbsPosThreshold( double val ) 
00177 { 
00178    theDfltAbsPosThreshold = val; 
00179 }
00180 
00181 inline double DtDesignatorPublisher::dfltAbsPosThreshold() 
00182 { 
00183    return theDfltAbsPosThreshold; 
00184 }
00185 
00186 inline void DtDesignatorPublisher::setDfltAccelThreshold( double val ) 
00187 { 
00188    theDfltAccelThreshold = val; 
00189 }
00190 
00191 inline double DtDesignatorPublisher::dfltAccelThreshold() 
00192 { 
00193    return theDfltAccelThreshold; 
00194 }
00195 
00196 
00197 #endif  //! DtDIS
00198 #endif  //! DtDisDesignatorPublisher_H_
00199 

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)