#include <bdlcc_fixedqueue.h>
List of all members.
Detailed Description
template<class TYPE>
class bdlcc::FixedQueue< TYPE >
This class provides a thread-aware, lock-free, fixed-size queue of values.
See Component bdlcc_fixedqueue
Constructor & Destructor Documentation
Create a thread-aware lock-free queue having the specified capacity
. Optionally specify a basicAllocator
used to supply memory. If basicAllocator
is 0, the currently installed default allocator is used. The behavior is undefined unless 0 < capacity
and capacity <= bdlcc::FixedQueueIndexManager::k_MAX_CAPACITY
.
Member Function Documentation
Append the specified value
to the back of this queue, blocking until either space is available - if necessary - or the queue is disabled. Return 0 on success, and a nonzero value if the queue is disabled.
Append the specified move-insertable value
to the back of this queue, blocking until either space is available - if necessary - or the queue is disabled. value
is left in a valid but unspecified state. Return 0 on success, and a nonzero value if the queue is disabled.
Attempt to append the specified value
to the back of this queue without blocking. Return 0 on success, and a non-zero value if the queue is full or disabled.
Attempt to append the specified move-insertable value
to the back of this queue without blocking. value
is left in a valid but unspecified state. Return 0 on success, and a non-zero value if the queue is full or disabled.
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.
Remove the element from the front of this queue and return it's value. If the queue is empty, block until it is not empty.
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 if queue was empty. On failure, value
is not changed.
Remove all items from 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.
Disable this queue. All subsequent invocations of pushBack
or tryPushBack
will fail immediately. All blocked invocations of pushBack
will fail immediately. If the queue is already disabled, this method has no effect.
Enable queuing. If the queue is not disabled, this call has no effect.
Return the maximum number of elements that may be stored in this queue.
Return true
if this queue is empty (has no elements), or false
otherwise.
Return true
if this queue is enabled, and false
otherwise. Note that the queue is created in the "enabled" state.
Return true
if this queue is full (when the number of elements currently in this queue equals its capacity), or false
otherwise.
Returns the number of elements currently in this queue.
[!DEPRECATED!] Invoke numElements
.
[!DEPRECATED!] Invoke capacity
.
Friends And Related Function Documentation
The documentation for this class was generated from the following file: