This class provides a thread‐safe unbounded queue of values that assumes a single producer thread.
Synopsis
Declared in <bdlcc_singleproducerqueueimpl.h>
template<
class TYPE,
class ATOMIC_OP,
class MUTEX,
class CONDITION>
class SingleProducerQueueImpl;
Description
The types ATOMIC_OP, MUTEX, and CONDITION are exposed for testing. Typical usage is with bsls::AtomicOperations for ATOMIC_OP, bslmt::Mutex for MUTEX, and bslmt::Condition for CONDITION.
Type Aliases
Name |
Description |
The type for elements stored in this queue. |
Enums
Name |
Description |
Status codes returned by queue operations. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this object. |
Return the allocator used by this object to supply memory. |
|
Disable dequeueing from this queue. All subsequent invocations of |
|
Disable enqueueing into this queue. All subsequent invocations of |
|
Enable dequeueing. If the queue is not dequeue disabled, this call has no effect. |
|
Enable queuing. If the queue is not enqueue disabled, this call has no effect. |
|
Return |
|
Return |
|
Return |
|
Return |
|
Returns the number of elements currently in this queue. |
|
Remove the element from the front of this queue and load that element into the specified |
|
|
|
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 |
|
Attempt to remove the element from the front of this queue without blocking, and, if successful, load the specified |
|
|
|
Block until all the elements in this queue are removed. Return 0 on success, and a non‐zero value otherwise. Specifically, return |
|
|
Declare that this type uses a |
Friends
Name |
Description |
|
This class implements a guard automatically invokes |
|
This class implements a proctor that, unless its |
Created with MrDocs