BDE 4.14.0 Production release
|
#include <bslstl_queue.h>
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) | |
Create a queue having the value of the specified 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) | |
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) |
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 > &) |
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
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 |
|
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. Note that the 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. Note that the 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. Note that the 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. Note that a 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. Note that a 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 |
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 |
|
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
.
|
inline |
Return the number of elements in this queue. In effect, performs return c.size();
.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
|
inline |
Remove the front (the earliest pushed) element from this queue
object. Return a reference providing modifiable access to the front (the earliest pushed) element from this queue
object.