MAK RTIspy API Documentation for HLA 1.3
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
libsrc
RTI
retractList.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 2001 MaK Technologies, Inc.
3
** All rights reserved.
4
*********************************************************************/
5
/*********************************************************************
6
** $RCSfile: retractList.h,v $ $Revision: 1.17 $ $State: Exp $
7
*********************************************************************/
8
11
12
#ifndef DtRetractInfoList_H_
13
#define DtRetractInfoList_H_
14
15
#include "
rtiMsConfig.h
"
16
#include <memory>
17
#include <vlutil/vlHashlist.h>
18
#include "
sortedList.h
"
19
#include <set>
20
21
#if defined(DtIFSPEC1516) || defined(DtIFSPEC1516E)
22
#include <RTI/RTI1516.h>
23
#else
24
#ifdef DtIFSPEC13DLC
25
#include "
RTI13.h
"
26
#define RTI rti13
27
#else
28
#include "RTI.hh"
29
#endif
30
#endif
31
32
#ifdef DtIFSPEC1516
33
#define DtFEDTIME rti1516::LogicalTime
34
#elif defined(DtIFSPEC1516E)
35
#define DtFEDTIME rti1516e::LogicalTime
36
#else
37
#define DtFEDTIME RTI::FedTime
38
#endif
39
41
42
class
DtRtiMsg
;
43
class
DtLogicalTimeFactory
;
44
47
class
DT_DLL_LRC
DtRetractInfo
48
{
49
public
:
50
52
DtRetractInfo
(
unsigned
long
value,
53
std::auto_ptr <DtFEDTIME> timePtr);
54
56
virtual
~
DtRetractInfo
();
57
59
virtual
void
setTime(
DtFEDTIME
const
& timeVal);
60
virtual
DtFEDTIME
const
& time()
const
;
61
63
unsigned
long
serialNumber();
64
void
setSerialNumber(
unsigned
long
value);
65
66
protected
:
67
explicit
DtRetractInfo
();
68
69
protected
:
70
std::auto_ptr <DtFEDTIME>
myTime
;
71
unsigned
long
mySerialNumber
;
72
};
73
74
inline
DtFEDTIME
const
&
DtRetractInfo::time
()
const
75
{
return
*
myTime
;}
76
inline
void
DtRetractInfo::setTime
(
DtFEDTIME
const
& timeVal)
77
{*
myTime
= timeVal;}
78
79
inline
unsigned
long
DtRetractInfo::serialNumber
()
80
{
return
mySerialNumber
;}
81
inline
void
DtRetractInfo::setSerialNumber
(
unsigned
long
value)
82
{
mySerialNumber
= value;}
83
84
// TODO consider optimizing by using set instead of constructor for static initialization (or reuse)
85
class
DT_DLL_LRC
DtRetractInfoTester
:
public
DtRetractInfo
86
{
87
public
:
88
90
DtRetractInfoTester
(
DtFEDTIME
* timePtr) :
DtRetractInfo
(0, std::auto_ptr<
DtFEDTIME
>(0))
91
, myPtr(timePtr)
92
{
93
}
95
virtual
DtFEDTIME
const
&
time
()
const
96
{
97
return
*(
DtFEDTIME
*)myPtr;
98
}
99
100
DtFEDTIME
*
myPtr
;
101
};
102
103
struct
DtRetractionInfoComparator
104
{
105
bool
operator()
(
DtRetractInfo
* arg1,
DtRetractInfo
* arg2)
const
106
{
107
return
arg1->
time
() < arg2->
time
();
108
}
109
};
110
111
struct
DtSerialNumberFinder
112
{
113
explicit
DtSerialNumberFinder
(
unsigned
long
i) :
n
(i) { }
114
inline
bool
operator()
(
DtRetractInfo
* m)
const
{
return
m->
serialNumber
() ==
n
; }
115
private
:
116
unsigned
long
n
;
117
};
118
typedef
std::multiset<DtRetractInfo*, DtRetractionInfoComparator>
DtRetractionInfoListType
;
119
class
DT_DLL_LRC
DtRetractInfoList
:
public
DtRetractionInfoListType
120
{
121
122
public
:
123
DtRetractInfoList
(
DtLogicalTimeFactory
* logicalTimeFactory);
124
125
virtual
~
DtRetractInfoList
();
126
128
virtual
DtRetractInfo
* add(
DtRetractInfo
* info);
129
131
virtual
DtRetractInfo
* add(
const
DtRtiMsg
& msg);
132
134
virtual
void
deleteAll(
DtFEDTIME
const
& time);
135
137
virtual
DtRetractInfo
* removeByNumber(
unsigned
long
serialNumber);
138
140
virtual
void
deleteByNumber(
unsigned
long
serialNumber);
141
143
virtual
DtRetractInfo
* lookupByNumber(
unsigned
long
serialNumber);
144
148
virtual
DtRetractInfo
* firstRetractItem()
const
;
149
virtual
DtRetractInfo
* lastRetractItem()
const
;
150
154
virtual
DtRetractInfo
* minRetraction(
DtFEDTIME
const
& lower,
155
DtFEDTIME
const
& upper,
bool
includeLower,
bool
includeUpper)
const
;
156
157
protected
:
159
virtual
DtRetractInfo
* lookupItem(
unsigned
long
serialNumber);
160
162
DtRetractInfoList
(
const
DtRetractInfoList
& orig);
163
DtRetractInfoList
& operator=(
DtRetractInfoList
const
& orig);
164
protected
:
165
DtLogicalTimeFactory
*
myLogicalTimeFactory
;
166
};
167
168
inline
DtRetractInfo
*
DtRetractInfoList::firstRetractItem
()
const
169
{
170
return
*begin();
171
}
172
173
inline
DtRetractInfo
*
DtRetractInfoList::lastRetractItem
()
const
174
{
175
return
*rbegin();
176
}
177
178
#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
)