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 "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 
130  virtual const DtObjectId& id() const;
131 
133  virtual const DtObjectId& localId() const;
134 
136  virtual const DtGlobalObjectDesignator& globalId() const;
137 
141  virtual void sendFinalPduOnDestruction(bool on);
142 
145  virtual void forceUpdate();
146 
148  virtual void enableDiGuyInformation();
149 
152  virtual void setSendDiGuyPdus(bool yesNo);
153 
155  virtual bool sendDiGuyPdus() const;
156 
158  virtual void setSendSeesPdus(bool yesNo);
159 
161  virtual bool sendSeesPdus() const;
162 
164  virtual void setSeesTimeThreshold(DtTime time);
165 
167  virtual DtTime seesTimeThreshold() const;
168 
170  virtual void setDiGuyTypeTimeThreshold(DtTime time);
171 
173  virtual DtTime diGuyTypeTimeThreshold() const;
174 
176  virtual void setDiGuyAppearanceTimeThreshold(DtTime time);
177 
179  virtual DtTime diGuyAppearanceTimeThreshold() const;
180 
182  virtual void setDiGuyActionTimeThreshold(DtTime time);
183 
185  virtual DtTime diGuyActionTimeThreshold() const;
186 
188  DtTime entityTypeHeartbeat(int type, int domain);
189 
194  virtual void divestObject(DtU16 siteTarget, DtU16 applicationTarget);
195 
196 public:
197 
199  static void setStateRepCreator(DtStateRepCreator creator);
200  static DtStateRepCreator stateRepCreator(void);
201 
202  static void setClassDfltTimeThreshold(DtTime threshold);
203  static void setStationaryDfltTimeThreshold(DtTime threshold);
204  static void setEntityTypeDfltTimeThreshold(int type, int domain, DtTime threshold);
205 
207 
208  static void setDfltRotationThreshold(double r);
209  static double dfltRotationThreshold();
210  static void setDfltTranslationThreshold(double t);
211  static double dfltTranslationThreshold();
213 
215  virtual void createAndSendDiGuyPdus();
216 
217 protected:
218 
220  void sendFinalPdu();
221 
223  virtual void createAndSendSeesPdu();
224 
225  virtual bool sendSeesNeeded() const;
226 
228  void init( const DtObjectId& vehId);
229 
230 protected:
231  DtObjectId myId;
232  DtEntityStateDecoder* myEntityDecoder;
233  DtEntityStateEncoder* myEntityEncoder;
234  DtDIGuyCustomPduEncoder* myDiGuyEncoder;
235  bool mySendFinalInDtor;
236  bool mySendDiGuyPdus;
237  bool mySendSeesPdus;
238  DtTime mySeesPdusTimeThreshold;
239  DtTime myLastSeesPdusUpdate;
240  DtOwnershipHandler* myOwnershipHandler;
241 
242 protected:
243  static DtStateRepCreator theStateRepCreator;
244  static DtTime theClassDfltTimeThreshold;
245  static bool theClassDfltIsSetFlag;
246  static DtTime theStationaryDfltTimeThreshold;
247  static bool theStationaryDfltIsSetFlag;
248  static std::map<std::pair<int,int>,DtTime> theEntityTypeHeartbeat;
249 };
250 
252 {
253  return esr();
254 }
255 
257 {
258  return (DtEntityStateRepository*) stateRep();
259 }
260 
261 inline DtEntityStateEncoder* DtEntityPublisher::encoder()
262 {
263  return myEntityEncoder;
264 }
265 
266 inline DtEntityStateDecoder* DtEntityPublisher::decoder()
267 {
268  return myEntityDecoder;
269 }
270 
271 inline void DtEntityPublisher::sendFinalPduOnDestruction(bool onOff)
272 {
273  mySendFinalInDtor = onOff;
274 }
275 
276 inline const DtObjectId& DtEntityPublisher::id() const
277 {
278  return myId;
279 }
280 
282 {
284 }
285 
287 {
289 }
290 
292 {
294 }
295 
297 {
299 }
300 
301 inline const DtObjectId& DtEntityPublisher::localId() const
302 {
303  return id();
304 }
305 
306 
307 
308 #endif

Document ID: Generated on Fri Dec 2 02:42:08 EST 2016 from SVN revision 171416
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)