MAK RTIspy API Documentation for HLA 1516
 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 
198  inline unsigned int roQueueLength() const;
199 
200 protected:
201 
204  virtual DtSortedListItem* newItem(void* data);
205 
206  DtRtiMsgQueue(const DtRtiMsgQueue& orig);
207  DtRtiMsgQueue& operator=(DtRtiMsgQueue const& orig);
208 
210  virtual DtSortedListItem* add(void* data);
211 
214  virtual int evaluateSubscription(DtRtiMsg const& msg);
215 
216 protected:
217 
218  MAKRti::DtList myRoList;
227 #ifdef DtIFSPEC1516
228  std::auto_ptr <rti1516::LogicalTime> myTime;
229  std::auto_ptr <rti1516::LogicalTimeInterval> myLookahead;
230  std::auto_ptr <rti1516::LogicalTime> myGalt;
231 #elif defined(DtIFSPEC1516E)
232  std::auto_ptr <rti1516e::LogicalTime> myTime;
233  std::auto_ptr <rti1516e::LogicalTimeInterval> myLookahead;
234  std::auto_ptr <rti1516e::LogicalTime> myGalt;
235 #else
236  std::auto_ptr <RTI::FedTime> myTime;
237  std::auto_ptr <RTI::FedTime> myLookahead;
238  std::auto_ptr <RTI::FedTime> myGalt;
239 #endif
240 };
241 
243 {
245 }
246 
247 inline void DtRtiMsgQueue::setTimeRegulating(bool isTimeRegulating)
248 {
249  myTimeRegulatingEnabled = isTimeRegulating;
250 }
251 
253 {
255 }
256 
257 inline void DtRtiMsgQueue::setTimeConstrained(bool isTimeConstrained)
258 {
259  myTimeConstrainedEnabled = isTimeConstrained;
260 }
261 
263 {
264  return myAsynchronous;
265 }
266 
267 inline void DtRtiMsgQueue::setAsynchronous(bool isAsynchronous)
268 {
269  myAsynchronous = isAsynchronous;
270 }
271 
273 {
274  return myTimeAvailable;
275 }
276 
277 inline void DtRtiMsgQueue::setTimeAvailable(bool isTimeAvailable)
278 {
279  myTimeAvailable = isTimeAvailable;
280 }
281 
283 {
284  return myTimeAdvancing;
285 }
286 
287 inline void DtRtiMsgQueue::setTimeAdvancing(bool isTimeAdvancing)
288 {
289  myTimeAdvancing = isTimeAdvancing;
290 }
291 
292 #ifdef DtIFSPEC1516
294 #elif defined(DtIFSPEC1516E)
296 #else
298 #endif
299 {
300  return *myTime;
301 }
302 
303 #ifdef DtIFSPEC1516
304 inline void DtRtiMsgQueue::setTimestamp(
305  const rti1516::LogicalTime& federateTime)
306 #elif defined(DtIFSPEC1516E)
307 inline void DtRtiMsgQueue::setTimestamp(
308  const rti1516e::LogicalTime& federateTime)
309 #else
310 inline void DtRtiMsgQueue::setTimestamp(const RTI::FedTime& federateTime)
311 #endif
312 {
313  *myTime = federateTime;
314 }
315 
316 #ifdef DtIFSPEC1516
318 #elif defined(DtIFSPEC1516E)
320 #else
322 #endif
323 {
324  return *myLookahead;
325 }
326 
327 #ifdef DtIFSPEC1516
328 inline void DtRtiMsgQueue::setLookahead(
329  const rti1516::LogicalTimeInterval& lookaheadValue)
330 #elif defined(DtIFSPEC1516E)
331 inline void DtRtiMsgQueue::setLookahead(
332  const rti1516e::LogicalTimeInterval& lookaheadValue)
333 #else
334 inline void DtRtiMsgQueue::setLookahead(const RTI::FedTime& lookaheadValue)
335 #endif
336 {
337  *myLookahead = lookaheadValue;
338 }
339 
340 #ifdef DtIFSPEC1516
342 #elif defined(DtIFSPEC1516E)
344 #else
346 #endif
347 {
348  return *myGalt;
349 }
350 
351 #ifdef DtIFSPEC1516
352 inline void DtRtiMsgQueue::setGalt(const rti1516::LogicalTime& federateTime)
353 #elif defined(DtIFSPEC1516E)
354 inline void DtRtiMsgQueue::setGalt(const rti1516e::LogicalTime& federateTime)
355 #else
356 inline void DtRtiMsgQueue::setGalt(const RTI::FedTime& federateTime)
357 #endif
358 {
359  *myGalt = federateTime;
360 }
361 
362 inline unsigned int DtRtiMsgQueue::roQueueLength() const
363 {
364  return myRoList.count();
365 }
366 
367 #endif

Document ID: Generated on Wed Mar 11 20:26:49 EDT 2015 from SVN revision 150939
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)