VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
linearObjectPublisherDIS.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2014 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 DtLinearObjectRepository* (*DtStateRepCreator)();
27 
28 public:
29 
32  const DtObjectId& id = DtObjectId::defaultId() );
33 
36  DtExerciseConn* conn, const DtObjectId& id = DtObjectId::defaultId() );
37 
40  DtExerciseConn* conn, const DtObjectId& id = DtObjectId::defaultId() );
41 
43  virtual ~DtLinearObjectPublisher();
44 
48  virtual void tick();
49 
52  virtual inline DtLinearObjectRepository* linearObjectStateRep();
53 
55  virtual inline DtLinearObjectRepository* losr();
56 
59  virtual inline DtLinearObjectDecoder* decoder() { return myDecoder; }
60 
63  virtual inline DtLinearObjectEncoder* encoder() { return myEncoder; }
64 
66  virtual const DtObjectId& id() const;
67 
69  virtual inline const DtObjectId& localId() const { return id(); }
70 
72  virtual inline const DtGlobalObjectDesignator& globalId() const { return id(); }
73 
76  virtual inline void sendFinalPduOnDestruction( bool onOff );
77 
80  virtual inline void forceUpdate();
81 
83  virtual void setLocThreshold( double val );
84  virtual double locThreshold() const;
85 
87  static inline void setDfltLocThreshold( double val );
88  static inline double dfltLocThreshold();
89 
91  static void setStateRepCreator( DtStateRepCreator creator );
92  static DtStateRepCreator stateRepCreator();
93 
94  static void setClassDfltTimeThreshold( DtTime threshold );
95 
96 protected:
97 
99  void init( const DtObjectId& );
100 
102  void sendFinalPdu();
103 
104 private:
105 
108 
111 
112 protected:
113 
114  static DtStateRepCreator theStateRepCreator;
115 
116  static double theDfltLocThreshold;
117  static DtTime theClassDfltTimeThreshold;
118  static bool theClassDfltIsSetFlag;
119 
120  DtLinearObjectDecoder* myDecoder;
121  DtLinearObjectEncoder* myEncoder;
122  bool myStateRepPassedFlag;
123  bool mySendFinalInDtor;
124 
125 };
126 
128 {
129  return losr();
130 }
131 
133 {
134  return static_cast<DtLinearObjectRepository*>( myStateRep );
135 }
136 
138 {
139  myEncoder->setSendNeeded();
140 }
141 
142 inline void DtLinearObjectPublisher::sendFinalPduOnDestruction( bool onOff )
143 {
144  mySendFinalInDtor = onOff;
145 }
146 
147 inline void DtLinearObjectPublisher::setDfltLocThreshold( double val )
148 {
149  theDfltLocThreshold = val;
150 }
151 
152 inline double DtLinearObjectPublisher::dfltLocThreshold()
153 {
154  return theDfltLocThreshold;
155 }
156 
157 #endif // DtDIS

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)