VR-Link API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
entityPublisherDIS.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
5 #pragma once
6 
9 #if DtDIS
10 
11 
12 #include "objectPublisherDIS.h"
13 #include "entityStateRepository.h"
14 #include "entityStateEncoder.h"
15 #include "entityStateDecoder.h"
16 #include "objectId.h"
17 
24 {
25 public:
26 
27  //g++ forces us to define this function before we define
28  //our constructors
29  static const DtEntityType& guiseSameAsType();
30 
31 public:
32 
34  typedef DtEntityStateRepository* (*DtStateRepCreator)();
35 
36 public:
37 
38 
48  DtEntityStateRepository *stateRepToUse,
49  DtExerciseConn* conn,
50  const DtObjectId& id = DtObjectId::defaultId());
51 
61  DtExerciseConn* conn,
62  const DtObjectId& id = DtObjectId::defaultId());
63 
73  const DtEntityType& type,
74  DtExerciseConn* conn,
75  const DtObjectId& id = DtObjectId::defaultId());
76 
86  const DtEntityType& type,
87  DtExerciseConn* conn,
88  DtDeadReckonTypes algorithm,
89  DtForceType forceId,
90  const DtEntityType& guise = guiseSameAsType(),
91  const DtObjectId& id = DtObjectId::defaultId());
92 
94  virtual ~DtEntityPublisher();
95 
96 private:
97 
100 
103 
104 public:
108  virtual void tick();
109 
112  virtual DtEntityStateRepository* entityStateRep();
113 
115  virtual DtEntityStateRepository* esr();
116 
120  virtual DtEntityStateDecoder* decoder();
121 
124  virtual DtEntityStateEncoder* encoder();
125 
127  virtual const DtObjectId& id() const;
128 
130  virtual const DtObjectId& localId() const;
131 
133  virtual const DtGlobalObjectDesignator& globalId() const;
134 
138  virtual void sendFinalPduOnDestruction(bool on);
139 
142  virtual void forceUpdate();
143 
145  virtual void setSendDiGuyPdus(bool yesNo);
146 
148  virtual bool sendDiGuyPdus() const;
149 
151  virtual void setSendSeesPdus(bool yesNo);
152 
154  virtual bool sendSeesPdus() const;
155 
157  virtual void setSeesTimeThreshold(DtTime time);
158 
160  virtual DtTime seesTimeThreshold() const;
161 
163  virtual void setDiGuyTypeTimeThreshold(DtTime time);
164 
166  virtual DtTime diGuyTypeTimeThreshold() const;
167 
169  virtual void setDiGuyAppearanceTimeThreshold(DtTime time);
170 
172  virtual DtTime diGuyAppearanceTimeThreshold() const;
173 
175  virtual void setDiGuyActionTimeThreshold(DtTime time);
176 
178  virtual DtTime diGuyActionTimeThreshold() const;
179 
181  DtTime entityTypeHeartbeat(int type, int domain);
182 
183 public:
184 
186  static void setStateRepCreator(DtStateRepCreator creator);
187  static DtStateRepCreator stateRepCreator(void);
188 
189  static void setClassDfltTimeThreshold(DtTime threshold);
190  static void setStationaryDfltTimeThreshold(DtTime threshold);
191  static void setEntityTypeDfltTimeThreshold(int type, int domain, DtTime threshold);
192 
194 
195  static void setDfltRotationThreshold(double r);
196  static double dfltRotationThreshold();
197  static void setDfltTranslationThreshold(double t);
198  static double dfltTranslationThreshold();
200 
201 protected:
202 
204  void sendFinalPdu();
205 
207  virtual void createAndSendDiGuyPdus();
208 
210  virtual void createAndSendSeesPdu();
211 
212  virtual bool sendSeesNeeded() const;
213 
215  void init( const DtObjectId& vehId);
216 
217 protected:
218  DtObjectId myId;
219  DtEntityStateDecoder* myEntityDecoder;
220  DtEntityStateEncoder* myEntityEncoder;
221  bool mySendFinalInDtor;
222  bool mySendDiGuyPdus;
223  bool mySendSeesPdus;
224  DtTime mySeesPdusTimeThreshold;
225  DtTime myLastSeesPdusUpdate;
226  DtTime myDiGuyTypePdusTimeThreshold;
227  DtTime myLastDiGuyTypePdusUpdate;
228  DtTime myDiGuyAppearancePdusTimeThreshold;
229  DtTime myLastDiGuyAppearancePdusUpdate;
230  DtTime myDiGuyActionPdusTimeThreshold;
231  DtTime myLastDiGuyActionPdusUpdate;
232 
233 protected:
234  static DtStateRepCreator theStateRepCreator;
235  static DtTime theClassDfltTimeThreshold;
236  static bool theClassDfltIsSetFlag;
237  static DtTime theStationaryDfltTimeThreshold;
238  static bool theStationaryDfltIsSetFlag;
239  static std::map<std::pair<int,int>,DtTime> theEntityTypeHeartbeat;
240 };
241 
243 {
244  return esr();
245 }
246 
248 {
249  return (DtEntityStateRepository*) stateRep();
250 }
251 
252 inline DtEntityStateEncoder* DtEntityPublisher::encoder()
253 {
254  return myEntityEncoder;
255 }
256 
257 inline DtEntityStateDecoder* DtEntityPublisher::decoder()
258 {
259  return myEntityDecoder;
260 }
261 
262 inline void DtEntityPublisher::sendFinalPduOnDestruction(bool onOff)
263 {
264  mySendFinalInDtor = onOff;
265 }
266 
267 inline const DtObjectId& DtEntityPublisher::id() const
268 {
269  return myId;
270 }
271 
273 {
275 }
276 
278 {
280 }
281 
283 {
285 }
286 
288 {
290 }
291 
292 inline const DtObjectId& DtEntityPublisher::localId() const
293 {
294  return id();
295 }
296 
297 
298 
299 #endif

Document ID: Generated on Tue Mar 1 02:56:17 EST 2016 from SVN revision 162687
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)