18#ifndef _DECAF_INTERNAL_UTIL_TIMERTASKHEAP_H_
19#define _DECAF_INTERNAL_UTIL_TIMERTASKHEAP_H_
30 using decaf::lang::Pointer;
31 using decaf::util::TimerTask;
42 static const int DEFAULT_HEAP_SIZE = 256;
45 std::vector<Pointer<TimerTask> > heap;
118 void downHeap(std::size_t pos);
void reset()
Clear all contents from the heap.
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 adjustMinimum()
Resorts the heap starting at the top.
void remove(std::size_t pos)
Removes the Task at the specified position from the heap, resorts the heap from the position down to ...
std::size_t find(const Pointer< TimerTask > &task) const
Searches the heap for the specified TimerTask element and returns its position in the heap.
std::size_t deleteIfCancelled()
Runs through the heap removing all cancelled Tasks from it, this is not normally used but in case a a...
Pointer< TimerTask > peek()
Peaks at the Head of the Heap, returns the task with the nearest scheduled run time.
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition Pointer.h:53
#define DECAF_API
Definition Config.h:29
Definition ByteArrayAdapter.h:30
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25