BloombergLP::bdlcc::SingleProducerSingleConsumerBoundedQueue

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>

template<class TYPE>
class SingleProducerSingleConsumerBoundedQueue;

Type Aliases

NameDescription
value_type The type for elements stored in this queue.

Enums

NameDescription
Unnamed enum Status codes returned by queue operations.

Member Functions

NameDescription
SingleProducerSingleConsumerBoundedQueue [constructor]Create a thread-aware queue with at least the specified capacity.
~SingleProducerSingleConsumerBoundedQueue [destructor]Destroy this object.
allocator Return the allocator used by this object to supply memory.
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.
disablePopFront Disable dequeueing from this queue.
disablePushBack Disable enqueueing into this queue.
enablePopFront Enable dequeueing. If the queue is not dequeue disabled, this call has no effect.
enablePushBack Enable queuing. If the queue is not enqueue disabled, this call has no effect.
isEmpty Return true if this queue is empty (has no elements), or false otherwise.
isFull Return true if this queue is full (has no available capacity), or false otherwise.
isPopFrontDisabled Return true if this queue is dequeue disabled, and false otherwise. Note that the queue is created in the "dequeue enabled" state.
isPushBackDisabled Return true if this queue is enqueue disabled, and false otherwise. Note that the queue is created in the "enqueue enabled" state.
numElements Returns the number of elements currently in this queue.
popFront Remove the element from the front of this queue and load that element into the specified value.
pushBack pushBack overloads
removeAll Remove all items currently in this queue.
tryPopFront Attempt to remove the front element of this queue without blocking.
tryPushBack tryPushBack overloads
waitUntilEmpty Block until all the elements in this queue are removed.
operator BloombergLP::bslmf::NestedTraitDeclaration<SingleProducerSingleConsumerBoundedQueue, UsesBslmaAllocator> Declare that this type uses a bslma allocator.

Friends

NameDescription
BloombergLP::bdlcc::SingleProducerSingleConsumerBoundedQueue_PopCompleteGuardThis class implements a guard that invokes TYPE::popComplete on a NODE upon destruction.