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 VT MAK
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 
44  virtual void tick();
45 
48  virtual inline DtDesignatorRepository* designatorStateRep();
49 
51  virtual inline DtDesignatorRepository* dsr();
52 
55  virtual inline DtDesignatorDecoder* decoder() { return myDecoder; }
56 
59  virtual inline DtDesignatorEncoder* encoder() { return myEncoder; }
60 
62  virtual const DtObjectId& id() const;
63 
65  virtual inline const DtObjectId& localId() const { return id(); }
66 
68  virtual inline const DtGlobalObjectDesignator& globalId() const { return id(); }
69 
72  virtual inline void sendFinalPduOnDestruction( bool onOff );
73 
76  virtual inline void forceUpdate();
77 
79  virtual void setRelPosThreshold( double val );
80  virtual double relPosThreshold() const;
81 
83  virtual void setAbsPosThreshold( double val );
84  virtual double absPosThreshold() const;
85 
87  virtual void setAccelThreshold( double val );
88  virtual double accelThreshold() const;
89 
91  static inline void setDfltRelPosThreshold( double val );
92  static inline double dfltRelPosThreshold();
93 
95  static inline void setDfltAbsPosThreshold( double val );
96  static inline double dfltAbsPosThreshold();
97 
99  static inline void setDfltAccelThreshold( double val );
100  static inline double dfltAccelThreshold();
101 
103  static void setStateRepCreator(DtStateRepCreator creator);
104  static DtStateRepCreator stateRepCreator(void);
105 
106  static void setClassDfltTimeThreshold(DtTime threshold);
107 
108 protected:
109 
111  void init( const DtObjectId& );
112 
114  void sendFinalPdu();
115 
116 private:
117 
120 
123 
124 protected:
125 
126  static DtStateRepCreator theStateRepCreator;
127 
128  static double theDfltRelPosThreshold;
129  static double theDfltAbsPosThreshold;
130  static double theDfltAccelThreshold;
133 
137 
138 };
139 
140 
142 {
143  return dsr();
144 }
145 
147 {
148  return static_cast<DtDesignatorRepository*>(myStateRep);
149 }
150 
152 {
154 }
155 
157 {
158  mySendFinalInDtor = onOff;
159 }
160 
162 {
164 }
165 
167 {
168  return theDfltRelPosThreshold;
169 }
170 
172 {
174 }
175 
177 {
178  return theDfltAbsPosThreshold;
179 }
180 
182 {
183  theDfltAccelThreshold = val;
184 }
185 
187 {
188  return theDfltAccelThreshold;
189 }
190 
191 #endif // DtDIS
static DtStateRepCreator theStateRepCreator
Definition: designatorPublisherDIS.h:126
DtStateRepository * myStateRep
Definition: objectPublisherDIS.h:176
static double dfltAbsPosThreshold()
Definition: designatorPublisherDIS.h:176
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnDIS.h:61
#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:141
virtual DtDesignatorEncoder * encoder()
Returns a pointer to the Encoder being used to encode current state into an entity state PDU...
Definition: designatorPublisherDIS.h:59
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:130
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:151
DtDesignatorEncoder * myEncoder
Definition: designatorPublisherDIS.h:135
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:132
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:171
static double dfltAccelThreshold()
Definition: designatorPublisherDIS.h:186
static double theDfltRelPosThreshold
Definition: designatorPublisherDIS.h:128
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
bool mySendFinalInDtor
Definition: designatorPublisherDIS.h:136
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:161
static double dfltRelPosThreshold()
Definition: designatorPublisherDIS.h:166
virtual DtDesignatorRepository * dsr()
Synonym for designatorStateRep().
Definition: designatorPublisherDIS.h:146
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:68
static double theDfltAbsPosThreshold
Definition: designatorPublisherDIS.h:129
class DtDesignatorRepository:
Definition: designatorRepository.h:20
virtual void tick()=0
Tick (update) this object.
DtDesignatorDecoder * myDecoder
Definition: designatorPublisherDIS.h:134
virtual DtDesignatorDecoder * decoder()
Returns a pointer to the Decoder being used to decode PDUs that we send back into the asSeenByRemote ...
Definition: designatorPublisherDIS.h:55
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:156
virtual void setSendNeeded()
Sets myForceSendNeeded to true.
static void setDfltAccelThreshold(double val)
Get/Set default &quot;Acceleration&quot; threshold.
Definition: designatorPublisherDIS.h:181
Definition: designatorDecoderDIS.h:19
static DtTime theClassDfltTimeThreshold
Definition: designatorPublisherDIS.h:131
virtual const DtObjectId & localId() const
Get the designator&#39;s localId - same as id for DIS.
Definition: designatorPublisherDIS.h:65

Document ID: Generated on Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)