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