An object that tracks scheduled events and automatically cancels them when it is destroyed. It is useful in situations where multiple instances of the same type of event can simultaneously be scheduled, and when the events should be limited to the lifetime of a container object. More...
#include <event-garbage-collector.h>
Classes | |
struct | EventIdLessThanTs |
Public Member Functions | |
EventGarbageCollector () | |
void | Track (EventId event) |
Tracks a new event. | |
~EventGarbageCollector () | |
Private Types | |
typedef std::multiset< EventId, EventIdLessThanTs > | EventList |
Private Member Functions | |
void | Cleanup () |
void | Grow () |
void | Shrink () |
Private Attributes | |
EventList::size_type | m_nextCleanupSize |
EventList | m_events |
An object that tracks scheduled events and automatically cancels them when it is destroyed. It is useful in situations where multiple instances of the same type of event can simultaneously be scheduled, and when the events should be limited to the lifetime of a container object.
Definition at line 36 of file event-garbage-collector.h.
typedef std::multiset<EventId, EventIdLessThanTs> ns3::EventGarbageCollector::EventList [private] |
Definition at line 59 of file event-garbage-collector.h.
ns3::EventGarbageCollector::EventGarbageCollector | ( | ) |
Definition at line 29 of file event-garbage-collector.cc.
ns3::EventGarbageCollector::~EventGarbageCollector | ( | ) |
Definition at line 78 of file event-garbage-collector.cc.
References ns3::Simulator::Cancel(), and m_events.
void ns3::EventGarbageCollector::Cleanup | ( | ) | [private] |
Definition at line 58 of file event-garbage-collector.cc.
References Grow(), m_events, m_nextCleanupSize, and Shrink().
Referenced by Track().
void ns3::EventGarbageCollector::Grow | ( | ) | [private] |
Definition at line 42 of file event-garbage-collector.cc.
References CLEANUP_CHUNK_MAX_SIZE, and m_nextCleanupSize.
void ns3::EventGarbageCollector::Shrink | ( | ) | [private] |
Definition at line 49 of file event-garbage-collector.cc.
References Grow(), m_events, and m_nextCleanupSize.
Referenced by Cleanup().
void ns3::EventGarbageCollector::Track | ( | EventId | event | ) |
Tracks a new event.
Definition at line 34 of file event-garbage-collector.cc.
References Cleanup(), m_events, and m_nextCleanupSize.
Referenced by ns3::olsr::AgentImpl::DupTupleTimerExpire(), ns3::olsr::AgentImpl::IfaceAssocTupleTimerExpire(), ns3::olsr::AgentImpl::LinkSensing(), ns3::olsr::AgentImpl::LinkTupleTimerExpire(), ns3::olsr::AgentImpl::MprSelTupleTimerExpire(), ns3::olsr::AgentImpl::Nb2hopTupleTimerExpire(), ns3::olsr::AgentImpl::PopulateMprSelectorSet(), ns3::olsr::AgentImpl::PopulateTwoHopNeighborSet(), ns3::olsr::AgentImpl::ProcessTc(), ns3::EventGarbageCollectorTests::RunTests(), and ns3::olsr::AgentImpl::TopologyTupleTimerExpire().
Definition at line 62 of file event-garbage-collector.h.
Referenced by Cleanup(), Shrink(), Track(), and ~EventGarbageCollector().
EventList::size_type ns3::EventGarbageCollector::m_nextCleanupSize [private] |