Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::heap::priority_queue< T, A0, A1, A2, A3 > Class Template Reference

priority queue, based on stl heap functions More...

#include <priority_queue.hpp>

Inheritance diagram for boost::heap::priority_queue< T, A0, A1, A2, A3 >:
Collaboration diagram for boost::heap::priority_queue< T, A0, A1, A2, A3 >:

Public Types

typedef T value_type
 
typedef
implementation_defined::size_type 
size_type
 
typedef
implementation_defined::difference_type 
difference_type
 
typedef
implementation_defined::value_compare 
value_compare
 
typedef
implementation_defined::allocator_type 
allocator_type
 
typedef
implementation_defined::reference 
reference
 
typedef
implementation_defined::const_reference 
const_reference
 
typedef
implementation_defined::pointer 
pointer
 
typedef
implementation_defined::const_pointer 
const_pointer
 
typedef
implementation_defined::iterator 
iterator
 Note: The iterator does not traverse the priority queue in order of the priorities. More...
 
typedef
implementation_defined::const_iterator 
const_iterator
 

Public Member Functions

 priority_queue (value_compare const &cmp=value_compare())
 Effects: constructs an empty priority queue. More...
 
 priority_queue (priority_queue const &rhs)
 Effects: copy-constructs priority queue from rhs. More...
 
 priority_queue (priority_queue &&rhs)
 Effects: C++11-style move constructor. More...
 
priority_queueoperator= (priority_queue &&rhs)
 Effects: C++11-style move assignment. More...
 
priority_queueoperator= (priority_queue const &rhs)
 Effects: Assigns priority queue from rhs. More...
 
bool empty (void) const
 Effects: Returns true, if the priority queue contains no elements. More...
 
size_type size (void) const
 Effects: Returns the number of elements contained in the priority queue. More...
 
size_type max_size (void) const
 Effects: Returns the maximum number of elements the priority queue can contain. More...
 
void clear (void)
 Effects: Removes all elements from the priority queue. More...
 
allocator_type get_allocator (void) const
 Effects: Returns allocator. More...
 
const_reference top (void) const
 Effects: Returns a const_reference to the maximum element. More...
 
void push (value_type const &v)
 Effects: Adds a new element to the priority queue. More...
 
template<class... Args>
void emplace (Args &&...args)
 Effects: Adds a new element to the priority queue. More...
 
void pop (void)
 Effects: Removes the top element from the priority queue. More...
 
void swap (priority_queue &rhs)
 Effects: Swaps two priority queues. More...
 
iterator begin (void) const
 Effects: Returns an iterator to the first element contained in the priority queue. More...
 
iterator end (void) const
 Effects: Returns an iterator to the end of the priority queue. More...
 
void reserve (size_type element_count)
 Effects: Reserves memory for element_count elements More...
 
value_compare const & value_comp (void) const
 Effect: Returns the value_compare object used by the priority queue More...
 
template<typename HeapType >
bool operator< (HeapType const &rhs) const
 Returns: Element-wise comparison of heap data structures More...
 
template<typename HeapType >
bool operator> (HeapType const &rhs) const
 Returns: Element-wise comparison of heap data structures More...
 
template<typename HeapType >
bool operator>= (HeapType const &rhs) const
 Returns: Element-wise comparison of heap data structures More...
 
template<typename HeapType >
bool operator<= (HeapType const &rhs) const
 Returns: Element-wise comparison of heap data structures More...
 
template<typename HeapType >
bool operator== (HeapType const &rhs) const
 Equivalent comparison Returns: True, if both heap data structures are equivalent. More...
 
template<typename HeapType >
bool operator!= (HeapType const &rhs) const
 Equivalent comparison Returns: True, if both heap data structures are not equivalent. More...
 

Static Public Attributes

static const bool constant_time_size = true
 
static const bool has_ordered_iterators = false
 
static const bool is_mergable = false
 
static const bool is_stable = heap_base_maker::is_stable
 
static const bool has_reserve = true
 

Friends

template<typename Heap1 , typename Heap2 >
struct detail::heap_merge_emulate
 

Detailed Description

template<typename T, class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
class boost::heap::priority_queue< T, A0, A1, A2, A3 >

priority queue, based on stl heap functions

