An object that tracks scheduled events and automatically cancels them when it is destroyed. More...
#include <event-garbage-collector.h>
Classes | |
struct | EventIdLessThanTs |
Public Member Functions | |
EventGarbageCollector () | |
~EventGarbageCollector () | |
void | Track (EventId event) |
Tracks a new event. More... | |
Private Types | |
typedef std::multiset< EventId, EventIdLessThanTs > | EventList |
Private Member Functions | |
void | Cleanup () |
void | Grow () |
void | Shrink () |
Private Attributes | |
EventList | m_events |
EventList::size_type | m_nextCleanupSize |
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 38 of file event-garbage-collector.h.
|
private |
Definition at line 61 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 79 of file event-garbage-collector.cc.
References ns3::Simulator::Cancel(), and m_events.
|
private |
Definition at line 59 of file event-garbage-collector.cc.
References Grow(), m_events, m_nextCleanupSize, and Shrink().
Referenced by Track().
|
private |
Definition at line 43 of file event-garbage-collector.cc.
References CLEANUP_CHUNK_MAX_SIZE, and m_nextCleanupSize.
Referenced by Cleanup(), and Shrink().
|
private |
Definition at line 50 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 35 of file event-garbage-collector.cc.
References Cleanup(), m_events, and m_nextCleanupSize.
Referenced by ns3::olsr::RoutingProtocol::AssociationTupleTimerExpire(), ns3::EventGarbageCollectorTestCase::DoRun(), ns3::olsr::RoutingProtocol::DupTupleTimerExpire(), ns3::olsr::RoutingProtocol::IfaceAssocTupleTimerExpire(), ns3::olsr::RoutingProtocol::LinkSensing(), ns3::olsr::RoutingProtocol::LinkTupleTimerExpire(), ns3::olsr::RoutingProtocol::MprSelTupleTimerExpire(), ns3::olsr::RoutingProtocol::Nb2hopTupleTimerExpire(), ns3::olsr::RoutingProtocol::PopulateMprSelectorSet(), ns3::olsr::RoutingProtocol::PopulateTwoHopNeighborSet(), ns3::olsr::RoutingProtocol::ProcessTc(), and ns3::olsr::RoutingProtocol::TopologyTupleTimerExpire().
|
private |
Definition at line 64 of file event-garbage-collector.h.
Referenced by Cleanup(), Shrink(), Track(), and ~EventGarbageCollector().
|
private |