Efficient, in‐place double‐ended queue of values of type T.

Synopsis

Declared in <bdlc_queue.h>

template<class T>
class Queue;

Description

This class implements an efficient, in‐place double‐ended queue of values of parameterized type T. The physical capacity of this queue may grow, but never shrinks. Capacity may be reserved initially via a constructor, or at any time thereafter by using the reserveCapacity and reserveCapacityRaw methods. Note that there is no guarantee of contiguous storage of consecutive elements.

More generally, this container class supports a complete set of *value semantics* operations, including copy construction, assignment, equality comparison, ostream printing, and bdex serialization. (A precise operational definition of when two objects have the same value can be found in the description of operator== for the class.) This container is exception neutral with no guarantee of rollback: if an exception is thrown during the invocation of a method on a pre‐existing object, the container is left in a valid state, but its value is undefined. In no event is memory leaked. Finally, aliasing (e.g., using all or part of an object as both source and destination) is supported in all cases.

Types

Name

Description

InitialCapacity

Specifier for the initial internal capacity of a Queue.

Member Functions

Name

Description

Queue [constructor]

Constructors

~Queue [destructor]

Destroy this object.

operator=

Assign to this queue the value of the specified rhs queue.

append

append overloads

back

back overloads

bdexStreamIn

Assign to this object the value read from the specified stream.

bdexStreamOut

Write this object to the specified output stream.

front

front overloads

insert

insert overloads

length

Return the number of elements in this queue.

operator[]

Subscript operators

popBack

Remove the value from the back of this queue.

popFront

Remove the value from the front of this queue.

print

Format this object to the specified output stream.

pushBack

Append the specified item to the back of this queue.

pushFront

Insert the specified item into the front of this queue.

remove

remove overloads

removeAll

Remove all elements from this queue.

replace

replace overloads

reserveCapacity

Reserve capacity for at least the specified numElements values.

reserveCapacityRaw

Reserve minimal capacity for the specified numElements values.

setLength

setLength overloads

setLengthRaw

Set the length of this queue without initializing new elements.

streamOut

Write the elements of this queue to the specified stream.

swap

Swap the values at the specified indices index1 and index2.

operator BloombergLP::bslmf::NestedTraitDeclaration<Queue, HasPrintMethod>

Declare that this type has a print method.

operator BloombergLP::bslmf::NestedTraitDeclaration<Queue, UsesBslmaAllocator>

Declare that this type uses a bslma allocator.

Static Member Functions

Name

Description

maxSupportedBdexVersion

maxSupportedBdexVersion overloads

maxSupportedVersion

Return the most current bdex streaming version supported by this class.

Non-Member Functions

Name

Description

operator!=

Return whether the specified queues do not have the same value.

operator==

Return whether the specified queues have the same value.

Created with MrDocs