The priority_queue class is a wrapper for the stl heap functions.
The template parameter T is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.

The container supports the following options:

  • boost::heap::compare<>, defaults to compare<std::less<T> >
  • boost::heap::stable<>, defaults to stable<false>
  • boost::heap::stability_counter_type<>, defaults to stability_counter_type<boost::uintmax_t>
  • boost::heap::allocator<>, defaults to allocator<std::allocator<T> >

Member Typedef Documentation

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
typedef implementation_defined::allocator_type boost::heap::priority_queue< T, A0, A1, A2, A3 >::allocator_type
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
typedef implementation_defined::const_iterator boost::heap::priority_queue< T, A0, A1, A2, A3 >::const_iterator
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
typedef implementation_defined::const_pointer boost::heap::priority_queue< T, A0, A1, A2, A3 >::const_pointer
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
typedef implementation_defined::const_reference boost::heap::priority_queue< T, A0, A1, A2, A3 >::const_reference
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
typedef implementation_defined::difference_type boost::heap::priority_queue< T, A0, A1, A2, A3 >::difference_type
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
typedef implementation_defined::iterator boost::heap::priority_queue< T, A0, A1, A2, A3 >::iterator

Note: The iterator does not traverse the priority queue in order of the priorities.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
typedef implementation_defined::pointer boost::heap::priority_queue< T, A0, A1, A2, A3 >::pointer
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
typedef implementation_defined::reference boost::heap::priority_queue< T, A0, A1, A2, A3 >::reference
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
typedef implementation_defined::size_type boost::heap::priority_queue< T, A0, A1, A2, A3 >::size_type
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
typedef implementation_defined::value_compare boost::heap::priority_queue< T, A0, A1, A2, A3 >::value_compare
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
typedef T boost::heap::priority_queue< T, A0, A1, A2, A3 >::value_type

Constructor & Destructor Documentation

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
boost::heap::priority_queue< T, A0, A1, A2, A3 >::priority_queue ( value_compare const &  cmp = value_compare())
inlineexplicit

Effects: constructs an empty priority queue.

Complexity: Constant.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
boost::heap::priority_queue< T, A0, A1, A2, A3 >::priority_queue ( priority_queue< T, A0, A1, A2, A3 > const &  rhs)
inline

Effects: copy-constructs priority queue from rhs.

Complexity: Linear.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
boost::heap::priority_queue< T, A0, A1, A2, A3 >::priority_queue ( priority_queue< T, A0, A1, A2, A3 > &&  rhs)
inline

Effects: C++11-style move constructor.

Complexity: Constant.

Note: Only available, if BOOST_NO_CXX11_RVALUE_REFERENCES is not defined

Member Function Documentation

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
iterator boost::heap::priority_queue< T, A0, A1, A2, A3 >::begin ( void  ) const
inline

Effects: Returns an iterator to the first element contained in the priority queue.

Complexity: Constant.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
void boost::heap::priority_queue< T, A0, A1, A2, A3 >::clear ( void  )
inline

Effects: Removes all elements from the priority queue.

Complexity: Linear.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
template<class... Args>
void boost::heap::priority_queue< T, A0, A1, A2, A3 >::emplace ( Args &&...  args)
inline

Effects: Adds a new element to the priority queue.

The element is directly constructed in-place.

Complexity: Logarithmic (amortized). Linear (worst case).

References boost::python::args(), and boost::range::push_heap().

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::empty ( void  ) const
inline

Effects: Returns true, if the priority queue contains no elements.

Complexity: Constant.

Referenced by boost::heap::priority_queue< T, A0, A1, A2, A3 >::pop(), and boost::heap::priority_queue< T, A0, A1, A2, A3 >::top().

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
iterator boost::heap::priority_queue< T, A0, A1, A2, A3 >::end ( void  ) const
inline

Effects: Returns an iterator to the end of the priority queue.

Complexity: Constant.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
allocator_type boost::heap::priority_queue< T, A0, A1, A2, A3 >::get_allocator ( void  ) const
inline

Effects: Returns allocator.

Complexity: Constant.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
size_type boost::heap::priority_queue< T, A0, A1, A2, A3 >::max_size ( void  ) const
inline

Effects: Returns the maximum number of elements the priority queue can contain.

