VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
objectPublisherDIS.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
5 
9 
10 #if DtDIS
11 
12 
13 #ifndef DtDISObjectPublisher_H_
14 #define DtDISObjectPublisher_H_
15 
16 
18 #include <vlutil/vlMachineTypes.h>
19 #include "objectId.h"
20 #include <vlutil/vlTime.h>
21 
24 class DT_DLL_VL DtPdu;
29 
30 
37 {
38 public:
39 
42  typedef DtAttributePdu * (*DtNonCoupledAttributePduCreator)(const DtPduWithAttributeRecordSets*, void*);
43 
50  DtStateRepository* stateRep,
51  DtStateRepository* asSeenByRemote,
52  bool okToDeleteStateRep = true);
53 
55  virtual ~DtObjectPublisher();
56 
57 private:
58 
61 
63  DtObjectPublisher& operator= (const DtObjectPublisher& orig);
64 
65 public:
66 
69  virtual DtStateRepository* stateRep();
70 
73  virtual DtStateRepository* sr();
74 
76  virtual DtExerciseConn* exerciseConn();
77 
79  virtual const DtObjectId& localId() const = 0;
81  virtual const DtObjectId& id() const = 0;
83  virtual const DtGlobalObjectDesignator& globalId() const = 0;
84 
86  virtual void forceUpdate()=0;
87 
90  virtual bool tick() = 0;
91 
93  virtual bool parallelTick();
94 
98  virtual void setTimeThreshold(DtTime time);
100  virtual DtTime timeThreshold() const;
101 
104  virtual void setRelLocTimeThreshold( DtTime time );
106  virtual DtTime relLocTimeThreshold() const;
107 
112  virtual DtStateRepository* approximateRemoteStateRep();
113 
116  virtual DtTime lastTimeUpdated() const;
117  virtual DtTime lastTimeAttrUpdated() const;
118 
121  virtual DtTime lastSimTimeUpdated() const;
122 
125  virtual void setUseCustomThreshold(bool useCustom);
126 
129  virtual bool useCustomThreshold();
130 
132  virtual void setAttributePduStrategy(DtAttributePduStrategy strat);
133  virtual DtAttributePduStrategy attributePduStrategy() const;
134 
136  virtual void encodeExtensions(DtStateRepository* stateRep, const DtStateRepository &asSeenByRemote);
137 
140  virtual void decodeExtensions(DtPdu* pdu, const DtStateRepository &stateRep);
141 
144  virtual void setUpdateRateWarningThreshold(unsigned short updatesPerSecond);
145  virtual unsigned short updateRateWarningThreshold() const;
146 
150  virtual void checkForUpdateRateWarning() const;
151 
152 public:
153 
158  static void setDfltTimeThreshold(DtTime time);
159 
161  static DtTime dfltTimeThreshold();
162 
164  static void setDfltUpdateRateWarningThreshold(unsigned short updatesPerSecond);
165 
167  static unsigned short dfltUpdateRateWarningThreshold();
168 
170  static void setDfltRelLocTimeThreshold( DtTime time );
171 
173  static DtTime dfltRelLocTimeThreshold();
174 
176  static DtNonCoupledAttributePduCreator setDefaultNonCoupledAttributePduCreator(DtNonCoupledAttributePduCreator creator);
177  static DtNonCoupledAttributePduCreator defaultNonCoupledAttributePduCreator(void);
178 
180  DtNonCoupledAttributePduCreator setNonCoupledAttributePduCreator(DtNonCoupledAttributePduCreator creator);
181  DtNonCoupledAttributePduCreator nonCoupledAttributePduCreator(void);
182 
183 protected:
184 
185 
187  virtual void send(DtPdu* pdu) const;
188 
189 
190 protected:
191 
197 
202 
205 
209 
212 
214  mutable unsigned short myNumberOfPdusPerSecond;
215 
217  mutable unsigned short myUpdateRateWarningThreshold;
218 
220  mutable bool myCanWarn;
221 
222  // Publisher instance specific override for non-coupled Attribute PDU creation
223  DtNonCoupledAttributePduCreator myNonCoupledAttributePduCreator;
224 
225  // Default non-coupled Attribute PDU creator
226  static DtNonCoupledAttributePduCreator theDefaultNonCoupledAttributePduCreator;
227 
228  // How we should send attribute PDUs
230 
231  //List of State Repository Extension Encoders
232  std::vector<DtStateRepositoryExtensionEncoder*> myStateRepositoryExtensionEncoderList;
233 
234  //List of State Repository Extension Decoders
235  std::vector<DtStateRepositoryExtensionDecoder*> myStateRepositoryExtensionDecoderList;
236 
237 protected:
238 
241  static unsigned short theDfltUpdateRateWarningThreshold;
242 
243 };
244 
246 {
247  return myStateRep;
248 }
249 
251 {
252  return myStateRep;
253 }
254 
256 {
257  return myExConn;
258 }
259 
261 {
262  return myAsSeenByRemote;
263 }
264 
265 #endif //DtObjectPublisher_H_
266 #endif //DtDIS
267 
std::vector< DtStateRepositoryExtensionEncoder * > myStateRepositoryExtensionEncoderList
Definition: objectPublisherDIS.h:232
Contains the DtObjectId class declaration.
DtStateRepository * myStateRep
Definition: objectPublisherDIS.h:193
Definition: pduWithAttributeRecordSets.h:22
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnDIS.h:62
DtTime myTimeThreshold
Time threshold for the heartbeat rate.
Definition: objectPublisherDIS.h:199
bool myCanWarn
Set in constructor.
Definition: objectPublisherDIS.h:220
virtual DtStateRepository * stateRep()
Returns a pointer to the DtStateRepository - through which you can set or inspect current state infor...
Definition: objectPublisherDIS.h:245
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
std::vector< DtStateRepositoryExtensionDecoder * > myStateRepositoryExtensionDecoderList
Definition: objectPublisherDIS.h:235
DtTime myRelLocTimeThreshold
Time threshold for heartbeat rate of relative location updates (only for embarked/attached entities) ...
Definition: objectPublisherDIS.h:201
This file contains the declaration of DtClock and DtTime.
DtTime myRealTimeLastAttrUpdate
Definition: objectPublisherDIS.h:208
static DtTime theDfltTimeThreshold
Definition: objectPublisherDIS.h:239
Instances of DtObjectPublisher are used for local or source simulations of objects, (i.e.
Definition: objectPublisherDIS.h:36
bool myOkToDeleteStateRepFlag
Definition: objectPublisherDIS.h:195
static unsigned short theDfltUpdateRateWarningThreshold
Definition: objectPublisherDIS.h:241
The DtStateRepositoryExtensionEncoder class provides a base class for all State Repository Extension ...
Definition: stateRepositoryExtensionEncoder.h:21
Instances of DtAttributePdu are used to represent the arbitrary attributes added to PDUs...
Definition: attributePdu.h:26
unsigned short myNumberOfPdusPerSecond
Set in constructor.
Definition: objectPublisherDIS.h:214
The DtStateRepositoryExtensionDecoder class provides a base class for all State Repository Extension ...
Definition: stateRepositoryExtensionDecoder.h:21
DtTime myLastSpamCheckTime
Set in constructor.
Definition: objectPublisherDIS.h:211
DtTime myRealTimeLastUpdate
Set in const send() method.
Definition: objectPublisherDIS.h:207
DtNonCoupledAttributePduCreator myNonCoupledAttributePduCreator
Definition: objectPublisherDIS.h:223
virtual DtStateRepository * sr()
Returns a pointer to the DtStateRepository - through which you can set or inspect current state infor...
Definition: objectPublisherDIS.h:250
virtual DtExerciseConn * exerciseConn()
Get our exercise connection.
Definition: objectPublisherDIS.h:255
DtPdu is the base class for all PDU&#39;s in VR-Link.
Definition: pdu.h:69
DtAttributePduStrategy
Definition: vlAttributePduStrategy.h:16
unsigned short myUpdateRateWarningThreshold
Set in constructor.
Definition: objectPublisherDIS.h:217
DtStateRepository is an abstract base class for maintaining state for an object.
Definition: stateRepository.h:50
DtStateRepository * myAsSeenByRemote
Definition: objectPublisherDIS.h:194
DtAttributePduStrategy myAttributePduStrategy
Definition: objectPublisherDIS.h:229
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
DtTime mySimTimeLastUpdate
Set in const send() method.
Definition: objectPublisherDIS.h:204
DtExerciseConn * myExConn
Definition: objectPublisherDIS.h:192
int send(int s, char *buf, int bufLen, int flags)
bool myUseCustomThreshold
Definition: objectPublisherDIS.h:196
static DtTime theDfltRelLocTimeThreshold
Definition: objectPublisherDIS.h:240
MANAGEDINTERFACE_DLL void tick(double maxTime)
Tick ManagedInterface.
virtual DtStateRepository * approximateRemoteStateRep()
Returns a pointer to the approximate remote DtStateRepository – This state repository contains the co...
Definition: objectPublisherDIS.h:260
This file contains typedefs for machine dependant types.
static DtNonCoupledAttributePduCreator theDefaultNonCoupledAttributePduCreator
Definition: objectPublisherDIS.h:226

Document ID: Generated on Wed Mar 27 02:04:30 EDT 2024 from SVN revision 264570
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)