PriorityQueueCellArray< T, Key, GetKey, Container > Class Template Reference

A priority queue utilizing a cell array. More...

#include <PriorityQueueCellArray.h>

Inheritance diagram for PriorityQueueCellArray< T, Key, GetKey, Container >:
PriorityQueue< T, Key >

List of all members.

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_typecontainer_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.

Detailed Description

template<typename T, typename Key = typename std::iterator_traits<T>::value_type, class GetKey = Dereference<T>, class Container = std::vector<T>>
class PriorityQueueCellArray< T, Key, GetKey, Container >

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.

Parameters:
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.

Constructor & Destructor Documentation

template<typename T , typename Key = typename std::iterator_traits<T>::value_type, class GetKey = Dereference<T>, class Container = std::vector<T>>
PriorityQueueCellArray< T, Key, GetKey, Container >::PriorityQueueCellArray ( key_type  min_key,
key_type  delta,
key_type  span 
) [inline]

Make an empty priority queue.

Parameters:
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.

The documentation for this class was generated from the following file:
Generated on Thu Jun 30 02:14:52 2016 for Algorithms and Data Structures Package by  doxygen 1.6.3