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
DtStateRepository * myStateRep
Definition: objectPublisherHLA.h:202
class DtLinearObjectPublisher:
Definition: linearObjectPublisherHLA.h:40
Contains the DtLinearObjectRepository class declaration.
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnHLA.h:60
virtual DtHlaStateEncoder * encoder()
Returns a pointer to the Encoder being used to encode current state into an outgoing message...
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
static const DtObjectId & defaultId()
virtual DtLinearObjectRepository * linearObjectStateRep()
Returns a pointer to the DtLinearObjectRepository - through which you can set or inspect current stat...
Definition: linearObjectPublisherHLA.h:113
DtHlaStateEncoder * myEncoder
Definition: objectPublisherHLA.h:204
Instances of DtObjectPublisher are used for local or source simulations of objects, (i.e.
Definition: objectPublisherHLA.h:34
Functions in vlPrint.h provide an error and print facility for vrlink.
virtual void tick()
Tick (update) this object.
DtSyntheticEnvironmentObjectType is a class which contains information identifying the type of a synt...
Definition: vlpi/syntheticEnvironmentObjectType.h:19
virtual const DtGlobalObjectDesignator & globalId() const
Get the HLA object&#39;s global object designator - the object name in RTI1.3.3, but the objectId in RTI1...
virtual void forceUpdate()
Specify a set of attributes that should be included in the ahvps the next time tick is called...
DtHlaStateDecoder * myDecoder
Definition: objectPublisherHLA.h:205
Contains the DIS DtLinearObjectDecoder class declaration.
DtObjectPublisher & operator=(const DtObjectPublisher &orig)
assignment operator – not implemented
Contains the DIS DtLinearObjectEncoder class declaration.
This class declares the DIS version of DtObjectPublisher.
DtObjectId instances are used to represent RTI::ObjectInstances in VR-Link.
Definition: objectId.h:38
DtReal DtTime
A definition of DtTime.
Definition: vlTime.h:19
Instances of DtString are used to represent strings.
Definition: vlString.h:29
virtual const DtObjectId & id() const
Get the object&#39;s local identifier.
Instances of DtLinearObjectRepository are used to maintain state information needed by linear object ...
Definition: linearObjectRepository.h:49
void init(RTI::ObjectClassHandle hand, DtStateRepository *stateRep, DtStateRepository *asSeenByRemote, DtHlaStateEncoder *encoder=0, DtHlaStateDecoder *decoder=0)
virtual const DtObjectId & localId() const
Get the object&#39;s local identifier.
Definition: objectPublisherHLA.h:247
virtual DtLinearObjectRepository * losr()
Synonym for linearObjectStateRep().
Definition: linearObjectPublisherHLA.h:118
virtual DtHlaStateDecoder * decoder()
Returns a pointer to the Decoder being used to decode state messages that we send back into the asSee...

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)