[#BloombergLP-bdlcc-SingleProducerSingleConsumerBoundedQueue] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::SingleProducerSingleConsumerBoundedQueue :relfileprefix: ../../ :mrdocs: This class provides a thread‐safe bounded queue of values that supports a single producer and a single consumer. == Synopsis Declared in `<bdlcc_singleproducersingleconsumerboundedqueue.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> class SingleProducerSingleConsumerBoundedQueue; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/value_type.adoc[`value_type`] | The type for elements stored in this queue. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/_04enum.adoc[`Unnamed enum`] | Status codes returned by queue operations. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/2constructor.adoc[`SingleProducerSingleConsumerBoundedQueue`] [.small]#[constructor]# | Create a thread‐aware queue with at least the specified `capacity`. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/2destructor.adoc[`~SingleProducerSingleConsumerBoundedQueue`] [.small]#[destructor]# | Destroy this object. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/allocator.adoc[`allocator`] | Return the allocator used by this object to supply memory. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/capacity.adoc[`capacity`] | Return the maximum number of elements that may be stored in this queue. Note that the value returned may be greater than that supplied at construction. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/disablePopFront.adoc[`disablePopFront`] | Disable dequeueing from this queue. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/disablePushBack.adoc[`disablePushBack`] | Disable enqueueing into this queue. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/enablePopFront.adoc[`enablePopFront`] | Enable dequeueing. If the queue is not dequeue disabled, this call has no effect. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/enablePushBack.adoc[`enablePushBack`] | Enable queuing. If the queue is not enqueue disabled, this call has no effect. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/isEmpty.adoc[`isEmpty`] | Return `true` if this queue is empty (has no elements), or `false` otherwise. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/isFull.adoc[`isFull`] | Return `true` if this queue is full (has no available capacity), or `false` otherwise. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/isPopFrontDisabled.adoc[`isPopFrontDisabled`] | Return `true` if this queue is dequeue disabled, and `false` otherwise. Note that the queue is created in the "dequeue enabled" state. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/isPushBackDisabled.adoc[`isPushBackDisabled`] | Return `true` if this queue is enqueue disabled, and `false` otherwise. Note that the queue is created in the "enqueue enabled" state. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/numElements.adoc[`numElements`] | Returns the number of elements currently in this queue. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/popFront.adoc[`popFront`] | Remove the element from the front of this queue and load that element into the specified `value`. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/pushBack-0a.adoc[`pushBack`] | `pushBack` overloads | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/removeAll.adoc[`removeAll`] | Remove all items currently in this queue. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/tryPopFront.adoc[`tryPopFront`] | Attempt to remove the front element of this queue without blocking. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/tryPushBack-0d5.adoc[`tryPushBack`] | `tryPushBack` overloads | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/waitUntilEmpty.adoc[`waitUntilEmpty`] | Block until all the elements in this queue are removed. | xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<SingleProducerSingleConsumerBoundedQueue, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bdlcc/SingleProducerSingleConsumerBoundedQueue_PopCompleteGuard.adoc[BloombergLP::bdlcc::SingleProducerSingleConsumerBoundedQueue_PopCompleteGuard]` | This class implements a guard that invokes `TYPE::popComplete` on a `NODE` upon destruction. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#