Thread-enabled index manager for a fixed-size circular buffer.
Declared in <bdlcc_fixedqueueindexmanager.h>
class FixedQueueIndexManager;
This class implements a circular buffer of atomic state variables. These are intended to synchronize access to another (non-atomic) indexed data structure so that the other data structure can be used as a thread-enabled fixed-size queue.
| Name | Description |
|---|---|
Unnamed enum | Capacity-related constants for this index manager. |
| Name | Description |
|---|---|
FixedQueueIndexManager [constructor] | Create an index manager for a circular buffer having the specified maximum capacity. |
~FixedQueueIndexManager [destructor] | Destroy this object. |
abortPushIndexReservation | Release the specified index for use in the next generation. |
capacity | Return the maximum number of items that may be stored in the queue. |
commitPopIndex | Mark the specified index as available (empty) in the next generation. |
commitPushIndex | Mark the specified index as occupied (full) in the specified generation. |
disable | Mark the queue as disabled. Future calls to reservePushIndex will fail. |
enable | Mark the queue as enabled. |
isEnabled | Return true if the queue is enabled, and false if it is disabled. |
length | Return a snapshot of the number of items in the queue. |
print | Print a formatted string describing the current state of this object to the specified stream. |
reservePopIndex | Reserve the next available index from which to dequeue an element. |
reservePopIndexForClear | Reserve a pop index for clearing cells up to a push reservation. |
reservePushIndex | Reserve the next available index at which to enqueue an element. |
operator BloombergLP::bslmf::NestedTraitDeclaration<FixedQueueIndexManager, UsesBslmaAllocator> | Declare that this type uses a bslma allocator. |
| Name | Description |
|---|---|
circularDifference | Return the signed circular difference of two values modulo a bound. |
numRepresentableGenerations | Return the number of representable generations for a circular buffer of the specified capacity. |