A Binary Heap implemented specifically for the Timer class in Decaf Util. More...
#include <src/main/decaf/internal/util/TimerTaskHeap.h>
Public Member Functions | |
| TimerTaskHeap () | |
| virtual | ~TimerTaskHeap () |
| Pointer< TimerTask > | peek () |
| Peaks at the Head of the Heap, returns the task with the nearest scheduled run time. | |
| bool | isEmpty () const |
| std::size_t | size () const |
| void | insert (const Pointer< TimerTask > &task) |
| Inserts the specified Task into the heap, heap is reordered to reflect the addition of a new element. | |
| void | remove (std::size_t pos) |
| Removes the Task at the specified position from the heap, resorts the heap from the position down to the bottom. | |
| void | reset () |
| Clear all contents from the heap. | |
| void | adjustMinimum () |
| Resorts the heap starting at the top. | |
| std::size_t | deleteIfCancelled () |
| Runs through the heap removing all cancelled Tasks from it, this is not normally used but in case a a cancellation of a large number of tasks the user can perform this purge. | |
| std::size_t | find (const Pointer< TimerTask > &task) const |
| Searches the heap for the specified TimerTask element and returns its position in the heap. | |
A Binary Heap implemented specifically for the Timer class in Decaf Util.
| decaf::internal::util::TimerTaskHeap::TimerTaskHeap | ( | ) |
| virtual decaf::internal::util::TimerTaskHeap::~TimerTaskHeap | ( | ) | [virtual] |
| void decaf::internal::util::TimerTaskHeap::adjustMinimum | ( | ) |
Resorts the heap starting at the top.
| std::size_t decaf::internal::util::TimerTaskHeap::deleteIfCancelled | ( | ) |
Runs through the heap removing all cancelled Tasks from it, this is not normally used but in case a a cancellation of a large number of tasks the user can perform this purge.
Searches the heap for the specified TimerTask element and returns its position in the heap.
Returns the unsigned equivalent of -1 if the element is not found.
Inserts the specified Task into the heap, heap is reordered to reflect the addition of a new element.
| task | The TimerTask to insert into the heap. |
| bool decaf::internal::util::TimerTaskHeap::isEmpty | ( | ) | const |
Peaks at the Head of the Heap, returns the task with the nearest scheduled run time.
| void decaf::internal::util::TimerTaskHeap::remove | ( | std::size_t | pos | ) |
Removes the Task at the specified position from the heap, resorts the heap from the position down to the bottom.
| pos | The position at which to remove the TimerTask and begin a resort of the heap. |
| void decaf::internal::util::TimerTaskHeap::reset | ( | ) |
Clear all contents from the heap.
| std::size_t decaf::internal::util::TimerTaskHeap::size | ( | ) | const |
1.6.1