1#ifndef Cpl_Container_RingBuffer_MT_h_
2#define Cpl_Container_RingBuffer_MT_h_
This template class implements a Ring Buffer.
Definition RingBuffer.h:46
ITEM * peekTail(void) const noexcept
Returns a pointer to the last item in the Buffer.
Definition RingBuffer.h:321
bool isFull(void) const noexcept
This method returns true if the Ring Buffer is full.
Definition RingBuffer.h:345
ITEM * peekHead(void) const noexcept
Returns a pointer to the first item in the Buffer.
Definition RingBuffer.h:310
void clearTheBuffer() noexcept
Empties the Ring Buffer.
Definition RingBuffer.h:210
void removeElements(unsigned numElementsToRemove) noexcept
This method 'removes' N elements - that were removed using the pointer returned from peekNextRemoveIt...
Definition RingBuffer.h:269
ITEM * peekNextAddItems(unsigned &dstNumFlatElements) noexcept
This method returns a pointer to the next item to be added.
Definition RingBuffer.h:280
unsigned getNumItems(void) const noexcept
This method returns the current number of items in the Ring Buffer.
Definition RingBuffer.h:356
ITEM * peekNextRemoveItems(unsigned &dstNumFlatElements) noexcept
This method returns a pointer to the next item to be removed.
Definition RingBuffer.h:251
unsigned getMaxItems(void) const noexcept
This method returns the maximum number of items that can be stored in the Ring buffer.
Definition RingBuffer.h:368
bool add(const ITEM &item) noexcept
The contents of 'item' will be copied into the Ring Buffer as the 'last' item in the buffer.
Definition RingBuffer.h:217
bool isEmpty(void) const noexcept
This method returns true if the Ring Buffer is empty.
Definition RingBuffer.h:339
bool remove(ITEM &dst) noexcept
Removes the first item in the Buffer.
Definition RingBuffer.h:234
void addElements(unsigned numElementsAdded) noexcept
This method 'adds' N elements - that were populated using the pointer returned from peekNextAddItems ...
Definition RingBuffer.h:299
This template class implements a THREAD SAFE Ring Buffer.
Definition RingBufferMT.h:33
RingBufferMT(unsigned maxElements, ITEM memoryForElements[]) noexcept
Constructor.
Definition RingBufferMT.h:40
bool remove(ITEM &dst) noexcept
See Cpl::Container::RingBuffer.
Definition RingBufferMT.h:46
void addElements(unsigned numElementsAdded) noexcept
This method 'adds' N elements - that were populated using the pointer returned from peekNextAddItems ...
Definition RingBufferMT.h:86
ITEM * peekNextAddItems(unsigned &dstNumFlatElements) noexcept
This method returns a pointer to the next item to be added.
Definition RingBufferMT.h:69
bool add(const ITEM &item) noexcept
See Cpl::Container::RingBuffer.
Definition RingBufferMT.h:49
unsigned getNumItems(void) const noexcept
See Cpl::Container::RingBuffer.
Definition RingBufferMT.h:127
Cpl::System::Mutex m_lock
Mutex for critical sections.
Definition RingBufferMT.h:147
void clearTheBuffer() noexcept
See Cpl::Container::RingBuffer.
Definition RingBufferMT.h:134
bool isEmpty(void) const noexcept
See Cpl::Container::RingBuffer.
Definition RingBufferMT.h:121
ITEM * peekNextRemoveItems(unsigned &dstNumFlatElements) noexcept
This method returns a pointer to the next item to be removed.
Definition RingBufferMT.h:100
void removeElements(unsigned numElementsToRemove) noexcept
This method 'removes' N elements - that were removed using the pointer returned from peekNextRemoveIt...
Definition RingBufferMT.h:116
ITEM * peekHead(void) const noexcept
See Cpl::Container::RingBuffer.
Definition RingBufferMT.h:52
ITEM * peekTail(void) const noexcept
See Cpl::Container::RingBuffer.
Definition RingBufferMT.h:55
unsigned getMaxItems(void) const noexcept
See Cpl::Container::RingBuffer.
Definition RingBufferMT.h:130
bool isFull(void) const noexcept
See Cpl::Container::RingBuffer.
Definition RingBufferMT.h:124
This concrete class provides a simple mechanism for providing mutex protection for a "scope block".
Definition Mutex.h:77
This mutex class defines the interface for a mutex that has "recursive" semantics.
Definition Mutex.h:33
void unlock(void)
This method is invoke at the end of a critical section.
void lock(void)
This method is invoked prior to entering a critical section.
The 'Cpl' namespace is the root name space for the Colony.
Definition Api16.h:20