Complexity: Constant.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
template<typename HeapType >
bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator!= ( HeapType const &  rhs) const
inline

Equivalent comparison Returns: True, if both heap data structures are not equivalent.

Requirement: the value_compare object of both heaps must match.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
template<typename HeapType >
bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator< ( HeapType const &  rhs) const
inline

Returns: Element-wise comparison of heap data structures

Requirement: the value_compare object of both heaps must match.

Referenced by boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator>=().

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
template<typename HeapType >
bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator<= ( HeapType const &  rhs) const
inline

Returns: Element-wise comparison of heap data structures

Requirement: the value_compare object of both heaps must match.

References boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator>().

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
priority_queue& boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator= ( priority_queue< T, A0, A1, A2, A3 > &&  rhs)
inline

Effects: C++11-style move assignment.

Complexity: Constant.

Note: Only available, if BOOST_NO_CXX11_RVALUE_REFERENCES is not defined

References boost::fusion::move(), and boost::multiprecision::backends::operator=().

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
priority_queue& boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator= ( priority_queue< T, A0, A1, A2, A3 > const &  rhs)
inline

Effects: Assigns priority queue from rhs.

Complexity: Linear.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
template<typename HeapType >
bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator== ( HeapType const &  rhs) const
inline

Equivalent comparison Returns: True, if both heap data structures are equivalent.

Requirement: the value_compare object of both heaps must match.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
template<typename HeapType >
bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator> ( HeapType const &  rhs) const
inline

Returns: Element-wise comparison of heap data structures

Requirement: the value_compare object of both heaps must match.

Referenced by boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator<=().

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
template<typename HeapType >
bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator>= ( HeapType const &  rhs) const
inline

Returns: Element-wise comparison of heap data structures

Requirement: the value_compare object of both heaps must match.

References boost::heap::priority_queue< T, A0, A1, A2, A3 >::operator<().

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
void boost::heap::priority_queue< T, A0, A1, A2, A3 >::pop ( void  )
inline

Effects: Removes the top element from the priority queue.

Complexity: Logarithmic (amortized). Linear (worst case).

References BOOST_ASSERT, boost::heap::priority_queue< T, A0, A1, A2, A3 >::empty(), and boost::range::pop_heap().

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
void boost::heap::priority_queue< T, A0, A1, A2, A3 >::push ( value_type const &  v)
inline

Effects: Adds a new element to the priority queue.

Complexity: Logarithmic (amortized). Linear (worst case).

References boost::range::push_heap().

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
void boost::heap::priority_queue< T, A0, A1, A2, A3 >::reserve ( size_type  element_count)
inline

Effects: Reserves memory for element_count elements

Complexity: Linear.

Node: Invalidates iterators

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
size_type boost::heap::priority_queue< T, A0, A1, A2, A3 >::size ( void  ) const
inline

Effects: Returns the number of elements contained in the priority queue.

Complexity: Constant.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
void boost::heap::priority_queue< T, A0, A1, A2, A3 >::swap ( priority_queue< T, A0, A1, A2, A3 > &  rhs)
inline

Effects: Swaps two priority queues.

Complexity: Constant.

References boost::swap.

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
const_reference boost::heap::priority_queue< T, A0, A1, A2, A3 >::top ( void  ) const
inline

Effects: Returns a const_reference to the maximum element.

Complexity: Constant.

References BOOST_ASSERT, and boost::heap::priority_queue< T, A0, A1, A2, A3 >::empty().

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
value_compare const& boost::heap::priority_queue< T, A0, A1, A2, A3 >::value_comp ( void  ) const
inline

Effect: Returns the value_compare object used by the priority queue

Friends And Related Function Documentation

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
template<typename Heap1 , typename Heap2 >
friend struct detail::heap_merge_emulate
friend

Member Data Documentation

template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
const bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::constant_time_size = true
static
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
const bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::has_ordered_iterators = false
static
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
const bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::has_reserve = true
static
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
const bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::is_mergable = false
static
template<typename T , class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_>
const bool boost::heap::priority_queue< T, A0, A1, A2, A3 >::is_stable = heap_base_maker::is_stable
static

The documentation for this class was generated from the following file: