VR-Link API Documentation for DIS
 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;
119 
124 
125 };
126 
128 {
129  return losr();
130 }
131 
133 {
134  return static_cast<DtLinearObjectRepository*>( myStateRep );
135 }
136 
138 {
140 }
141 
143 {
144  mySendFinalInDtor = onOff;
145 }
146 
148 {
149  theDfltLocThreshold = val;
150 }
151 
153 {
154  return theDfltLocThreshold;
155 }
156 
157 #endif // DtDIS
static double dfltLocThreshold()
Definition: linearObjectPublisherDIS.h:152
static void setDfltLocThreshold(double val)
Get/Set default Location threshold.
Definition: linearObjectPublisherDIS.h:147
DtStateRepository * myStateRep
Definition: objectPublisherDIS.h:176
Definition: linearObjectPublisherDIS.h:21
Contains the DtLinearObjectRepository class declaration.
virtual const DtObjectId & localId() const
Get the point object&#39;s localId - same as id for DIS.
Definition: linearObjectPublisherDIS.h:69
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
bool myStateRepPassedFlag
Definition: linearObjectPublisherDIS.h:122
static const DtEntityIdentifier & defaultId()
Returns a reference to an instance of -1:-1:-1.
virtual DtLinearObjectRepository * linearObjectStateRep()
Returns a pointer to the DtLinearObjectRepository - through which you can set or inspect current stat...
Definition: linearObjectPublisherDIS.h:127
static DtTime theClassDfltTimeThreshold
Definition: linearObjectPublisherDIS.h:117
virtual DtLinearObjectDecoder * decoder()
Returns a pointer to the Decoder being used to decode PDUs that we send back into the asSeenByRemote ...
Definition: linearObjectPublisherDIS.h:59
Instances of DtObjectPublisher are used for local or source simulations of objects, (i.e.
Definition: objectPublisherDIS.h:36
virtual DtLinearObjectEncoder * encoder()
Returns a pointer to the Encoder being used to encode current state into an entity state PDU...
Definition: linearObjectPublisherDIS.h:63
Functions in vlPrint.h provide an error and print facility for vrlink.
virtual void forceUpdate()=0
For publisher to send PDU on next tick.
Provides decoding logic for the DtLinearObjectStatePdu class.
Definition: linearObjectDecoderDIS.h:20
virtual const DtObjectId & id() const =0
The id is the same as the globalId, a DtEntityIdentifier unique to this object.
static DtStateRepCreator theStateRepCreator
Definition: linearObjectPublisherDIS.h:114
DtSyntheticEnvironmentObjectType is a class which contains information identifying the type of a synt...
Definition: vlpi/syntheticEnvironmentObjectType.h:19
Provides encoding logic for the DtLinearObjectStatePdu class.
Definition: linearObjectEncoderDIS.h:20
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
Contains the DIS DtLinearObjectDecoder class declaration.
DtObjectPublisher & operator=(const DtObjectPublisher &orig)
assignment operator – not implemented
virtual const DtGlobalObjectDesignator & globalId() const
Get the global object designator - same as id for DIS.
Definition: linearObjectPublisherDIS.h:72
Contains the DIS DtLinearObjectEncoder class declaration.
DtLinearObjectEncoder * myEncoder
Definition: linearObjectPublisherDIS.h:121
This class declares the DIS version of DtObjectPublisher.
DtLinearObjectDecoder * myDecoder
Definition: linearObjectPublisherDIS.h:120
bool mySendFinalInDtor
Definition: linearObjectPublisherDIS.h:123
virtual void tick()=0
Tick (update) this object.
virtual void forceUpdate()
Force a state update to be sent during the next call to tick, even if nothing would normally cause a ...
Definition: linearObjectPublisherDIS.h:137
Instances of DtLinearObjectRepository are used to maintain state information needed by linear object ...
Definition: linearObjectRepository.h:49
virtual void setSendNeeded()
Sets myForceSendNeeded to true.
virtual void sendFinalPduOnDestruction(bool onOff)
Set flag indicating whether to send a final PDU with the &quot;FinalPdu&quot; appearance bit set...
Definition: linearObjectPublisherDIS.h:142
virtual DtLinearObjectRepository * losr()
Synonym for pointObjectStateRep().
Definition: linearObjectPublisherDIS.h:132
static bool theClassDfltIsSetFlag
Definition: linearObjectPublisherDIS.h:118
static double theDfltLocThreshold
Definition: linearObjectPublisherDIS.h:116

Document ID: Generated on Tue Aug 10 00:12:31 EDT 2021 from SVN revision 232765
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)