18 #ifndef __ecbuf_h_included 19 #define __ecbuf_h_included 36 DECLARE_ERROR(ECircularBufferError_BufferSizeHasBeenExceeded);
38 DECLARE_ERROR(ECircularBufferError_AttemptToModifyDataOutsideBoundsOfCurrentBuffer);
62 Int
used() {
return m_used; }
64 Int
free() {
return m_capacity - m_used; }
73 Int
peekData(pUChar dest, Int offset, Int length)
75 return readData(dest, offset, length,
true);
82 Int
readData(pUChar dest, Int offset, Int length)
84 return readData(dest, offset, length,
false);
96 void writeData(cpUChar src, Int offset, Int length, Bool nolock=
False);
110 void modifyData(cpUChar src, Int offset, Int length, Bool nolock=
False);
117 Int
readData(pUChar dest, Int offset, Int length, Bool peek);
130 #endif // #define __ecbuf_h_included EMutexPrivate & getMutex()
Retrieves the mutex;.
Definition: ecbuf.h:114
Macros for various standard C library functions and standard includes.
Void initialize()
Initializes the circular buffer.
Definition: ecbuf.cpp:37
Bool isEmpty()
True - the buffer is empty, False - there is data in the buffer.
Definition: ecbuf.h:58
Int free()
Returns the number of bytes that are free in the buffer.
Definition: ecbuf.h:64
Int peekData(pUChar dest, Int offset, Int length)
Reads data from the buffer without removing it from the buffer.
Definition: ecbuf.h:73
void writeData(cpUChar src, Int offset, Int length, Bool nolock=False)
Writes data to the circular buffer.
Definition: ecbuf.cpp:102
#define False
False.
Definition: ebase.h:27
~ECircularBuffer()
Class destructor.
Definition: ecbuf.cpp:28
void modifyData(cpUChar src, Int offset, Int length, Bool nolock=False)
Modifies data within the buffer.
Definition: ecbuf.cpp:135
Int capacity()
Returns the maximum capacity of the circular buffer.
Definition: ecbuf.h:60
Defines base class for exceptions and declaration helper macros.
Implements a circular buffer.
Definition: ecbuf.h:45
#define DECLARE_ERROR(__e__)
Declares exception class derived from EError with no constructor parameters.
Definition: eerror.h:53
A private mutex (the mutex data is allocated from either the heap or stack).
Definition: esynch.h:175
Int used()
Returns the number of bytes in use in the buffer.
Definition: ecbuf.h:62
Contains definitions for synchronization objects.
Int readData(pUChar dest, Int offset, Int length)
Reads and removes data from the buffer.
Definition: ecbuf.h:82