|
|
| 28 |
: m_flags (0), |
28 |
: m_flags (0), |
| 29 |
m_delay (FemtoSeconds (0)), |
29 |
m_delay (FemtoSeconds (0)), |
| 30 |
m_event (), |
30 |
m_event (), |
| 31 |
m_impl (0) |
31 |
m_impl (0), |
|
|
32 |
m_collector (0) |
| 32 |
{} |
33 |
{} |
| 33 |
|
34 |
|
| 34 |
Timer::Timer (enum SchedulePolicy schedulePolicy, |
35 |
Timer::Timer (enum SchedulePolicy schedulePolicy, |
|
Lines 36-49
Timer::Timer (enum SchedulePolicy schedu
|
Link Here
|
|---|
|
| 36 |
: m_flags (schedulePolicy | destroyPolicy), |
37 |
: m_flags (schedulePolicy | destroyPolicy), |
| 37 |
m_delay (FemtoSeconds (0)), |
38 |
m_delay (FemtoSeconds (0)), |
| 38 |
m_event (), |
39 |
m_event (), |
| 39 |
m_impl (0) |
40 |
m_impl (0), |
|
|
41 |
m_collector (0) |
| 40 |
{} |
42 |
{} |
| 41 |
|
43 |
|
| 42 |
Timer::Timer (enum GarbageCollectPolicy policy) |
44 |
Timer::Timer (enum GarbageCollectPolicy policy) |
| 43 |
: m_flags (GARBAGE_COLLECT), |
45 |
: m_flags (GARBAGE_COLLECT), |
| 44 |
m_delay (FemtoSeconds (0)), |
46 |
m_delay (FemtoSeconds (0)), |
| 45 |
m_event (), |
47 |
m_event (), |
| 46 |
m_impl (0) |
48 |
m_impl (0), |
|
|
49 |
m_collector (new EventGarbageCollector) |
| 47 |
{} |
50 |
{} |
| 48 |
|
51 |
|
| 49 |
Timer::~Timer () |
52 |
Timer::~Timer () |
|
|
| 63 |
{ |
66 |
{ |
| 64 |
Simulator::Remove (m_event); |
67 |
Simulator::Remove (m_event); |
| 65 |
} |
68 |
} |
|
|
69 |
delete m_collector; |
| 66 |
delete m_impl; |
70 |
delete m_impl; |
| 67 |
} |
71 |
} |
| 68 |
|
72 |
|
|
Lines 167-173
Timer::Schedule (Time delay)
|
Link Here
|
|---|
|
| 167 |
m_event = m_impl->Schedule (delay); |
171 |
m_event = m_impl->Schedule (delay); |
| 168 |
if (m_flags & GARBAGE_COLLECT) |
172 |
if (m_flags & GARBAGE_COLLECT) |
| 169 |
{ |
173 |
{ |
| 170 |
SimulationSingleton<EventGarbageCollector>::Get ()->Track (m_event); |
174 |
m_collector->Track (m_event); |
| 171 |
} |
175 |
} |
| 172 |
} |
176 |
} |
| 173 |
|
177 |
|