Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ark::Fifo< T > Class Template Reference

#include <Fifo.h>

List of all members.

Public Member Functions

 Fifo (unsigned int buffSz)
bool get (T &t)
bool peekGet () const
bool put (T const &data)
unsigned size () const
unsigned room () const
unsigned numQueued () const

Private Attributes

Atomic< unsigned > _readIndex
Atomic< unsigned > _writeIndex
std::vector< T > _buffer


Detailed Description

template<typename T>
class ark::Fifo< T >

Note:
Only get, put and size, are atomic, everything else is aproximation.


Constructor & Destructor Documentation

template<typename T>
ark::Fifo< T >::Fifo unsigned int  buffSz  )  [inline]
 

contructor


Member Function Documentation

template<typename T>
bool ark::Fifo< T >::get T &  t  )  [inline]
 

get Gets the next object of type T in the fifo and returns true, or returns false if there is no objects to get in the fifo.

Parameters:
t The object to copy into
Returns:
True if an object from the fifo was copied into t

template<typename T>
unsigned ark::Fifo< T >::numQueued  )  const [inline]
 

numQueued

Returns:
Number of objects of type T are waiting to be get()'ed
See also:
room()

template<typename T>
bool ark::Fifo< T >::peekGet  )  const [inline]
 

peekGet Takes a peek at the 'get' end and returns true if something is available to get.

Returns:
True if get will return true upon next call

template<typename T>
bool ark::Fifo< T >::put T const &  data  )  [inline]
 

put Copies an object of type T into the fifo and returns true, or returns false if there is no room in the fifo.

Parameters:
data The object to copy into the fifo
Returns:
True if data was copied into the fifo

template<typename T>
unsigned ark::Fifo< T >::room  )  const [inline]
 

room The amount of room available in the buffer. This value is a minimum guarantee but there 'may' be more room. Basically room() + numQueued() != size() sometimes.

Returns:
Amount of space available to copy objects into

template<typename T>
unsigned ark::Fifo< T >::size  )  const [inline]
 

size

Returns:
The overall size of the fifo


Member Data Documentation

template<typename T>
std::vector<T> ark::Fifo< T >::_buffer [private]
 

template<typename T>
Atomic<unsigned> ark::Fifo< T >::_readIndex [private]
 

template<typename T>
Atomic<unsigned> ark::Fifo< T >::_writeIndex [private]
 


The documentation for this class was generated from the following file:
Generated on Tue Sep 6 14:54:40 2005 for Arkonnekt Sound by  doxygen 1.4.4