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 uint32_t index =
Last ();
169 uint32_t index =
start;
174 uint32_t tmp =
Smallest (left, right);
232 for (uint32_t i = 1; i <
m_heap.size (); i++)
234 if (uid ==
m_heap[i].key.m_uid)
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint32_t Sibling(uint32_t id) const
Get the next sibling of a given entry.
virtual ~HeapScheduler()
Destructor.
ns3::EventImpl declarations.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
ns3::HeapScheduler declaration.
void TopDown(uint32_t start)
Percolate a deletion bubble down the heap.
virtual Scheduler::Event RemoveNext(void)
Remove the earliest event from the event list.
bool IsLessStrictly(uint32_t a, uint32_t b) const
Compare (less than) two items.
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.
virtual Scheduler::Event PeekNext(void) const
Get a pointer to the next event.
static TypeId GetTypeId(void)
Register this type.
bool IsRoot(uint32_t id) const
Test if an index is the root.
void Exch(uint32_t a, uint32_t b)
Swap two items.
uint32_t RightChild(uint32_t id) const
Get the right child index of a given entry.
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.
uint32_t Smallest(uint32_t a, uint32_t b) const
Minimum of two items.
virtual void Insert(const Scheduler::Event &ev)
Insert a new Event in the schedule.
BinaryHeap m_heap
The event list.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
HeapScheduler()
Constructor.
bool IsBottom(uint32_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.
uint32_t Last(void) const
Return the index of the last element.
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.
virtual bool IsEmpty(void) const
Test if the schedule is empty.
uint32_t Parent(uint32_t id) const
Get the parent index of a given entry.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint32_t Root(void) const
Get the root index of the heap.
uint32_t LeftChild(uint32_t id) const
Get the left child of a given entry.