[#BloombergLP-bdlcc-Deque] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::Deque :relfileprefix: ../../ :mrdocs: 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>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> class Deque; ---- == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/Deque/ConstProctor.adoc[`ConstProctor`] | This class defines a proctor type that provides direct const access to the underlying `bsl::deque` contained in a `Deque`. | xref:BloombergLP/bdlcc/Deque/Proctor.adoc[`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 [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/Deque/MonoDeque.adoc[`MonoDeque`] | Underlying non‐thread‐safe deque type. | xref:BloombergLP/bdlcc/Deque/size_type.adoc[`size_type`] | Unsigned type used for sizes and indexes. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/Deque/2constructor-0c.adoc[`Deque`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlcc/Deque/2destructor.adoc[`~Deque`] [.small]#[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. | xref:BloombergLP/bdlcc/Deque/allocator.adoc[`allocator`] | Return the allocator used by this container for allocating memory. | xref:BloombergLP/bdlcc/Deque/clockType.adoc[`clockType`] | Return the system clock type used for timing `timed*` operations on this object (see {Supported Clock‐Types} in the component documentation). | xref:BloombergLP/bdlcc/Deque/forcePushBack-0d.adoc[`forcePushBack`] | `forcePushBack` overloads | xref:BloombergLP/bdlcc/Deque/forcePushFront-0a.adoc[`forcePushFront`] | `forcePushFront` overloads | xref:BloombergLP/bdlcc/Deque/highWaterMark.adoc[`highWaterMark`] | Return the high‐water mark value for this container. | xref:BloombergLP/bdlcc/Deque/length.adoc[`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()`. | xref:BloombergLP/bdlcc/Deque/popBack-0f.adoc[`popBack`] | `popBack` overloads | xref:BloombergLP/bdlcc/Deque/popFront-02.adoc[`popFront`] | `popFront` overloads | xref:BloombergLP/bdlcc/Deque/pushBack-02.adoc[`pushBack`] | `pushBack` overloads | xref:BloombergLP/bdlcc/Deque/pushFront-08d.adoc[`pushFront`] | `pushFront` overloads | xref:BloombergLP/bdlcc/Deque/removeAll-09.adoc[`removeAll`] | `removeAll` overloads | xref:BloombergLP/bdlcc/Deque/timedPopBack.adoc[`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`. | xref:BloombergLP/bdlcc/Deque/timedPopFront.adoc[`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`. | xref:BloombergLP/bdlcc/Deque/timedPushBack-06.adoc[`timedPushBack`] | `timedPushBack` overloads | xref:BloombergLP/bdlcc/Deque/timedPushFront-02.adoc[`timedPushFront`] | `timedPushFront` overloads | xref:BloombergLP/bdlcc/Deque/tryPopBack-0ca.adoc[`tryPopBack`] | `tryPopBack` overloads | xref:BloombergLP/bdlcc/Deque/tryPopFront-03.adoc[`tryPopFront`] | `tryPopFront` overloads | xref:BloombergLP/bdlcc/Deque/tryPushBack-01.adoc[`tryPushBack`] | `tryPushBack` overloads | xref:BloombergLP/bdlcc/Deque/tryPushFront-024.adoc[`tryPushFront`] | `tryPushFront` overloads |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/Deque/maxSizeT.adoc[`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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#