[#BloombergLP-bdlcc-SingleConsumerQueue]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::SingleConsumerQueue
:relfileprefix: ../../
:mrdocs:

This class provides a thread&hyphen;safe unbounded queue of values that assumes a single consumer thread&period;

== Synopsis

Declared in `&lt;bdlcc&lowbar;singleconsumerqueue&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
class SingleConsumerQueue;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/SingleConsumerQueue/value_type.adoc[`value&lowbar;type`] 
| The type for elements stored in this queue&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/SingleConsumerQueue/_04enum.adoc[`Unnamed enum`] 
| Status codes returned by queue operations&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/SingleConsumerQueue/2constructor-03.adoc[`SingleConsumerQueue`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlcc/SingleConsumerQueue/allocator.adoc[`allocator`] 
| Return the allocator used by this object to supply memory&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/disablePopFront.adoc[`disablePopFront`] 
| Disable dequeueing from this queue&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/disablePushBack.adoc[`disablePushBack`] 
| Disable enqueueing into this queue&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/enablePopFront.adoc[`enablePopFront`] 
| Enable dequeueing&period; If the queue is not dequeue disabled, this call has no effect&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/enablePushBack.adoc[`enablePushBack`] 
| Enable queuing&period; If the queue is not enqueue disabled, this call has no effect&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/isEmpty.adoc[`isEmpty`] 
| Return `true` if this queue is empty (has no elements), or `false` otherwise&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/isFull.adoc[`isFull`] 
| Return `true` if this queue is full (has no available capacity), or `false` otherwise&period; Note that for unbounded queues, this method always returns `false`&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/isPopFrontDisabled.adoc[`isPopFrontDisabled`] 
| Return `true` if this queue is dequeue disabled, and `false` otherwise&period; Note that the queue is created in the &quot;dequeue enabled&quot; state&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/isPushBackDisabled.adoc[`isPushBackDisabled`] 
| Return `true` if this queue is enqueue disabled, and `false` otherwise&period; Note that the queue is created in the &quot;enqueue enabled&quot; state&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/numElements.adoc[`numElements`] 
| Returns the number of elements currently in this queue&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/popFront.adoc[`popFront`] 
| Remove the front element and load it into `value`, blocking if empty&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/pushBack-0b2.adoc[`pushBack`] 
| `pushBack` overloads
| xref:BloombergLP/bdlcc/SingleConsumerQueue/removeAll.adoc[`removeAll`] 
| Remove all items currently in this queue&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/tryPopFront.adoc[`tryPopFront`] 
| Attempt to remove the front element without blocking&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/tryPushBack-03.adoc[`tryPushBack`] 
| `tryPushBack` overloads
| xref:BloombergLP/bdlcc/SingleConsumerQueue/waitUntilEmpty.adoc[`waitUntilEmpty`] 
| Block until all the elements in this queue are removed&period;
| xref:BloombergLP/bdlcc/SingleConsumerQueue/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;SingleConsumerQueue, UsesBslmaAllocator&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
