45 .SetGroupName (
"Core")
102 return (
id ==
Root ()) ? true :
false;
109 return m_heap.size () - 1;
117 return (
id >=
m_heap.size ()) ?
true :
false;
149 return (
m_heap.size () == 1) ?
true :
false;
156 std::size_t index =
Last ();
169 std::size_t index =
start;
174 std::size_t tmp =
Smallest (left, right);
232 for (std::size_t i = 1; i <
m_heap.size (); i++)
234 if (uid ==
m_heap[i].key.m_uid)
virtual Scheduler::Event PeekNext(void) const
Get a pointer to the next event.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual ~HeapScheduler()
Destructor.
ns3::EventImpl declarations.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
std::size_t Last(void) const
Return the index of the last element.
ns3::HeapScheduler declaration.
bool IsRoot(std::size_t id) const
Test if an index is the root.
std::size_t Parent(std::size_t id) const
Get the parent index of a given entry.
virtual Scheduler::Event RemoveNext(void)
Remove the earliest event from the event list.
EventImpl * impl
Pointer to the event implementation.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
std::size_t Sibling(std::size_t id) const
Get the next sibling of a given entry.
static TypeId GetTypeId(void)
Register this type.
bool IsLessStrictly(std::size_t a, std::size_t b) const
Compare (less than) two items.
make Callback use a separate empty type
a binary heap event scheduler
EventKey key
Key for sorting and ordering Events.
uint32_t m_uid
Event unique id.
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
virtual void Insert(const Scheduler::Event &ev)
Insert a new Event in the schedule.
std::size_t RightChild(std::size_t id) const
Get the right child index of a given entry.
std::size_t LeftChild(std::size_t id) const
Get the left child of a given entry.
BinaryHeap m_heap
The event list.
void Exch(std::size_t a, std::size_t b)
Swap two items.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
HeapScheduler()
Constructor.
std::size_t Root(void) const
Get the root index of the heap.
virtual bool IsEmpty(void) const
Test if the schedule is empty.
bool IsBottom(std::size_t id) const
Test if an index is at the bottom of the heap.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
virtual void Remove(const Scheduler::Event &ev)
Remove a specific event from the event list.
void BottomUp(void)
Percolate a newly inserted Last item to its proper position.
std::size_t Smallest(std::size_t a, std::size_t b) const
Minimum of two items.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void TopDown(std::size_t start)
Percolate a deletion bubble down the heap.