#include <AbstractBuffer.h++>


Public Member Functions | |
| virtual | ~AbstractBuffer () throw () |
| Destructor. | |
| virtual void | setSize (size_t newSize) |
| Resize the buffer. | |
| virtual void | clear () throw () |
| Clear the buffer. | |
| size_t | getSize () const throw () |
| Get the size of the buffer. | |
| virtual size_t | getRemaining () const =0 throw () |
| Get the number of elements remaining in the buffer. | |
| virtual bool | hasRemaining () const throw () |
| Test if the buffer has elements available to be read or written. | |
| T * | getBase () throw () |
| Get a pointer to the base of the buffer. | |
| const T * | getBase () const throw () |
| Get a pointer to the base of the buffer. | |
Protected Member Functions | |
| AbstractBuffer (size_t size) | |
| Construct a new buffer with the given size. | |
Protected Attributes | |
| T * | _data |
| A pointer to the raw buffer. | |
| size_t | _size |
| The size of the buffer. | |
| ~AbstractBuffer | ( | ) | throw () [inline, virtual] |
Destructor.
| AbstractBuffer | ( | size_t | size | ) | [inline, protected] |
Construct a new buffer with the given size.
| size | The capacity of the buffer, in elements. |
| void clear | ( | ) | throw () [inline, virtual] |
Clear the buffer.
Reimplemented in Buffer< T >, CircularBuffer< T >, Buffer< char >, Buffer< byte_t >, CircularBuffer< C >, and CircularBuffer< byte_t >.
| const T* getBase | ( | ) | const throw () [inline] |
Get a pointer to the base of the buffer.
| T* getBase | ( | ) | throw () [inline] |
Get a pointer to the base of the buffer.
| virtual size_t getRemaining | ( | ) | const throw () [pure virtual] |
Get the number of elements remaining in the buffer.
Implemented in Buffer< T >, CircularBuffer< T >, Buffer< char >, Buffer< byte_t >, CircularBuffer< C >, and CircularBuffer< byte_t >.
| size_t getSize | ( | ) | const throw () [inline] |
Get the size of the buffer.
| virtual bool hasRemaining | ( | ) | const throw () [inline, virtual] |
Test if the buffer has elements available to be read or written.
Reimplemented in Buffer< T >, Buffer< char >, and Buffer< byte_t >.
| void setSize | ( | size_t | newSize | ) | [inline, virtual] |
Resize the buffer.
| newSize | The new size, in elements. |
Reimplemented in CircularBuffer< T >, JavaBuffer, CircularBuffer< C >, and CircularBuffer< byte_t >.
T* _data [protected] |
A pointer to the raw buffer.
size_t _size [protected] |
The size of the buffer.
1.5.9