BloombergLP::bdlcc::Deque

This class provides a fully thread-safe implementation of an efficient, in-place, indexable, double-ended queue of (template parameter) TYPE values. Direct access to the underlying bsl::deque<TYPE> object is provided through the nested Proctor and ConstProctor classes. While this class is not value-semantic, the underlying bsl::deque<TYPE> class is.

Synopsis

Declared in <bdlcc_deque.h>

template<class TYPE>
class Deque;

Types

NameDescription
ConstProctor This class defines a proctor type that provides direct const access to the underlying bsl::deque contained in a Deque.
Proctor This class defines a proctor type that provides direct access to the underlying bsl::deque contained in a Deque. Creation of a Proctor object locks the mutex of the Deque, and destruction unlocks it.

Type Aliases

NameDescription
MonoDeque Underlying non-thread-safe deque type.
size_type Unsigned type used for sizes and indexes.

Member Functions

NameDescription
Deque [constructor]Constructors
~Deque [destructor]Destroy this container. The behavior is undefined unless all access or modification of the container has completed prior to the destruction of this object.
allocator Return the allocator used by this container for allocating memory.
clockType Return the system clock type used for timing timed* operations on this object (see {Supported Clock-Types} in the component documentation).
forcePushBack forcePushBack overloads
forcePushFront forcePushFront overloads
highWaterMark Return the high-water mark value for this container.
length Return the number of elements contained in this container. Note that this method temporarily acquires the mutex, so that this method must not be called while a proctor in the same thread has this container locked, and the value returned is potentially obsolete before it is returned if any other threads are simultaneously modifying this container. To find the length while a proctor has the container locked, call proctor->size().
popBack popBack overloads
popFront popFront overloads
pushBack pushBack overloads
pushFront pushFront overloads
removeAll removeAll overloads
timedPopBack Remove the last item in this container and load that item value into the specified *item. If this container is empty, block until an item is available or until the specified timeout (expressed as the ABSOLUTE time from 00:00:00 UTC, January 1, 1970) expires. Return 0 on success, and a non-zero value if the call timed out before an item was available. Note that this method can block indefinitely if another thread has the mutex locked, particularly by a proctor object -- there is no guarantee that this method will return after timeout.
timedPopFront Remove the first item in this container and load that item value into the specified *item. If this container is empty, block until an item is available or until the specified timeout (expressed as the ABSOLUTE time from 00:00:00 UTC, January 1, 1970) expires. Return 0 on success, and a non-zero value if the call timed out before an item was available. Note that this method can block indefinitely if another thread has the mutex locked, particularly by a proctor object -- there is no guarantee that this method will return after timeout.
timedPushBack timedPushBack overloads
timedPushFront timedPushFront overloads
tryPopBack tryPopBack overloads
tryPopFront tryPopFront overloads
tryPushBack tryPushBack overloads
tryPushFront tryPushFront overloads

Static Member Functions

NameDescription
maxSizeT Return the maximum value that can be stored in a veriable of type size_type. The high water mark defaults to having this value.