23 #ifndef __ccxx_CircularBuffer_hxx 24 #define __ccxx_CircularBuffer_hxx 151 bool resetPeek =
true);
191 {
return(_peekAvail); }
195 {
return(_avail == 0); }
199 {
return(this->
_size == _avail); }
203 {
return(this->
_size - _avail); }
207 {
return(_readPos); }
211 {
return(_writePos); }
215 {
return(_peekPos); }
278 {
return(_writeShift > 0); }
286 {
return(_readShift > 0); }
350 #include <commonc++/CircularBufferImpl.h++> 357 #endif // __ccxx_CircularBuffer_hxx T * advanceReadPos()
Advance the read position by the number of elements in the read extent, wrapping to the beginning of ...
Definition: CircularBuffer.h++:245
uint_t getPeekRemaining() const
Get the number of elements available to be peeked, that is, the number of elements between the peek p...
Definition: CircularBuffer.h++:190
uint_t getFree() const
Get the number of elements available to be written to the buffer.
Definition: CircularBuffer.h++:202
void rewindWritePos()
Rewinds the write position to the write mark, and clears the write mark.
bool setWritePosFromMark(uint_t count)
Moves the write position relative to the write mark.
An unbuffered I/O stream.
Definition: Stream.h++:60
bool isPartialRead() const
Determine if a partially-read element is in the buffer.
Definition: CircularBuffer.h++:285
void markWritePos()
Marks the current write position.
T * getWritePos()
Get the current write position.
Definition: CircularBuffer.h++:210
unsigned int uint_t
An alias for unsigned int.
Definition: Integers.h++:74
void clear()
Clear the buffer.
uint_t read(T *buf, uint_t count)
Read data from the buffer into an array.
bool setReadPosFromMark(uint_t count)
Moves the read position relative to the read mark.
T * getReadPos()
Get the current read position.
Definition: CircularBuffer.h++:206
uint_t getReadExtent() const
Get the read extent.
T * advanceWritePos()
Advance the write position by the number of elements in the write extent, wrapping to the beginning o...
Definition: CircularBuffer.h++:255
~CircularBuffer()
Destructor.
uint_t getWriteExtent() const
Get the write extent.
T * advancePeekPos(uint_t count)
Advance the peek position by the given number of elements, wrapping to the beginning of the buffer if...
void markReadPos()
Marks the current read position.
uint_t write(const T *buf, uint_t count)
Write data from an array into the buffer.
bool isFull() const
Determine if the buffer is full.
Definition: CircularBuffer.h++:198
bool isPartialWrite() const
Determine if a partially-written element is in the buffer.
Definition: CircularBuffer.h++:277
void setSize(uint_t newSize)
Resize the buffer.
A buffer for storing a contiguous sequence of elements.
Definition: Buffer.h++:44
uint_t fill(const T &value, uint_t count)
Fill the buffer with the given value.
A circular buffer that can be used to efficiently transfer data between buffers and/or streams...
Definition: CircularBuffer.h++:54
uint_t _size
The size of the buffer.
Definition: AbstractBuffer.h++:98
bool isEmpty() const
Determine if the buffer is empty.
Definition: CircularBuffer.h++:194
An abstract base class for buffers.
Definition: AbstractBuffer.h++:38
uint_t getRemaining() const
Get the number of elements available to be read from the buffer.
Definition: CircularBuffer.h++:183
CircularBuffer(uint_t size)
Construct a new CircularBuffer with the given size.
void rewindReadPos()
Rewinds the read position to the read mark, and clears the read mark.
Definition: AllocationMap.c++:25
void resetPeekPos()
Reset the peek position to the read position.
uint_t peek(const T &value, uint_t maxlen, bool &found, bool resetPeek=true)
Scan forward from the current peek position for an element equal to the given value.
T * getPeekPos()
Get the current peek position.
Definition: CircularBuffer.h++:214
CircularBuffer< byte_t > CircularByteBuffer
Definition: CircularBuffer.h++:352
CircularBuffer< char > CircularCharBuffer
Definition: CircularBuffer.h++:353