A Binary Heap implemented specifically for the Timer class in Decaf Util.
More...
#include <src/main/decaf/internal/util/TimerTaskHeap.h>
A Binary Heap implemented specifically for the Timer class in Decaf Util.
- Since
- 1.0
◆ TimerTaskHeap()
| decaf::internal::util::TimerTaskHeap::TimerTaskHeap |
( |
| ) |
|
◆ ~TimerTaskHeap()
| virtual decaf::internal::util::TimerTaskHeap::~TimerTaskHeap |
( |
| ) |
|
|
virtual |
◆ adjustMinimum()
| void decaf::internal::util::TimerTaskHeap::adjustMinimum |
( |
| ) |
|
Resorts the heap starting at the top.
◆ deleteIfCancelled()
| 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.
- Returns
- the number of task that were removed from the heap becuase they were cancelled.
◆ find()
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.
- Returns
- the position in the Heap where the Task is stored, or npos.
◆ insert()
Inserts the specified Task into the heap, heap is reordered to reflect the addition of a new element.
- Parameters
-
| task | The TimerTask to insert into the heap. |
◆ isEmpty()
| bool decaf::internal::util::TimerTaskHeap::isEmpty |
( |
| ) |
const |
- Returns
- true if the heap is empty.
◆ peek()
Peaks at the Head of the Heap, returns the task with the nearest scheduled run time.
- Returns
- The TimerTask that is scheduled to be executed next if the Heap is empty a Null Pointer value is returned.
◆ remove()
| 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.
- Parameters
-
| pos | The position at which to remove the TimerTask and begin a resort of the heap. |
◆ reset()
| void decaf::internal::util::TimerTaskHeap::reset |
( |
| ) |
|
Clear all contents from the heap.
◆ size()
| std::size_t decaf::internal::util::TimerTaskHeap::size |
( |
| ) |
const |
- Returns
- the size of the heap.
The documentation for this class was generated from the following file: