VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
objectPublisherHLA.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
5 
6 
7 #if DtHLA
8 
9 #ifndef objectPublisherHLA_H_
10 #define objectPublisherHLA_H_
11 
12 
13 #include <vlutil/vlMachineTypes.h>
14 #include "rtiNamespace.h"
15 #include "objectId.h"
16 #include "globalObjectDesignator.h"
17 #include "hlaObjectWithStateRep.h"
18 #include "region.h"
19 
23 
24 class DtStateRepository;
25 class DtExerciseConn;
26 class DtHlaStateDecoder;
27 class DtHlaStateEncoder;
28 
35 {
36 public:
37 
41  DtStateRepository* stateRep,
42  DtStateRepository* asSeenByRemote,
43  bool okToDeleteStateRep = true,
44  const DtDDMRegionSet* regionSet = 0);
45 
49  virtual ~DtObjectPublisher();
50 
51 private:
52 
55 
57  DtObjectPublisher& operator= (const DtObjectPublisher& orig);
58 
59 public:
60 
67 
70  virtual void setHlaObject(
71  const char* className,
72  DtHlaStateEncoder* encoder = 0,
73  DtHlaStateDecoder* decoder = 0,
74  const char* objectName = 0,
75  const DtDDMRegionSet* regionSet = 0);
76 
79  virtual void setHlaObject(
80  RTI::ObjectClassHandle hand,
81  DtHlaStateEncoder* encoder = 0,
82  DtHlaStateDecoder* decoder = 0,
83  const char* objectName = 0,
84  const DtDDMRegionSet* regionSet = 0);
85 
88  virtual void setHlaObject(
90  DtHlaStateEncoder* encoder = 0,
91  DtHlaStateDecoder* decoder = 0);
92 
96  virtual void detachHlaObject();
97 
100  virtual DtStateRepository* stateRep();
101 
103  virtual DtStateRepository* sr();
104 
109  virtual DtStateRepository* approximateRemoteStateRep();
110 
114  virtual DtHlaStateDecoder* decoder();
115 
118  virtual DtHlaStateEncoder* encoder();
119 
121  virtual DtHlaObjectWithStateRep* hlaObject();
122 
124  virtual DtExerciseConn* exerciseConn();
125 
127  virtual const DtObjectId& id() const;
128 
130  virtual const DtObjectId& objectId() const;
131 
133  virtual const DtObjectId& localId() const;
134 
136  virtual const DtString& name() const;
137 
140  virtual const DtGlobalObjectDesignator& globalId() const;
141 
147  virtual void forceUpdate();
148  virtual void forceUpdate(const RTI::AttributeHandleSet& set);
149 
152  virtual bool tick();
153 
156  virtual bool parallelTick();
157 
161  virtual void setDeleteObjInDtorFlag(bool onOff);
162  virtual bool deleteObjInDtorFlag() const;
163 
164  virtual const DtDDMRegionSet& publishingRegions() const;
165 
168  virtual void addRegion(DtDDMRegionSP regionToAdd);
169 
174  virtual void removeRegion(DtDDMRegionSP regionToRemove);
175 
179  virtual void setUpdateRateWarningThreshold(unsigned short updatesPerSecond);
180 
182  virtual unsigned short updateRateWarningThreshold() const;
183 
185  virtual void checkForUpdateRateWarning();
186 
187 public:
188 
190  static void removeObjectCb(DtHlaObject* obj, void* pub);
191 
193  static void setDfltUpdateRateWarningThreshold(unsigned short updatesPerSecond);
194 
196  static unsigned short dfltUpdateRateWarningThreshold();
197 
198 protected:
199 
204  DtStateRepository* asSeenByRemote,
205  bool okToDeleteStateRep = true,
206  const DtDDMRegionSet* regionSet = 0);
207 
211  virtual void setExerciseConn(DtExerciseConn* conn);
212 
215  virtual void processRemoveObject(DtHlaObject* obj);
216 
217 protected:
218 
234  bool myCanWarn;
235 
236 public:
237 
242  DtObjectPublisher(DtExerciseConn* conn, const char* name = 0);
243  void init(RTI::ObjectClassHandle hand, DtStateRepository* stateRep,
244  DtStateRepository* asSeenByRemote, DtHlaStateEncoder* encoder = 0,
245  DtHlaStateDecoder* decoder = 0);
246  void init(const char* className, DtStateRepository* stateRep,
247  DtStateRepository* asSeenByRemote, DtHlaStateEncoder* encoder = 0,
248  DtHlaStateDecoder* decoder = 0);
249 
250 protected:
253  static unsigned short theDfltUpdateRateWarningThreshold;
254 
255 };
256 
258 {
259  return myStateRep;
260 }
261 
263 {
264  return myStateRep;
265 }
266 
268 {
269  return myExConn;
270 }
271 
273 {
274  return myHlaObj;
275 }
276 
278 {
279  return id();
280 }
281 
283 {
284  return myAsSeenByRemote;
285 }
286 
287 
288 #endif //DtObjectPublisher_H_
289 #endif //DtHLA
290 
Contains the DtObjectId class declaration.
DtStateRepository * myStateRep
Definition: objectPublisherHLA.h:221
DtObjectId myObjectId
Definition: objectPublisherHLA.h:225
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnHLA.h:61
This file provides a declaration of the class DtHlaObjectWithStateRep.
DtString myName
Definition: objectPublisherHLA.h:227
bool myCanWarn
Definition: objectPublisherHLA.h:234
virtual DtStateRepository * stateRep()
Returns a pointer to the DtStateRepository - through which you can set or inspect current state infor...
Definition: objectPublisherHLA.h:257
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
DtDDMRegionSet myPublishingRegions
Definition: objectPublisherHLA.h:229
DtHlaStateEncoder * myEncoder
Definition: objectPublisherHLA.h:223
Instances of DtObjectPublisher are used for local or source simulations of objects, (i.e.
Definition: objectPublisherHLA.h:34
This file contains typedefs used to represent objects in a protocol neutral way.
DtHlaStateEncoder is used to provide encoding of a state repository into a state message in an HLA (a...
Definition: hlaStateEncoder.h:30
std::set< DtDDMRegionSP > DtDDMRegionSet
Definition: region13.h:34
bool myOkToDeleteStateRepFlag
Definition: objectPublisherHLA.h:226
static unsigned short theDfltUpdateRateWarningThreshold
Static member that holds the value of the number of updates to be sent to trigger a spam warning...
Definition: objectPublisherHLA.h:253
unsigned short myNumberOfUpdatesPerSecond
Definition: objectPublisherHLA.h:232
DtTime myLastSpamCheckTime
Definition: objectPublisherHLA.h:231
DtTime myRealTimeLastUpdate
Definition: objectPublisherHLA.h:230
virtual DtStateRepository * sr()
Synonym for stateRep().
Definition: objectPublisherHLA.h:262
Instances of DtHlaObject are used to represent HLA objects which are communicated across the network...
Definition: hlaObject.h:58
virtual DtExerciseConn * exerciseConn()
Get our exercise connection.
Definition: objectPublisherHLA.h:267
DtHlaStateDecoder is used to provide decoding of a state message into a state repository in an HLA (a...
Definition: hlaStateDecoder.h:34
DtHlaObjectWithStateRep * myHlaObj
Definition: objectPublisherHLA.h:220
unsigned short myUpdateRateWarningThreshold
Definition: objectPublisherHLA.h:233
DtStateRepository is an abstract base class for maintaining state for an object.
Definition: stateRepository.h:50
DtHlaStateDecoder * myDecoder
Definition: objectPublisherHLA.h:224
DtStateRepository * myAsSeenByRemote
Definition: objectPublisherHLA.h:222
DtBoost::shared_ptr< DtDDMRegion > DtDDMRegionSP
Definition: region13.h:31
virtual DtHlaObjectWithStateRep * hlaObject()
Get the object&#39;s hlaObject.
Definition: objectPublisherHLA.h:272
DtObjectId instances are used to represent RTI::ObjectInstances in VR-Link.
Definition: objectId.h:38
DtExerciseConn * myExConn
Definition: objectPublisherHLA.h:219
bool myDeleteObjInDtorFlag
Definition: objectPublisherHLA.h:228
MANAGEDINTERFACE_DLL void tick(double maxTime)
Tick ManagedInterface.
Instances of DtString are used to represent strings.
Definition: vlString.h:29
virtual DtStateRepository * approximateRemoteStateRep()
Returns a pointer to the approximate remote DtStateRepository – This state repository contains the co...
Definition: objectPublisherHLA.h:282
virtual const DtObjectId & id() const
Get the object&#39;s local identifier.
This file contains typedefs for machine dependant types.
virtual const DtObjectId & localId() const
Get the object&#39;s local identifier.
Definition: objectPublisherHLA.h:277
class DtHlaObjectWithStateRep:
Definition: hlaObjectWithStateRep.h:28

Document ID: Generated on Thu Sep 19 02:12:35 EDT 2024 from SVN revision 269601
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)