|
BDE 4.39.x Production Release
|
#include <bslstl_queue.h>
This class is a value-semantic class template, having a container of the parameterized CONTAINER type that holds elements of the parameterized VALUE type, to provide a first-in-first-out queue data structure. The container object held by a queue class object is referenced as c in the following function-level documentation.
See bslstl_queue
Public Types | |
| typedef CONTAINER::value_type | value_type |
| typedef CONTAINER::reference | reference |
| typedef CONTAINER::const_reference | const_reference |
| typedef CONTAINER::size_type | size_type |
| typedef CONTAINER | container_type |
Public Member Functions | |
| BSLMF_NESTED_TRAIT_DECLARATION_IF (queue, BloombergLP::bslma::UsesBslmaAllocator, BloombergLP::bslma::UsesBslmaAllocator< container_type >::value) | |
| queue () | |
| queue (const queue &original) | |
| queue (BloombergLP::bslmf::MovableRef< queue > container) | |
| queue (const CONTAINER &container) | |
| queue (BloombergLP::bslmf::MovableRef< CONTAINER > container) | |
| template<class ALLOCATOR > | |
| queue (const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) | |
| template<class ALLOCATOR > | |
| queue (const CONTAINER &container, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) | |
| template<class ALLOCATOR > | |
| queue (const queue &original, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) | |
| template<class ALLOCATOR > | |
| queue (BloombergLP::bslmf::MovableRef< CONTAINER > container, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) | |
| template<class ALLOCATOR > | |
| queue (BloombergLP::bslmf::MovableRef< queue > original, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) | |
| template<class INPUT_ITER > | |
| queue (INPUT_ITER first, INPUT_ITER last) | |
| template<class INPUT_ITER , class ALLOCATOR > | |
| queue (INPUT_ITER first, INPUT_ITER last, const ALLOCATOR &allocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0) | |
| template<class t_RANGE > | |
| queue (from_range_t, BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range) | |
| template<class t_RANGE , class t_ALLOCATOR > | |
| queue (from_range_t, BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range, const t_ALLOCATOR &allocator, typename enable_if< bsl::uses_allocator< CONTAINER, t_ALLOCATOR >::value, t_ALLOCATOR >::type *=0) | |
| queue & | operator= (const queue &rhs) |
| queue & | operator= (BloombergLP::bslmf::MovableRef< queue > rhs) |
| template<class... Args> | |
| reference | emplace (Args &&... args) |
| void | push (const value_type &value) |
| void | push (BloombergLP::bslmf::MovableRef< value_type > value) |
| template<class t_RANGE > | |
| void | push_range (BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range) |
| void | pop () |
| reference | back () |
| bool | empty () const |
| size_type | size () const |
| const_reference | front () const |
| const_reference | back () const |
Public Attributes | |
| void swap(queue &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl reference | front () |
Protected Attributes | |
| CONTAINER | c |
Friends | |
| template<class VALUE2 , class CONTAINER2 > | |
| bool | operator== (const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &) |
| template<class VALUE2 , class CONTAINER2 > | |
| bool | operator!= (const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &) |
| template<class VALUE2 , class CONTAINER2 > | |
| bool | operator< (const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &) |
| template<class VALUE2 , class CONTAINER2 > | |
| bool | operator> (const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &) |
| template<class VALUE2 , class CONTAINER2 > | |
| bool | operator<= (const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &) |
| template<class VALUE2 , class CONTAINER2 > | |
| bool | operator>= (const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &) |
| typedef CONTAINER::const_reference bsl::queue< VALUE, CONTAINER >::const_reference |
| typedef CONTAINER bsl::queue< VALUE, CONTAINER >::container_type |
| typedef CONTAINER::reference bsl::queue< VALUE, CONTAINER >::reference |
| typedef CONTAINER::size_type bsl::queue< VALUE, CONTAINER >::size_type |
| typedef CONTAINER::value_type bsl::queue< VALUE, CONTAINER >::value_type |
|
inlineexplicit |
Create an empty queue having a container of the parameterized CONTAINER type.
|
inline |
Create a queue having the value of the specified original.
|
inline |
Create a queue having the value of the specified original. The allocator associated with original (if any) is propagated for use in the new queue. original is left in valid but unspecified state.
|
inlineexplicit |
Create a queue having the specified container that holds elements of the parameterized VALUE type.
|
inlineexplicit |
Create a queue having the same sequence of values as the specified container. The allocator associated with container (if any) is propagated for use in the new queue. container is left in valid but unspecified state.
|
inlineexplicit |
Create an empty queue. This queue object uses the specified basicAllocator to supply memory.
ALLOCATOR parameter type has to be convertible to the allocator of the CONTAINER parameter type, CONTAINER::allocator_type; otherwise, this constructor is disabled.
|
inline |
Create a queue having the same sequence of values as the specified container. The queue object uses the specified basicAllocator to obtain memory.
ALLOCATOR parameter type has to be convertible to the allocator of the CONTAINER parameter type, CONTAINER::allocator_type; otherwise, this constructor is disabled.
|
inline |
Create a queue having the value of the specified original that will use the specified basicAllocator to supply memory.
ALLOCATOR parameter type has to be convertible to the allocator of the CONTAINER parameter type, CONTAINER::allocator_type. Otherwise this constructor is disabled.
|
inline |
Create a queue whose underlying container has the value of the specified container (on entry) and uses basicAllocator to supply memory. The allocated-extended move constructor of CONTAINER is used to create the new queue. container is left in a valid but unspecified state.
bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default). Also note that this method assumes that CONTAINER has a move constructor. Also note that if CONTAINER::allocator_type does not exist, this constructor is disabled.
|
inline |
Create a queue having the value of the specified original (on entry), that uses basicAllocator to supply memory. The allocator-extended move constructor of CONTAINER is used to create the new queue. original is left in a valid but unspecified state.
bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default). Also note that this method assumes that CONTAINER has a move constructor. Also note that if CONTAINER::allocator_type does not exist, this constructor is disabled.
|
inline |
Create a queue passing the specified first and last to the constructor of the underlying container. Optionally specify an allocator used to supply memory. If allocator is not specified, a default-constructed object of the (template parameter) type ALLOCATOR is used.
|
inline |
|
inline |
Create a queue from the elements of the specifed range. Optionally specify an allocator used to supply memory. If allocator is not specified, a default-constructed object of the (template parameter) type t_ALLOCATOR is used.
range must meet the requirements of an input range and the values from range must have a type matching or convertible to (template parameter) VALUE.
|
inline |
|
inline |
Return a reference providing modifiable access to the back (the latest pushed) element of this queue object.
|
inline |
Return the immutable back (the latest pushed) element from this queue object. In effect, performs c.back().
| bsl::queue< VALUE, CONTAINER >::BSLMF_NESTED_TRAIT_DECLARATION_IF | ( | queue< VALUE, CONTAINER > | , |
| BloombergLP::bslma::UsesBslmaAllocator | , | ||
| BloombergLP::bslma::UsesBslmaAllocator< container_type >::value | |||
| ) |
|
inline |
Push onto this queue a newly created value_type object constructed by forwarding get_allocator() (if required) and the specified (variable number of) args to the corresponding constructor of value_type. Return a reference providing modifiable access to the inserted element.
|
inline |
Return true if this queue object contains no elements, and false otherwise. In effect, performs return c.empty();.
| const_reference bsl::queue< VALUE, CONTAINER >::front | ( | ) | const |
Return the immutable front (the earliest pushed) element from this queue object. In effect, performs c.front().
|
inline |
Assign to this queue the value as the specified rhs and return a reference providing modifiable access to this queue. The move-assignment operator of CONTAINER is used to set the value of this queue. rhs is left in a valid but unspecified state, and if an exception is thrown, *this is left in a valid but unspecified state.
|
inline |
Assign to this queue the value of the specified rhs, and return a reference providing modifiable access to this queue.
|
inline |
Remove the front (the earliest pushed) element from this queue object.
|
inline |
Push onto the back of this queue a value_type object having the value of the specified value (on entry) by moving the contents of value to the new object on this queue. value is left in a valid but unspecified state.
|
inline |
Push onto the back of this queue a value_type object having the specified value.
| void bsl::queue< VALUE, CONTAINER >::push_range | ( | BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) | range | ) |
Push onto the back of this queue the elements of the specified range.
range must meet the requirements of an input range and the values from range must have a type matching or convertible to (template parameter) VALUE.
|
inline |
Return the number of elements in this queue. In effect, performs return c.size();.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
|
inline |
Efficiently exchange the value of this object with the value of the specified other object. In effect, performs using bsl::swap; swap(c, other.c);. Return a reference providing modifiable access to the front (the earliest pushed) element from this queue object.