A priority queue utilizing a cell array. More...
#include <PriorityQueueCellArray.h>
Public Types | |
| typedef base_type::element_type | element_type |
| The element type. | |
| typedef base_type::key_type | key_type |
| The key type. | |
| typedef base_type::size_type | size_type |
| The size type. | |
| typedef Container | container_type |
| The container type. | |
| typedef const container_type & | container_const_reference |
| A const reference to a container. | |
| typedef container_type::value_type | value_type |
| The value type. | |
| typedef container_type::reference | reference |
| A reference to the value type. | |
|
typedef container_type::const_reference | const_reference |
| A const reference to the value type. | |
| typedef container_type::iterator | iterator |
| An iterator in the container. | |
|
typedef container_type::const_iterator | const_iterator |
| A const iterator in the container. | |
Public Member Functions | |
| PriorityQueueCellArray (key_type min_key, key_type delta, key_type span) | |
| Make an empty priority queue. | |
| virtual | ~PriorityQueueCellArray () |
| Destructor. | |
| container_const_reference | top () const |
| Return the container at the top of the priority queue. | |
| size_type | size () const |
| Return the number of elements in the priority queue. | |
| bool | empty () const |
| Return true if the priority queue is empty. | |
| key_type | lower_bound () const |
| A lower bound on the keys stored in the top cell. | |
| void | push (element_type x) |
| Insert an element into the priority queue. | |
| void | push (element_type x, key_type k) |
| Add an element with the specified key to the priority queue. | |
| void | pop () |
| Clear the container at the top of the priority queue. | |
A priority queue utilizing a cell array.
This priority queue stores elements that have numeric keys. For example, the value type might be a handle to an object and the key type might be a floating point number.
This is an approximate priority queue. You specify the span of a cell in the constructor.
| T | is the element type. | |
| Key | is the key type. | |
| GetKey | is the functor that gets the key from the element. | |
| Container | is a container for the value type. It must have a push_back() member function. |
| PriorityQueueCellArray< T, Key, GetKey, Container >::PriorityQueueCellArray | ( | key_type | min_key, | |
| key_type | delta, | |||
| key_type | span | |||
| ) | [inline] |
Make an empty priority queue.
| min_key | is a lower bound on the keys to be stored. | |
| delta | is the span of a single cell. | |
| span | is the difference between the upper and lower bounds on the keys that are held at any one time. |
1.6.3