#include <buffer.h>
Public Member Functions | |
Buffer () | |
virtual | ~Buffer () |
void | operator<< (const T e) |
void | operator>> (T &e) throw (OutOfBoundsException) |
void | purge (void) |
bool | isEmpty (void) const |
unsigned int | size (void) const |
virtual const T & | operator[] (int index) const throw (OutOfRangeException<int>) |
virtual T & | operator[] (int index) throw (OutOfRangeException<int>) |
Static Public Member Functions | |
static void | setBinSize (unsigned int size) |
seal::Buffer< T >::Buffer | ( | void | ) | [inline] |
Default and the only constructor.
virtual seal::Buffer< T >::~Buffer | ( | ) | [inline, virtual] |
Destructor.
static void seal::Buffer< T >::setBinSize | ( | unsigned int | size | ) | [static] |
Sets the bin size of buffer. Use this function only if you are sure of what you are doing!
void seal::Buffer< T >::operator<< | ( | const T | e | ) | [inline] |
The operator with which one has to write into the buffer. The size of the buffer increases by 1 with every valid write into the buffer.
e | The element which has to be written into the buffer. |
void seal::Buffer< T >::operator>> | ( | T & | e | ) | throw (OutOfBoundsException) [inline] |
The operator which reads an element out of the buffer. The elements are read in the first in first out order. The size of the buffer decreases by 1 with every valid read.
e | The variable into which the element should element should be read out to. |
void seal::Buffer< T >::purge | ( | void | ) | [inline] |
Flushes out all the elements from the buffer.
bool seal::Buffer< T >::isEmpty | ( | void | ) | const [inline] |
Returns true if the buffer is empty, false otherwise.
unsigned int seal::Buffer< T >::size | ( | void | ) | const [inline] |
Returns the number of elements currently in the buffer.
const T & seal::Buffer< T >::operator[] | ( | int | index | ) | const throw (OutOfRangeException<int>) [inline, virtual] |
Array like indexing operator.
Implements seal::RandomAccess< T >.
T & seal::Buffer< T >::operator[] | ( | int | index | ) | throw (OutOfRangeException<int>) [inline, virtual] |
Array like indexing operator.
Implements seal::RandomAccess< T >.