VR-Link API Documentation for HLA 1.3
 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 "diGuyCustomPduDecoder.h"
17 #include "diGuyCustomPduEncoder.h"
18 #include "objectId.h"
19 #include "ownershipHandler.h"
20 
27 {
28 public:
29 
30  //g++ forces us to define this function before we define
31  //our constructors
32  static const DtEntityType& guiseSameAsType();
33 
34 public:
35 
37  typedef DtEntityStateRepository* (*DtStateRepCreator)();
38 
39 public:
40 
41 
51  DtEntityStateRepository *stateRepToUse,
52  DtExerciseConn* conn,
53  const DtObjectId& id = DtObjectId::defaultId());
54 
64  DtExerciseConn* conn,
65  const DtObjectId& id = DtObjectId::defaultId());
66 
76  const DtEntityType& type,
77  DtExerciseConn* conn,
78  const DtObjectId& id = DtObjectId::defaultId());
79 
89  const DtEntityType& type,
90  DtExerciseConn* conn,
91  DtDeadReckonTypes algorithm,
92  DtForceType forceId,
93  const DtEntityType& guise = guiseSameAsType(),
94  const DtObjectId& id = DtObjectId::defaultId());
95 
97  virtual ~DtEntityPublisher();
98 
99 private:
100 
103 
106 
107 public:
111  virtual void tick();
112 
115  virtual DtEntityStateRepository* entityStateRep();
116 
118  virtual DtEntityStateRepository* esr();
119 
123  virtual DtEntityStateDecoder* decoder();
124 
127  virtual DtEntityStateEncoder* encoder();
128 
132  virtual DtOwnershipHandler* setOwnershipHandler( DtOwnershipHandler* handler );
133 
135  virtual const DtObjectId& id() const;
136 
138  virtual const DtObjectId& localId() const;
139 
141  virtual const DtGlobalObjectDesignator& globalId() const;
142 
146  virtual void sendFinalPduOnDestruction(bool on);
147 
150  virtual void forceUpdate();
151 
153  virtual void enableDiGuyInformation();
154 
157  virtual void setSendDiGuyPdus(bool yesNo);
158 
160  virtual bool sendDiGuyPdus() const;
161 
163  virtual void setSendSeesPdus(bool yesNo);
164 
166  virtual bool sendSeesPdus() const;
167 
169  virtual void setSeesTimeThreshold(DtTime time);
170 
172  virtual DtTime seesTimeThreshold() const;
173 
175  virtual void setDiGuyTypeTimeThreshold(DtTime time);
176 
178  virtual DtTime diGuyTypeTimeThreshold() const;
179 
181  virtual void setDiGuyAppearanceTimeThreshold(DtTime time);
182 
184  virtual DtTime diGuyAppearanceTimeThreshold() const;
185 
187  virtual void setDiGuyActionTimeThreshold(DtTime time);
188 
190  virtual DtTime diGuyActionTimeThreshold() const;
191 
193  DtTime entityTypeHeartbeat(int type, int domain);
194 
199  virtual void divestObject(DtU16 siteTarget, DtU16 applicationTarget);
200 
201 public:
202 
204  static void setStateRepCreator(DtStateRepCreator creator);
205  static DtStateRepCreator stateRepCreator(void);
206 
207  static void setClassDfltTimeThreshold(DtTime threshold);
208  static void setStationaryDfltTimeThreshold(DtTime threshold);
209  static void setEntityTypeDfltTimeThreshold(int type, int domain, DtTime threshold);
210 
212 
213  static void setDfltRotationThreshold(double r);
214  static double dfltRotationThreshold();
215  static void setDfltTranslationThreshold(double t);
216  static double dfltTranslationThreshold();
218 
220  virtual void createAndSendDiGuyPdus();
221 
222 protected:
223 
225  void sendFinalPdu();
226 
228  virtual void createAndSendSeesPdu();
229 
230  virtual bool sendSeesNeeded() const;
231 
233  void init( const DtObjectId& vehId);
234 
235 protected:
236  DtObjectId myId;
237  DtEntityStateDecoder* myEntityDecoder;
238  DtEntityStateEncoder* myEntityEncoder;
239  DtDIGuyCustomPduEncoder* myDiGuyEncoder;
240  bool mySendFinalInDtor;
241  bool mySendDiGuyPdus;
242  bool mySendSeesPdus;
243  DtTime mySeesPdusTimeThreshold;
244  DtTime myLastSeesPdusUpdate;
245  DtOwnershipHandler* myOwnershipHandler;
246 
247 protected:
248  static DtStateRepCreator theStateRepCreator;
249  static DtTime theClassDfltTimeThreshold;
250  static bool theClassDfltIsSetFlag;
251  static DtTime theStationaryDfltTimeThreshold;
252  static bool theStationaryDfltIsSetFlag;
253  static std::map<std::pair<int,int>,DtTime> theEntityTypeHeartbeat;
254 };
255 
257 {
258  return esr();
259 }
260 
262 {
263  return (DtEntityStateRepository*) stateRep();
264 }
265 
266 inline DtEntityStateEncoder* DtEntityPublisher::encoder()
267 {
268  return myEntityEncoder;
269 }
270 
271 inline DtEntityStateDecoder* DtEntityPublisher::decoder()
272 {
273  return myEntityDecoder;
274 }
275 
276 inline void DtEntityPublisher::sendFinalPduOnDestruction(bool onOff)
277 {
278  mySendFinalInDtor = onOff;
279 }
280 
281 inline const DtObjectId& DtEntityPublisher::id() const
282 {
283  return myId;
284 }
285 
287 {
289 }
290 
292 {
294 }
295 
297 {
299 }
300 
302 {
304 }
305 
306 inline const DtObjectId& DtEntityPublisher::localId() const
307 {
308  return id();
309 }
310 
311 
312 
313 #endif

Document ID: Generated on Thu Feb 22 04:26:36 EST 2018 from SVN revision 186468
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)