PriorityQueueBinaryHeapArray< T, Key, GetKey, CompareKeys, Sequence > Class Template Reference

A binary heap priority queue for the data in an array. More...

#include <PriorityQueueBinaryHeapArray.h>

Inheritance diagram for PriorityQueueBinaryHeapArray< T, Key, GetKey, CompareKeys, Sequence >:
PriorityQueueBinaryHeapDynamicKeys< T, HeapHandleArray< T, Sequence::iterator >, Key, GetKey, CompareKeys, Sequence > PriorityQueue< T, Key, GetKey, CompareKeys, Sequence >

List of all members.

Public Types

typedef base_type::element_type element_type
 The element type.
typedef base_type::const_reference const_reference
 A const reference to the element type.
typedef base_type::key_type key_type
 The key type.
typedef base_type::size_type size_type
 The size type.
typedef base_type::value_type value_type
 The type stored in the binary heap.
typedef base_type::iterator iterator
 An iterator on the value type.

Public Member Functions

template<class DataArray >
 PriorityQueueBinaryHeapArray (const DataArray &data_array, const sequence_type &container=sequence_type())
 Make from a container of values.
template<class DataArray >
 PriorityQueueBinaryHeapArray (const DataArray &data_array, size_type n)
 Construct and reserve memory for n elements.
template<class DataArray , class InputIterator >
 PriorityQueueBinaryHeapArray (const DataArray &data_array, InputIterator first, InputIterator last, const sequence_type &container=sequence_type())
 Add the values in the range to the container then make the heap.
virtual ~PriorityQueueBinaryHeapArray ()
 Destructor.

Protected Attributes

heap_handle_array_type _heap_handles
 The array of heap handles.

Detailed Description

template<typename T, typename Key = typename std::iterator_traits<T>::value_type, class GetKey = Dereference<T>, class CompareKeys = std::less<Key>, class Sequence = std::vector<T>>
class PriorityQueueBinaryHeapArray< T, Key, GetKey, CompareKeys, Sequence >

A binary heap priority queue for the data in an array.

This priority queue is designed for storing handles into an array. It derives functionality from ads::PriorityQueueBinaryHeapDynamicKeys and thus supports dynamic keys. The element type is the only required parameter. The remaining parameters have default values. By default, it is assumed that the element type is a handle and that the key is obtained by dereferencing this handle.

Parameters:
T is the element type.
Key is the key type.
GetKey is the functor that gets the key from the element.
CompareKeys is a functor that takes two keys as arguments and returns a boolean. It is used to order the objects in the priority queue. For less than comparisons, the top of the priority queue holds the element with minimum key. This is the default behavior.
Sequence is the container for the binary heap. It is std::vector<T> by default.

Constructor & Destructor Documentation

template<typename T , typename Key = typename std::iterator_traits<T>::value_type, class GetKey = Dereference<T>, class CompareKeys = std::less<Key>, class Sequence = std::vector<T>>
template<class DataArray >
PriorityQueueBinaryHeapArray< T, Key, GetKey, CompareKeys, Sequence >::PriorityQueueBinaryHeapArray ( const DataArray &  data_array,
const sequence_type &  container = sequence_type() 
) [inline]

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