CrystalSpace

Public API Reference

csFIFO< T, ElementHandler, MemoryAllocator > Class Template Reference

A FIFO implemented on top of csArray<>, but faster than using just a single array. More...

#include <csutil/fifo.h>

List of all members.

Public Types

typedef MemoryAllocator AllocatorType
typedef ElementHandler ElementHandlerType
typedef csFIFO< T, ElementHandler,
MemoryAllocator > 
ThisType
typedef T ValueType

Public Member Functions

 csFIFO (size_t icapacity=0, size_t ithreshold=0)
 Construct the FIFO.
bool Delete (T const &what)
 Linearly search for an item and delete it.
void DeleteAll ()
 Delete all items.
size_t Length ()
 Return number of elements.
PopTop ()
 Return and remove the first element.
void Push (T const &what)
 Push an element onto the FIFO.


Detailed Description

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Memory::AllocatorMalloc>
class csFIFO< T, ElementHandler, MemoryAllocator >

A FIFO implemented on top of csArray<>, but faster than using just a single array.

Definition at line 35 of file fifo.h.


Constructor & Destructor Documentation

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Memory::AllocatorMalloc>
csFIFO< T, ElementHandler, MemoryAllocator >::csFIFO ( size_t  icapacity = 0,
size_t  ithreshold = 0 
) [inline]

Construct the FIFO.

See csArray<> documentation for meaning of parameters.

Definition at line 50 of file fifo.h.


Member Function Documentation

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Memory::AllocatorMalloc>
bool csFIFO< T, ElementHandler, MemoryAllocator >::Delete ( T const &  what  )  [inline]

Linearly search for an item and delete it.

Returns:
Whether the item was found and subsequently deleled.

Definition at line 89 of file fifo.h.

References csArray< T, ElementHandler, MemoryAllocator, CapacityHandler >::Delete().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Memory::AllocatorMalloc>
void csFIFO< T, ElementHandler, MemoryAllocator >::DeleteAll (  )  [inline]

Delete all items.

Definition at line 95 of file fifo.h.

References csArray< T, ElementHandler, MemoryAllocator, CapacityHandler >::DeleteAll().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Memory::AllocatorMalloc>
size_t csFIFO< T, ElementHandler, MemoryAllocator >::Length (  )  [inline]

Return number of elements.

Definition at line 80 of file fifo.h.

References csArray< T, ElementHandler, MemoryAllocator, CapacityHandler >::Length().

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Memory::AllocatorMalloc>
T csFIFO< T, ElementHandler, MemoryAllocator >::PopTop (  )  [inline]

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Memory::AllocatorMalloc>
void csFIFO< T, ElementHandler, MemoryAllocator >::Push ( T const &  what  )  [inline]

Push an element onto the FIFO.

Definition at line 74 of file fifo.h.

References csArray< T, ElementHandler, MemoryAllocator, CapacityHandler >::Push().


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.4.7