#include <bdlcc_singleproducersingleconsumerboundedqueue.h>
◆ value_type
◆ anonymous enum
Enumerator |
---|
e_SUCCESS | |
e_EMPTY | |
e_FULL | |
e_DISABLED | |
e_FAILED | |
◆ SingleProducerSingleConsumerBoundedQueue()
Create a thread-aware queue with at least the specified capacity
. Optionally specify a basicAllocator
used to supply memory. If basicAllocator
is 0, the currently installed default allocator is used.
◆ ~SingleProducerSingleConsumerBoundedQueue()
◆ allocator()
◆ BSLMF_NESTED_TRAIT_DECLARATION()
◆ 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. All subsequent invocations of popFront
or tryPopFront
will fail immediately. If the single consumer is blocked in popFront
, the invocation of popFront
will fail immediately. Any blocked invocations of waitUntilEmpty
will fail immediately. If the queue is already dequeue disabled, this method has no effect.
◆ disablePushBack()
Disable enqueueing into this queue. All subsequent invocations of pushBack
or tryPushBack
will fail immediately. If the single producer is blocked in pushBack
, the invocation of pushBack
will fail immediately. If the queue is already enqueue disabled, this method has no effect.
◆ 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()
◆ popFront()
Remove the element from the front of this queue and load that element into the specified value
. If the queue is empty, block until it is not empty. Return 0 on success, and a non-zero value otherwise. Specifically, return e_SUCCESS
on success, e_DISABLED
if isPopFrontDisabled()
and e_FAILED
if an underlying mechanism returns an error. On failure, value
is not changed. Threads blocked due to the queue being empty will return e_DISABLED
if disablePopFront
is invoked. The behavior is undefined unless the invoker of this method is the single consumer.
◆ pushBack() [1/2]
Append the specified move-insertable value
to the back of this queue. value
is left in a valid but unspecified state. Return 0 on success, and a non-zero value otherwise. Specifically, return e_SUCCESS
on success, e_DISABLED
if isPushBackDisabled()
and e_FAILED
if an underlying mechanism returns an error. On failure, value
is not changed. Threads blocked due to the queue being full will return e_DISABLED
if disablePushFront
is invoked. The behavior is undefined unless the invoker of this method is the single producer.
◆ pushBack() [2/2]
Append the specified value
to the back of this queue. Return 0 on success, and a non-zero value otherwise. Specifically, return e_SUCCESS
on success, e_DISABLED
if isPushBackDisabled()
and e_FAILED
if an underlying mechanism returns an error. Threads blocked due to the queue being full will return e_DISABLED
if disablePushFront
is invoked. The behavior is undefined unless the invoker of this method is the single producer.
◆ removeAll()
Remove all items currently in this queue. Note that this operation is not atomic; if other threads are concurrently pushing items into the queue the result of numElements()
after this function returns is not guaranteed to be 0. The behavior is undefined unless the invoker of this method is the single consumer.
◆ tryPopFront()
Attempt to remove the element from the front of this queue without blocking, and, if successful, load the specified value
with the removed element. Return 0 on success, and a non-zero value otherwise. Specifically, return e_SUCCESS
on success, e_DISABLED
if isPopFrontDisabled()
, and e_EMPTY
if !isPopFrontDisabled()
and the queue was empty. On failure, value
is not changed. The behavior is undefined unless the invoker of this method is the single consumer.
◆ tryPushBack() [1/2]
Append the specified move-insertable value
to the back of this queue. value
is left in a valid but unspecified state. Return 0 on success, and a non-zero value otherwise. Specifically, return e_SUCCESS
on success, e_DISABLED
if isPushBackDisabled()
, and e_FULL
if !isPushBackDisabled()
and the queue was full. On failure, value
is not changed. The behavior is undefined unless the invoker of this method is the single producer.
◆ tryPushBack() [2/2]
Append the specified value
to the back of this queue. Return 0 on success, and a non-zero value otherwise. Specifically, return e_SUCCESS
on success, e_DISABLED
if isPushBackDisabled()
, and e_FULL
if !isPushBackDisabled()
and the queue was full. The behavior is undefined unless the invoker of this method is the single producer.
◆ waitUntilEmpty()
Block until all the elements in this queue are removed. Return 0 on success, and a non-zero value otherwise. Specifically, return e_SUCCESS
on success, e_DISABLED
if isPopFrontDisabled()
and e_FAILED
if an underlying mechanism returns an error. A blocked thread waiting for the queue to empty will return a non-zero value if disablePopFront
is invoked.
◆ SingleProducerSingleConsumerBoundedQueue_PopCompleteGuard< SingleProducerSingleConsumerBoundedQueue< TYPE >, typename SingleProducerSingleConsumerBoundedQueue< TYPE >::Node >
The documentation for this class was generated from the following file: