VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
reflectedObjectHLA.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 DtHlaReflectedObject_H_
10 #define DtHlaReflectedObject_H_
11 
12 
13 #include "globalObjectDesignator.h"
14 #include "hlaObjectWithStateRep.h"
16 #include "reflectedObjectListHLA.h"
17 #include "objectId.h"
18 
23 
27 class DT_DLL_VL DtStateMsg;
29 
35 
37 {
38  friend class DtReflectedObjectList;
39 
40 public:
41 
43  typedef DtStateRepository* (*DtBaseStateRepCreator)();
44 
45 public:
46 
49  DtStateRepository* stateRep);
50 
54  DtExerciseConn* conn, DtBaseStateRepCreator creator);
55 
58  DtReflectedObject(const DtObjectId& id,
59  const DtGlobalObjectDesignator& des,
60  DtExerciseConn* conn, DtBaseStateRepCreator creator);
61 
63  virtual ~DtReflectedObject();
64 
67  virtual DtStateRepository* stateRep() const;
68 
70  virtual DtStateRepository* sr() const;
71 
74  virtual DtHlaStateDecoder* decoder();
75 
78  virtual DtHlaObjectWithStateRep* hlaObject() const;
79 
81  virtual const DtObjectId& objectId() const;
82 
84  virtual const DtObjectId& id() const;
85 
87  virtual const DtObjectId& localId() const;
88 
90  virtual const DtString& name() const;
91 
94  virtual const DtGlobalObjectDesignator& globalId() const;
95 
96 #if DtHLA_1516_EVOLVED
97  virtual const DtString& lastProducingFederate() const;
101 #endif
102 
105  virtual DtTime lastSimTimeUpdated() const;
106 
109  virtual DtTime lastReceivedTimeStamp() const;
110 
113 
114  virtual DtTime keyTime() const;
115  virtual void setKeyTime(DtTime timeValue);
117 
119  virtual void baseAddPostUpdateCallback(
120  DtReflectedObjectCallbackFunction cb, void* userData);
121  virtual void baseRemovePostUpdateCallback(
122  DtReflectedObjectCallbackFunction cb, void* userData);
123 
125  virtual DtReflectedObject* nextObj() const;
126 
128  virtual DtReflectedObject* prevObj() const;
129 
132  virtual DtReflectedObject* wrapNextObj() const;
133 
136  virtual DtReflectedObject* wrapPrevObj() const;
137 
142  void setHlaObject(DtHlaObject* obj,
143  DtHlaStateDecoder* decoder = NULL);
144 
147  virtual void setNoHlaObject(const DtObjectId& id,
148  const DtGlobalObjectDesignator& des);
149 
152  void detachHlaObject();
153 
155  virtual void requestUpdate();
156 
157 protected:
158 
161 
164 
166  virtual void processPostUpdateCallbacks();
167 
168 protected:
169 
171  static void processPostUpdateCallbacksCb(
172  const DtStateMsg& stateMsg,
173  DtHlaObject* obj,
174  void* usr);
175 
176 protected:
177 
186 
187  //This variable is maintained privately by the parent list so that nextObj functions work
188  DtRefHlaObjectMap::iterator myReflIterator;
190 };
191 
192 
194 {
195  return id();
196 }
197 
199 {
200  return myStateRep;
201 }
202 
204 {
205  return myStateRep;
206 }
207 
209 {
210  return myHlaObj;
211 }
212 
214 {
215  if(myReflMap)
216  {
217  DtRefHlaObjectMap::iterator nextIter = myReflIterator;
218  ++nextIter;
219  if(nextIter != myReflMap->end())
220  {
221  return nextIter->second;
222  }
223  }
224  return 0;
225 }
226 
228 {
229  if(myReflMap)
230  {
231  DtRefHlaObjectMap::iterator nextIter = myReflIterator;
232  if(nextIter != myReflMap->begin())
233  {
234  --nextIter;
235  return nextIter->second;
236  }
237  }
238  return 0;
239 }
240 
242 {
243  if(myReflMap)
244  {
245  DtReflectedObject* obj = nextObj();
246  if(obj)
247  {
248  return obj;
249  }
250  else
251  {
252  if(!myReflMap->empty())
253  {
254  return myReflMap->begin()->second;
255  }
256  return 0;
257  }
258  }
259  return 0;
260 }
261 
263 {
264  if(myReflMap)
265  {
266  DtReflectedObject* obj = prevObj();
267  if(obj)
268  {
269  return obj;
270  }
271  else
272  {
273  if(!myReflMap->empty())
274  {
275  return myReflMap->rend()->second;
276  }
277  return 0;
278  }
279  }
280  return 0;
281 }
282 
283 #endif
284 #endif
285 
Contains the DtObjectId class declaration.
class DtReflectedObjectList
Definition: reflectedObjectListHLA.h:58
DtHlaStateDecoder * myDecoder
Definition: reflectedObjectHLA.h:181
virtual DtHlaObjectWithStateRep * hlaObject() const
Get the entity's hlaObject (DtHlaObjectWithStateRep is derived from DtHlaObject). ...
Definition: reflectedObjectHLA.h:208
Contains the HLA DtReflectedObjectList class declaration.
std::map< DtObjectId, DtReflectedObject * > DtRefHlaObjectMap
Definition: reflectedObjectListHLA.h:47
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.
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
virtual DtReflectedObject * wrapPrevObj() const
Get the previous remote object.
Definition: reflectedObjectHLA.h:262
virtual const DtObjectId & localId() const
Get the HLA object&#39;s id (local ID).
Definition: reflectedObjectHLA.h:193
virtual DtReflectedObject * nextObj() const
Get the next remote object.
Definition: reflectedObjectHLA.h:213
This file contains typedefs used to represent objects in a protocol neutral way.
virtual DtStateRepository * stateRep() const
Returns a pointer to the StateRepository - through which you can inspect current state information...
Definition: reflectedObjectHLA.h:198
virtual DtReflectedObject * prevObj() const
Get the previous remote object.
Definition: reflectedObjectHLA.h:227
DtObjectId myId
Definition: reflectedObjectHLA.h:183
An intrusive list is a list that assumes that the elements that you add are pointers to instances of ...
Definition: vlList.h:196
DtReflectedObjectList & operator=(const DtReflectedObjectList &orig)
assignment operator – not implemented
Instances of DtHlaObject are used to represent HLA objects which are communicated across the network...
Definition: hlaObject.h:58
DtHlaObjectWithStateRep * myHlaObj
Definition: reflectedObjectHLA.h:179
class DtReflectedObject:
Definition: reflectedObjectHLA.h:36
DtHlaStateDecoder is used to provide decoding of a state message into a state repository in an HLA (a...
Definition: hlaStateDecoder.h:34
DtString myName
Definition: reflectedObjectHLA.h:184
virtual DtReflectedObject * wrapNextObj() const
Get the next remote object.
Definition: reflectedObjectHLA.h:241
DtStateRepository is an abstract base class for maintaining state for an object.
Definition: stateRepository.h:50
DtStateRepository * myStateRep
Definition: reflectedObjectHLA.h:180
DtExerciseConn * myExConn
Definition: reflectedObjectHLA.h:178
DtRefHlaObjectMap * myReflMap
Definition: reflectedObjectHLA.h:189
DtRefHlaObjectMap::iterator myReflIterator
Definition: reflectedObjectHLA.h:188
virtual DtStateRepository * sr() const
Synonym for stateRep().
Definition: reflectedObjectHLA.h:203
DtObjectId instances are used to represent RTI::ObjectInstances in VR-Link.
Definition: objectId.h:38
DtTime myKeyTime
Definition: reflectedObjectHLA.h:185
void(* DtReflectedObjectCallbackFunction)(DtReflectedObject *obj, void *userData)
Callback function that takes a DtReflectedObject and user data.
Definition: reflectedObjectCallbackInfo.h:19
Instances of DtString are used to represent strings.
Definition: vlString.h:29
DtIntrusiveList myStateUpdateCallbacks
Definition: reflectedObjectHLA.h:182
virtual const DtObjectId & id() const
Get the HLA object&#39;s id (local ID).
class DtStateMsg:
Definition: stateMsgHLA.h:32
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)