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

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

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TYPE,
    class ATOMIC&lowbar;OP,
    class MUTEX,
    class CONDITION&gt;
class SingleProducerQueueImpl;
----

== Description

The types `ATOMIC&lowbar;OP`, `MUTEX`, and `CONDITION` are exposed for testing&period; Typical usage is with `bsls&colon;&colon;AtomicOperations` for `ATOMIC&lowbar;OP`, `bslmt&colon;&colon;Mutex` for `MUTEX`, and `bslmt&colon;&colon;Condition` for `CONDITION`&period;

== Type Aliases

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


== Enums

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


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/2constructor-0c.adoc[`SingleProducerQueueImpl`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/2destructor.adoc[`&#126;SingleProducerQueueImpl`] [.small]#[destructor]#
| Destroy this object&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/allocator.adoc[`allocator`] 
| Return the allocator used by this object to supply memory&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/disablePopFront.adoc[`disablePopFront`] 
| Disable dequeueing from this queue&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/disablePushBack.adoc[`disablePushBack`] 
| Disable enqueueing into this queue&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/enablePopFront.adoc[`enablePopFront`] 
| Enable dequeueing&period; If the queue is not dequeue disabled, this call has no effect&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/enablePushBack.adoc[`enablePushBack`] 
| Enable queuing&period; If the queue is not enqueue disabled, this call has no effect&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/isEmpty.adoc[`isEmpty`] 
| Return `true` if this queue is empty (has no elements), or `false` otherwise&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/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/SingleProducerQueueImpl/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/SingleProducerQueueImpl/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/SingleProducerQueueImpl/numElements.adoc[`numElements`] 
| Returns the number of elements currently in this queue&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/popFront.adoc[`popFront`] 
| Remove the element from the front of this queue and load that element into the specified `value`&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/pushBack-04.adoc[`pushBack`] 
| `pushBack` overloads
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/removeAll.adoc[`removeAll`] 
| Remove all items currently in this queue&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/tryPopFront.adoc[`tryPopFront`] 
| Attempt to remove the front element of this queue without blocking&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/tryPushBack-08.adoc[`tryPushBack`] 
| `tryPushBack` overloads
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/waitUntilEmpty.adoc[`waitUntilEmpty`] 
| Block until all the elements in this queue are removed&period;
| xref:BloombergLP/bdlcc/SingleProducerQueueImpl/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;SingleProducerQueueImpl, UsesBslmaAllocator&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bdlcc/SingleProducerQueueImpl_PopCompleteGuard.adoc[BloombergLP::bdlcc::SingleProducerQueueImpl&lowbar;PopCompleteGuard]`
| This class implements a guard automatically invokes `popComplete` on a `NODE` upon destruction&period;
| `xref:BloombergLP/bdlcc/SingleProducerQueueImpl_ReleaseAllRawProctor.adoc[BloombergLP::bdlcc::SingleProducerQueueImpl&lowbar;ReleaseAllRawProctor]`
| This class implements a proctor that, unless its `release` method has previously been invoked, automatically invokes `releaseAllRaw` on a `TYPE` upon destruction&period;
|===


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