MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
msgQueue.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2001 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: msgQueue.h,v $ $Revision: 1.20 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef DtRtiMsgQueue_H_
13 #define DtRtiMsgQueue_H_
14 
15 #include "rtiMsConfig.h"
16 #include "internalTypes.h"
17 #include <vlutil/vlHashlist.h>
18 #include "sortedList.h"
19 #include <memory>
20 
21 #if defined(DtIFSPEC1516) || defined(DtIFSPEC1516E)
22 #include <RTI/LogicalTime.h>
23 #include <RTI/LogicalTimeInterval.h>
24 #else
25 #ifdef DtIFSPEC13DLC
26 #include "RTI13.h"
27 #define RTI rti13
28 #else
29 #include "RTI.hh"
30 #endif
31 #endif
32 
33 class DtRtiMsg;
35 class DtInteractionMgr;
36 class DtObjectMgr;
37 
41 {
42 public:
43 
44  friend class DtRtiMsgQueue;
45 
46 public:
47 
49  virtual ~DtMessageItem();
50 
52  virtual bool operator<= (const DtSortedListItem& item) const;
53  virtual bool operator< (const DtSortedListItem& item) const;
54  virtual bool operator>= (const DtSortedListItem& item) const;
55  virtual bool operator> (const DtSortedListItem& item) const;
56  virtual bool operator== (const DtSortedListItem& item) const;
57 
59  virtual void printData(DtLogicalTimeFactory* logicalTimeFactory);
60 
62  virtual DtRtiMsg* msg();
63 
64 protected:
65 
67  DtMessageItem(void* data, DtLogicalTimeFactory* fedTimeFactory);
68 
69 protected:
72 };
73 
75 {
76  return myMsg;
77 }
78 
80 
82 {
83 
84 public:
85  DtRtiMsgQueue(DtLogicalTimeFactory* fedTimeFactory, DtObjectMgr* objMgr=0, DtInteractionMgr* intMgr=0);
86 
87  virtual ~DtRtiMsgQueue();
88 
90  virtual bool timeRegulating();
91  virtual void setTimeRegulating(bool isTimeRegulating);
92  virtual bool timeConstrained();
93  virtual void setTimeConstrained(bool isTimeConstrained);
94  virtual bool asynchronous();
95  virtual void setAsynchronous(bool isAsynchronous);
96  virtual bool timeAvailable();
97  virtual void setTimeAvailable(bool isTimeAvailable);
98  virtual bool timeAdvancing();
99  virtual void setTimeAdvancing(bool isTimeAdvancing);
100 
101 #ifdef DtIFSPEC1516
102 
103  virtual const rti1516::LogicalTime& timestamp();
104  virtual void setTimestamp(const rti1516::LogicalTime& federateTime);
105 
107  virtual const rti1516::LogicalTimeInterval& lookahead();
108  virtual void setLookahead(const rti1516::LogicalTimeInterval& lookaheadValue);
109 
114  virtual const rti1516::LogicalTime& galt();
115  virtual void setGalt(const rti1516::LogicalTime& federateTime);
116 
117 #elif defined(DtIFSPEC1516E)
118 
119  virtual const rti1516e::LogicalTime& timestamp();
120  virtual void setTimestamp(const rti1516e::LogicalTime& federateTime);
121 
123  virtual const rti1516e::LogicalTimeInterval& lookahead();
124  virtual void setLookahead(const rti1516e::LogicalTimeInterval& lookaheadValue);
125 
130  virtual const rti1516e::LogicalTime& galt();
131  virtual void setGalt(const rti1516e::LogicalTime& federateTime);
132 #else
133 
134  virtual const RTI::FedTime& timestamp();
135  virtual void setTimestamp(const RTI::FedTime& federateTime);
136 
138  virtual const RTI::FedTime& lookahead();
139  virtual void setLookahead(const RTI::FedTime& lookaheadValue);
140 
145  virtual const RTI::FedTime& galt();
146  virtual void setGalt(const RTI::FedTime& federateTime);
147 #endif
148 
149 
154  virtual bool queueMsg(DtRtiMsg const& msg);
155 
157  virtual void restoreMsg(DtRtiMsg const& msg);
158 
160  virtual DtRtiMsg* removeMsg(const DtMessageRetractionHandle& retractHandle);
161 
164  virtual bool deleteMsg(const DtMessageRetractionHandle& retractHandle);
165 
167  virtual void deleteMsgs(DtFederateHandle federateHandle);
168 
170  virtual void deleteAll();
171 
172 #ifdef DtIFSPEC1516
173 
174  virtual DtRtiMsg* nextMsg(const rti1516::LogicalTime& timestamp);
175 
177  virtual DtRtiMsg* nextTsoMsg(const rti1516::LogicalTime& timestamp);
178 #elif defined(DtIFSPEC1516E)
179 
180  virtual DtRtiMsg* nextMsg(const rti1516e::LogicalTime& timestamp);
181 
183  virtual DtRtiMsg* nextTsoMsg(const rti1516e::LogicalTime& timestamp);
184 #else
185 
186  virtual DtRtiMsg* nextMsg(const RTI::FedTime& timestamp);
187 
189  virtual DtRtiMsg* nextTsoMsg(const RTI::FedTime& timestamp);
190 #endif
191 
193  virtual DtRtiMsg* removeNextTsoMsg();
194 
196  virtual DtRtiMsg* peekNextTsoMsg();
197 
199  inline unsigned int roQueueLength() const;
200 
202  virtual void clean();
203 
205  virtual bool isDirty() const;
206 
207 protected:
208 
211  virtual DtSortedListItem* newItem(void* data);
212 
213  DtRtiMsgQueue(const DtRtiMsgQueue& orig);
214  DtRtiMsgQueue& operator=(DtRtiMsgQueue const& orig);
215 
217  virtual DtSortedListItem* add(void* data);
218 
221  virtual int evaluateSubscription(DtRtiMsg const& msg);
222 
223 protected:
224 
225  MAKRti::DtList myRoList;
231  bool myIsDirty;
235 #ifdef DtIFSPEC1516
236  std::auto_ptr <rti1516::LogicalTime> myTime;
237  std::auto_ptr <rti1516::LogicalTimeInterval> myLookahead;
238  std::auto_ptr <rti1516::LogicalTime> myGalt;
239 #elif defined(DtIFSPEC1516E)
240  std::auto_ptr <rti1516e::LogicalTime> myTime;
241  std::auto_ptr <rti1516e::LogicalTimeInterval> myLookahead;
242  std::auto_ptr <rti1516e::LogicalTime> myGalt;
243 #else
244  std::auto_ptr <RTI::FedTime> myTime;
245  std::auto_ptr <RTI::FedTime> myLookahead;
246  std::auto_ptr <RTI::FedTime> myGalt;
247 #endif
248 };
249 
251 {
253 }
254 
255 inline void DtRtiMsgQueue::setTimeRegulating(bool isTimeRegulating)
256 {
257  myTimeRegulatingEnabled = isTimeRegulating;
258 }
259 
261 {
263 }
264 
265 inline void DtRtiMsgQueue::setTimeConstrained(bool isTimeConstrained)
266 {
267  myTimeConstrainedEnabled = isTimeConstrained;
268 }
269 
271 {
272  return myAsynchronous;
273 }
274 
275 inline void DtRtiMsgQueue::setAsynchronous(bool isAsynchronous)
276 {
277  myAsynchronous = isAsynchronous;
278 }
279 
281 {
282  return myTimeAvailable;
283 }
284 
285 inline void DtRtiMsgQueue::setTimeAvailable(bool isTimeAvailable)
286 {
287  myTimeAvailable = isTimeAvailable;
288 }
289 
291 {
292  return myTimeAdvancing;
293 }
294 
295 inline void DtRtiMsgQueue::setTimeAdvancing(bool isTimeAdvancing)
296 {
297  myTimeAdvancing = isTimeAdvancing;
298 }
299 
300 #ifdef DtIFSPEC1516
301 inline const rti1516::LogicalTime& DtRtiMsgQueue::timestamp()
302 #elif defined(DtIFSPEC1516E)
303 inline const rti1516e::LogicalTime& DtRtiMsgQueue::timestamp()
304 #else
305 inline const RTI::FedTime& DtRtiMsgQueue::timestamp()
306 #endif
307 {
308  return *myTime;
309 }
310 
311 #ifdef DtIFSPEC1516
312 inline void DtRtiMsgQueue::setTimestamp(
313  const rti1516::LogicalTime& federateTime)
314 #elif defined(DtIFSPEC1516E)
315 inline void DtRtiMsgQueue::setTimestamp(
316  const rti1516e::LogicalTime& federateTime)
317 #else
318 inline void DtRtiMsgQueue::setTimestamp(const RTI::FedTime& federateTime)
319 #endif
320 {
321  *myTime = federateTime;
322 }
323 
324 #ifdef DtIFSPEC1516
325 inline const rti1516::LogicalTimeInterval& DtRtiMsgQueue::lookahead()
326 #elif defined(DtIFSPEC1516E)
327 inline const rti1516e::LogicalTimeInterval& DtRtiMsgQueue::lookahead()
328 #else
329 inline const RTI::FedTime& DtRtiMsgQueue::lookahead()
330 #endif
331 {
332  return *myLookahead;
333 }
334 
335 #ifdef DtIFSPEC1516
336 inline void DtRtiMsgQueue::setLookahead(
337  const rti1516::LogicalTimeInterval& lookaheadValue)
338 #elif defined(DtIFSPEC1516E)
339 inline void DtRtiMsgQueue::setLookahead(
340  const rti1516e::LogicalTimeInterval& lookaheadValue)
341 #else
342 inline void DtRtiMsgQueue::setLookahead(const RTI::FedTime& lookaheadValue)
343 #endif
344 {
345  *myLookahead = lookaheadValue;
346 }
347 
348 #ifdef DtIFSPEC1516
349 inline const rti1516::LogicalTime& DtRtiMsgQueue::galt()
350 #elif defined(DtIFSPEC1516E)
351 inline const rti1516e::LogicalTime& DtRtiMsgQueue::galt()
352 #else
353 inline const RTI::FedTime& DtRtiMsgQueue::galt()
354 #endif
355 {
356  return *myGalt;
357 }
358 
359 #ifdef DtIFSPEC1516
360 inline void DtRtiMsgQueue::setGalt(const rti1516::LogicalTime& federateTime)
361 #elif defined(DtIFSPEC1516E)
362 inline void DtRtiMsgQueue::setGalt(const rti1516e::LogicalTime& federateTime)
363 #else
364 inline void DtRtiMsgQueue::setGalt(const RTI::FedTime& federateTime)
365 #endif
366 {
367  *myGalt = federateTime;
368 }
369 
370 inline unsigned int DtRtiMsgQueue::roQueueLength() const
371 {
372  return myRoList.count();
373 }
374 
375 #endif

Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)