8#ifndef INCLUDED_BDLCC_FIXEDQUEUEINDEXMANAGER
9#define INCLUDED_BDLCC_FIXEDQUEUEINDEXMANAGER
227#include <bdlscm_version.h>
240#include <bsl_iosfwd.h>
241#include <bsl_cstddef.h>
242#include <bsl_cstdlib.h>
271 const char d_pushIndexPad[k_PADDING];
279 const char d_popIndexPad[k_PADDING];
282 const bsl::size_t d_capacity;
286 const unsigned int d_maxGeneration;
291 const unsigned int d_maxCombinedIndex;
321 unsigned int nextCombinedIndex(
unsigned int combinedIndex)
const;
324 unsigned int nextGeneration(
unsigned int generation)
const;
355 unsigned int subtrahend,
356 unsigned int modulo);
374#ifndef BDE_OMIT_INTERNAL_DEPRECATED
476 unsigned int *disposedIndex,
477 unsigned int endGeneration,
478 unsigned int endIndex);
509 bsl::ostream&
print(bsl::ostream& stream)
const;
522unsigned int FixedQueueIndexManager::nextCombinedIndex(
523 unsigned int combinedIndex)
const
533 return combinedIndex + 1;
538unsigned int FixedQueueIndexManager::nextGeneration(
539 unsigned int generation)
const
544 return generation + 1;
Definition bdlcc_fixedqueueindexmanager.h:257
~FixedQueueIndexManager()
Destroy this object.
FixedQueueIndexManager(bsl::size_t capacity, bslma::Allocator *basicAllocator=0)
void commitPushIndex(unsigned int generation, unsigned int index)
bsl::size_t capacity() const
Return the maximum number of items that may be stored in the queue.
Definition bdlcc_fixedqueueindexmanager.h:549
int reservePopIndex(unsigned int *generation, unsigned int *index)
static int circularDifference(unsigned int minuend, unsigned int subtrahend, unsigned int modulo)
int reservePushIndex(unsigned int *generation, unsigned int *index)
@ e_MAX_CAPACITY
Definition bdlcc_fixedqueueindexmanager.h:375
@ k_MAX_CAPACITY
Definition bdlcc_fixedqueueindexmanager.h:364
void enable()
Mark the queue as enabled.
static unsigned int numRepresentableGenerations(bsl::size_t capacity)
void abortPushIndexReservation(unsigned int generation, unsigned int index)
void commitPopIndex(unsigned int generation, unsigned int index)
bsl::size_t length() const
Return a snapshot of the number of items in the queue.
BSLMF_NESTED_TRAIT_DECLARATION(FixedQueueIndexManager, bslma::UsesBslmaAllocator)
bsl::ostream & print(bsl::ostream &stream) const
int reservePopIndexForClear(unsigned int *disposedGeneration, unsigned int *disposedIndex, unsigned int endGeneration, unsigned int endIndex)
Definition bslma_allocator.h:457
Definition bsls_atomic.h:743
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlcc_boundedqueue.h:270
Definition bslma_usesbslmaallocator.h:343