VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
designatorPublisherDIS.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2013 MAK Technologies, Inc
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #if DtDIS
13 
14 #include <vl/pdu.h>
15 #include <vl/objectPublisherDIS.h>
19 #include <vlutil/vlPrint.h>
20 
22 {
23 public:
24 
26  typedef DtDesignatorRepository* (*DtStateRepCreator)();
27 
28 public:
29 
32  const DtObjectId& entityId = DtObjectId::defaultId() );
33 
36  DtExerciseConn* conn, const DtObjectId& entityId = DtObjectId::defaultId() );
37 
39  virtual ~DtDesignatorPublisher();
40 
45  virtual bool tick();
46 
49  virtual inline DtDesignatorRepository* designatorStateRep();
50 
52  virtual inline DtDesignatorRepository* dsr();
53 
56  virtual inline DtDesignatorDecoder* decoder() { return myDecoder; }
57 
60  virtual inline DtDesignatorEncoder* encoder() { return myEncoder; }
61 
63  virtual const DtObjectId& id() const;
64 
66  virtual inline const DtObjectId& localId() const { return id(); }
67 
69  virtual inline const DtGlobalObjectDesignator& globalId() const { return id(); }
70 
73  virtual inline void sendFinalPduOnDestruction( bool onOff );
74 
77  virtual inline void forceUpdate();
78 
80  virtual void setRelPosThreshold( double val );
81  virtual double relPosThreshold() const;
82 
84  virtual void setAbsPosThreshold( double val );
85  virtual double absPosThreshold() const;
86 
88  virtual void setAccelThreshold( double val );
89  virtual double accelThreshold() const;
90 
92  static inline void setDfltRelPosThreshold( double val );
93  static inline double dfltRelPosThreshold();
94 
96  static inline void setDfltAbsPosThreshold( double val );
97  static inline double dfltAbsPosThreshold();
98 
100  static inline void setDfltAccelThreshold( double val );
101  static inline double dfltAccelThreshold();
102 
104  static void setStateRepCreator(DtStateRepCreator creator);
105  static DtStateRepCreator stateRepCreator(void);
106 
107  static void setClassDfltTimeThreshold(DtTime threshold);
108 
109 protected:
110 
112  void init( const DtObjectId& );
113 
115  void sendFinalPdu();
116 
117 private:
118 
121 
124 
125 protected:
126 
127  static DtStateRepCreator theStateRepCreator;
128 
129  static double theDfltRelPosThreshold;
130  static double theDfltAbsPosThreshold;
131  static double theDfltAccelThreshold;
134 
138 
139 };
140 
141 
143 {
144  return dsr();
145 }
146 
148 {
149  return static_cast<DtDesignatorRepository*>(myStateRep);
150 }
151 
153 {
155 }
156 
158 {
159  mySendFinalInDtor = onOff;
160 }
161 
163 {
165 }
166 
168 {
169  return theDfltRelPosThreshold;
170 }
171 
173 {
175 }
176 
178 {
179  return theDfltAbsPosThreshold;
180 }
181 
183 {
184  theDfltAccelThreshold = val;
185 }
186 
188 {
189  return theDfltAccelThreshold;
190 }
191 
192 #endif // DtDIS
static DtStateRepCreator theStateRepCreator
Definition: designatorPublisherDIS.h:127
DtStateRepository * myStateRep
Definition: objectPublisherDIS.h:193
static double dfltAbsPosThreshold()
Definition: designatorPublisherDIS.h:177
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnDIS.h:62
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
static const DtEntityIdentifier & defaultId()
Returns a reference to an instance of -1:-1:-1.
Definition: designatorPublisherDIS.h:21
virtual DtDesignatorRepository * designatorStateRep()
Returns a pointer to the DesignatorRepository - through which you can set or inspect current state in...
Definition: designatorPublisherDIS.h:142
virtual DtDesignatorEncoder * encoder()
Returns a pointer to the Encoder being used to encode current state into an entity state PDU...
Definition: designatorPublisherDIS.h:60
Instances of DtObjectPublisher are used for local or source simulations of objects, (i.e.
Definition: objectPublisherDIS.h:36
Functions in vlPrint.h provide an error and print facility for vrlink.
virtual void forceUpdate()=0
For publisher to send PDU on next tick.
static double theDfltAccelThreshold
Definition: designatorPublisherDIS.h:131
virtual void forceUpdate()
Force a state update to be sent during the next call to tick, even if nothing would normally cause a ...
Definition: designatorPublisherDIS.h:152
DtDesignatorEncoder * myEncoder
Definition: designatorPublisherDIS.h:136
virtual const DtObjectId & id() const =0
The id is the same as the globalId, a DtEntityIdentifier unique to this object.
This file provides a declaration of the class DtDesignatorEncoder.
static bool theClassDfltIsSetFlag
Definition: designatorPublisherDIS.h:133
Instances of DtDesignatorEncoder are used to take state information from a DtDesignatorRepository and...
Definition: designatorEncoderDIS.h:22
static void setDfltAbsPosThreshold(double val)
Get/Set default &quot;Absolute Position&quot; threshold.
Definition: designatorPublisherDIS.h:172
static double dfltAccelThreshold()
Definition: designatorPublisherDIS.h:187
static double theDfltRelPosThreshold
Definition: designatorPublisherDIS.h:129
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
bool mySendFinalInDtor
Definition: designatorPublisherDIS.h:137
DtObjectPublisher & operator=(const DtObjectPublisher &orig)
assignment operator – not implemented
static void setDfltRelPosThreshold(double val)
Get/Set default &quot;Relative Position&quot; threshold.
Definition: designatorPublisherDIS.h:162
static double dfltRelPosThreshold()
Definition: designatorPublisherDIS.h:167
virtual DtDesignatorRepository * dsr()
Synonym for designatorStateRep().
Definition: designatorPublisherDIS.h:147
This class declares the DIS version of DtObjectPublisher.
virtual const DtGlobalObjectDesignator & globalId() const
Get the global object designator - same as id for DIS.
Definition: designatorPublisherDIS.h:69
static double theDfltAbsPosThreshold
Definition: designatorPublisherDIS.h:130
class DtDesignatorRepository:
Definition: designatorRepository.h:20
virtual bool tick()=0
Tick (update) this object.
DtDesignatorDecoder * myDecoder
Definition: designatorPublisherDIS.h:135
virtual DtDesignatorDecoder * decoder()
Returns a pointer to the Decoder being used to decode PDUs that we send back into the asSeenByRemote ...
Definition: designatorPublisherDIS.h:56
virtual void sendFinalPduOnDestruction(bool onOff)
Set flag indicating whether to send a final PDU with the &quot;FinalPdu&quot; appearance bit set...
Definition: designatorPublisherDIS.h:157
virtual void setSendNeeded()
Sets myForceSendNeeded to true.
static void setDfltAccelThreshold(double val)
Get/Set default &quot;Acceleration&quot; threshold.
Definition: designatorPublisherDIS.h:182
Definition: designatorDecoderDIS.h:19
static DtTime theClassDfltTimeThreshold
Definition: designatorPublisherDIS.h:132
virtual const DtObjectId & localId() const
Get the designator&#39;s localId - same as id for DIS.
Definition: designatorPublisherDIS.h:66

Document ID: Generated on Wed Mar 27 02:04:30 EDT 2024 from SVN revision 264570
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)