a binary heap event scheduler More...
#include <heap-scheduler.h>
Public Member Functions | |
virtual void | Insert (const EventId &id) |
virtual bool | IsEmpty (void) const |
virtual EventId | PeekNext (void) const |
virtual EventId | RemoveNext (void) |
virtual bool | Remove (const EventId &ev) |
a binary heap event scheduler
This code started as a c++ translation of a java-based code written in 2005 to implement a heap sort. So, this binary heap is really a pretty straightforward implementation of the classic data structure. Not much to say about it.
What is smart about this code ?
virtual void ns3::HeapScheduler::Insert | ( | const EventId & | id | ) | [virtual] |
id | event to store in the event list |
This method takes ownership of the event pointer.
Implements ns3::Scheduler.
virtual bool ns3::HeapScheduler::IsEmpty | ( | void | ) | const [virtual] |
Implements ns3::Scheduler.
virtual EventId ns3::HeapScheduler::PeekNext | ( | void | ) | const [virtual] |
This method cannot be invoked if the list is empty.
Implements ns3::Scheduler.
virtual bool ns3::HeapScheduler::Remove | ( | const EventId & | id | ) | [virtual] |
id | the id of the event to remove |
This methods cannot be invoked if the list is empty.
Implements ns3::Scheduler.
virtual EventId ns3::HeapScheduler::RemoveNext | ( | void | ) | [virtual] |
This method cannot be invoked if the list is empty. Remove the next earliest event from the event list.
Implements ns3::Scheduler.