VR-Link API Documentation for DIS
 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 VT MAK
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(
89  DtHlaObjectWithStateRep* obj,
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 
151  virtual void tick();
152 
154  virtual void parallelTick();
155 
159  virtual void setDeleteObjInDtorFlag(bool onOff);
160  virtual bool deleteObjInDtorFlag() const;
161 
162  virtual const DtDDMRegionSet& publishingRegions() const;
163 
166  virtual void addRegion(DtDDMRegionSP regionToAdd);
167 
172  virtual void removeRegion(DtDDMRegionSP regionToRemove);
173 
174 public:
175 
177  static void removeObjectCb(DtHlaObject* obj, void* pub);
178 
179 protected:
180 
185  DtStateRepository* asSeenByRemote,
186  bool okToDeleteStateRep = true,
187  const DtDDMRegionSet* regionSet = 0);
188 
192  virtual void setExerciseConn(DtExerciseConn* conn);
193 
196  virtual void processRemoveObject(DtHlaObject* obj);
197 
198 protected:
199 
200  DtExerciseConn* myExConn;
201  DtHlaObjectWithStateRep* myHlaObj;
202  DtStateRepository* myStateRep;
203  DtStateRepository* myAsSeenByRemote;
204  DtHlaStateEncoder* myEncoder;
205  DtHlaStateDecoder* myDecoder;
206  DtObjectId myObjectId;
207  bool myOkToDeleteStateRepFlag;
208  DtString myName;
209  bool myDeleteObjInDtorFlag;
210  DtDDMRegionSet myPublishingRegions;
211 
212 public:
213 
218  DtObjectPublisher(DtExerciseConn* conn, const char* name = 0);
219  void init(RTI::ObjectClassHandle hand, DtStateRepository* stateRep,
220  DtStateRepository* asSeenByRemote, DtHlaStateEncoder* encoder = 0,
221  DtHlaStateDecoder* decoder = 0);
222  void init(const char* className, DtStateRepository* stateRep,
223  DtStateRepository* asSeenByRemote, DtHlaStateEncoder* encoder = 0,
224  DtHlaStateDecoder* decoder = 0);
225 };
226 
228 {
229  return myStateRep;
230 }
231 
233 {
234  return myStateRep;
235 }
236 
238 {
239  return myExConn;
240 }
241 
242 inline DtHlaObjectWithStateRep* DtObjectPublisher::hlaObject()
243 {
244  return myHlaObj;
245 }
246 
247 inline const DtObjectId& DtObjectPublisher::localId() const
248 {
249  return id();
250 }
251 
253 {
254  return myAsSeenByRemote;
255 }
256 
257 #endif //DtObjectPublisher_H_
258 #endif //DtHLA
259 
Contains the DtObjectId class declaration.
DtStateRepository * myStateRep
Definition: objectPublisherDIS.h:176
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnDIS.h:61
virtual DtStateRepository * stateRep()
Returns a pointer to the DtStateRepository - through which you can set or inspect current state infor...
Definition: objectPublisherDIS.h:215
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
Instances of DtObjectPublisher are used for local or source simulations of objects, (i.e.
Definition: objectPublisherDIS.h:36
This file contains typedefs used to represent objects in a protocol neutral way.
virtual const DtObjectId & id() const =0
The id is the same as the globalId, a DtEntityIdentifier unique to this object.
virtual DtStateRepository * sr()
Returns a pointer to the DtStateRepository - through which you can set or inspect current state infor...
Definition: objectPublisherDIS.h:220
virtual DtExerciseConn * exerciseConn()
Get our exercise connection.
Definition: objectPublisherDIS.h:225
DtStateRepository is an abstract base class for maintaining state for an object.
Definition: stateRepository.h:50
DtStateRepository * myAsSeenByRemote
Definition: objectPublisherDIS.h:177
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
DtExerciseConn * myExConn
Definition: objectPublisherDIS.h:175
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: objectPublisherDIS.h:230
virtual const DtObjectId & localId() const =0
The localId is the same as the globalId, a DtEntityIdentifier unique to this object.
This file contains typedefs for machine dependant types.

Document ID: Generated on Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)