seal::Buffer< T > Class Template Reference

#include <buffer.h>

Inheritance diagram for seal::Buffer< T >:

seal::RandomAccess< T >

List of all members.

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)


Detailed Description

template<typename T>
class seal::Buffer< T >

This class encapsulates a read write buffer storage. One write into and read out of the buffers. The class also provides a array indexing like operator [] which facilitates random access of the elements in the buffer. The elements in the buffer are present in the order in which they have been written into.

Constructor & Destructor Documentation

template<typename T>
seal::Buffer< T >::Buffer ( void   )  [inline]

Default and the only constructor.

template<typename T>
virtual seal::Buffer< T >::~Buffer (  )  [inline, virtual]

Destructor.


Member Function Documentation

template<typename T>
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!

template<typename T>
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.

Parameters:
e The element which has to be written into the buffer.

template<typename T>
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.

Parameters:
e The variable into which the element should element should be read out to.

template<typename T>
void seal::Buffer< T >::purge ( void   )  [inline]

Flushes out all the elements from the buffer.

template<typename T>
bool seal::Buffer< T >::isEmpty ( void   )  const [inline]

Returns true if the buffer is empty, false otherwise.

template<typename T>
unsigned int seal::Buffer< T >::size ( void   )  const [inline]

Returns the number of elements currently in the buffer.

template<typename T>
const T & seal::Buffer< T >::operator[] ( int  index  )  const throw (OutOfRangeException<int>) [inline, virtual]

Array like indexing operator.

Implements seal::RandomAccess< T >.

template<typename T>
T & seal::Buffer< T >::operator[] ( int  index  )  throw (OutOfRangeException<int>) [inline, virtual]

Array like indexing operator.

Implements seal::RandomAccess< T >.


The documentation for this class was generated from the following file:

Generated on Sat May 16 21:35:20 2009 for SEAL by  doxygen 1.5.5