|
| BSLMF_NESTED_TRAIT_DECLARATION_IF (priority_queue, BloombergLP::bslma::UsesBslmaAllocator, BloombergLP::bslma::UsesBslmaAllocator< container_type >::value) |
|
| priority_queue () |
|
| priority_queue (const COMPARATOR &comparator) |
|
| priority_queue (const COMPARATOR &comparator, const CONTAINER &container) |
|
| priority_queue (const COMPARATOR &comparator, BloombergLP::bslmf::MovableRef< CONTAINER > container) |
|
template<class INPUT_ITERATOR > |
| priority_queue (INPUT_ITERATOR first, INPUT_ITERATOR last) |
|
template<class INPUT_ITERATOR > |
| priority_queue (INPUT_ITERATOR first, INPUT_ITERATOR last, const COMPARATOR &comparator, const CONTAINER &container) |
|
template<class INPUT_ITERATOR > |
| priority_queue (INPUT_ITERATOR first, INPUT_ITERATOR last, const COMPARATOR &comparator, BloombergLP::bslmf::MovableRef< CONTAINER > container) |
|
| priority_queue (const priority_queue &original) |
|
| priority_queue (BloombergLP::bslmf::MovableRef< priority_queue > original) |
|
template<class ALLOCATOR > |
| priority_queue (const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) |
|
template<class ALLOCATOR > |
| priority_queue (const COMPARATOR &comparator, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) |
|
template<class ALLOCATOR > |
| priority_queue (const COMPARATOR &comparator, const CONTAINER &container, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) |
|
template<class ALLOCATOR > |
| priority_queue (const COMPARATOR &comparator, BloombergLP::bslmf::MovableRef< CONTAINER > container, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) |
|
template<class ALLOCATOR > |
| priority_queue (const priority_queue &original, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) |
|
template<class ALLOCATOR > |
| priority_queue (BloombergLP::bslmf::MovableRef< priority_queue > original, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) |
|
priority_queue & | operator= (const priority_queue &rhs) |
|
priority_queue & | operator= (BloombergLP::bslmf::MovableRef< priority_queue > rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(false) |
|
void | push (const value_type &value) |
|
void | push (BloombergLP::bslmf::MovableRef< value_type > value) |
|
template<class... Args> |
void | emplace (Args &&... args) |
|
void | pop () |
|
size_type | size () const |
|
const_reference | top () const |
|
template<class VALUE, class CONTAINER = vector<VALUE>, class COMPARATOR = std::less<typename CONTAINER::value_type>>
class bsl::priority_queue< VALUE, CONTAINER, COMPARATOR >
This class is a value-semantic class template, adapting a container of the (template parameter) type CONTAINER
, that holds elements of the (template parameter) type VALUE
, to provide a highest-priority-first priority queue data structure, where the priorities of elements are compared by a comparator of the template parameter type, COMPARATOR
. The container object held by a priority_queue class object is referenced as c
in the following documentation.
See bslstl_priorityqueue
template<class VALUE , class CONTAINER , class COMPARATOR >
template<class INPUT_ITERATOR >
bsl::priority_queue< VALUE, CONTAINER, COMPARATOR >::priority_queue |
( |
INPUT_ITERATOR |
first, |
|
|
INPUT_ITERATOR |
last |
|
) |
| |
|
inline |
Create a priority queue, adapting a default-constructed container of the (template parameter) type CONTAINER
, and inserting into the container a sequence of value_type
elements that starts at the specified first
and ends immediately before the specified last
. Use a default-constructed comparator of the (template parameter) type COMPARATOR
to order elements in the priority queue.
template<class VALUE , class CONTAINER , class COMPARATOR >
template<class INPUT_ITERATOR >
bsl::priority_queue< VALUE, CONTAINER, COMPARATOR >::priority_queue |
( |
INPUT_ITERATOR |
first, |
|
|
INPUT_ITERATOR |
last, |
|
|
const COMPARATOR & |
comparator, |
|
|
const CONTAINER & |
container |
|
) |
| |
|
inline |
Create a priority queue, adapting the specified container
, having the specified comparator
to order the priorities of elements, including those originally existed in container
, and those inserted into the container
from a sequence of value_type
elements starting at the specified first
, and ending immediately before the specified last
.
template<class VALUE , class CONTAINER , class COMPARATOR >
template<class INPUT_ITERATOR >
bsl::priority_queue< VALUE, CONTAINER, COMPARATOR >::priority_queue |
( |
INPUT_ITERATOR |
first, |
|
|
INPUT_ITERATOR |
last, |
|
|
const COMPARATOR & |
comparator, |
|
|
BloombergLP::bslmf::MovableRef< CONTAINER > |
container |
|
) |
| |
|
inline |
Create a priority queue, adapting the specified container
, having the specified comparator
to order elements in the priority queue, including those originally existed in container
, and those inserted into the container
from a sequence of value_type
elements starting at the specified first
, and ending immediately before the specified last
.
template<class VALUE , class CONTAINER , class COMPARATOR >
template<class ALLOCATOR >
Create an empty priority queue, adapting a default-constructed container of the (template parameter) type CONTAINER
that uses the specified basicAllocator
to supply memory. Use a default-constructed object of the (template parameter) type COMPARATOR
to order elements in the priority queue. Note that this constructor is only defined if the underlying container uses allocator. Otherwise this constructor is disabled.
template<class VALUE , class CONTAINER , class COMPARATOR >
template<class ALLOCATOR >
Create an empty priority queue, adapting a default-constructed container of the (template parameter) type CONTAINER
that uses the specified basicAllocator
to supply memory, and the specified comparator
to order elements in the priority queue. Note that this constructor is only defined if the underlying container uses allocator. Otherwise this constructor is disabled.
template<class VALUE , class CONTAINER , class COMPARATOR >
template<class ALLOCATOR >
bsl::priority_queue< VALUE, CONTAINER, COMPARATOR >::priority_queue |
( |
const COMPARATOR & |
comparator, |
|
|
const CONTAINER & |
container, |
|
|
const ALLOCATOR & |
basicAllocator, |
|
|
typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type * |
= 0 |
|
) |
| |
|
inline |
Create a priority queue, adapting the specified container
that uses the specified basicAllocator
to supply memory, and the specified comparator
to order elements in the priority queue. Note that this constructor is only defined if the underlying container uses allocator. Otherwise this constructor is disabled.
template<class VALUE , class CONTAINER , class COMPARATOR >
template<class ALLOCATOR >
bsl::priority_queue< VALUE, CONTAINER, COMPARATOR >::priority_queue |
( |
const COMPARATOR & |
comparator, |
|
|
BloombergLP::bslmf::MovableRef< CONTAINER > |
container, |
|
|
const ALLOCATOR & |
basicAllocator, |
|
|
typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type * |
= 0 |
|
) |
| |
|
inline |
Create a priority queue, adapting the specified container
that uses the specified basicAllocator
to supply memory, and the specified comparator
to order elements in the priority queue. Note that this constructor is only defined if the underlying container uses allocator. Otherwise this constructor is disabled.
template<class VALUE , class CONTAINER , class COMPARATOR >
template<class ALLOCATOR >
Create a priority queue having the same value as the specified original
object and using the specified basicAllocator
to supply memory. Use a copy of the comparator from original
to order elements in the priority queue. Note that this constructor is only defined if the underlying container uses allocator. Otherwise this constructor is disabled.
template<class VALUE , class CONTAINER , class COMPARATOR >
template<class... Args>
Insert into this priority queue a newly created value_type
object, constructed by forwarding the specified (variable number of) args
to the corresponding constructor of value_type
. In effect, performs c.emplace_back(FORWARD(Args,args)...);
.
template<class VALUE , class CONTAINER , class COMPARATOR >
Remove the top element from this priority_queue object that has the highest priority. In effect, performs c.pop_back();
. The behavior is undefined if there is currently no elements in this object. Return true
if this priority_queue object contains no elements, and false
otherwise. In effect, performs return c.empty();
.