CrystalSpace

Public API Reference

csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler > 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 Member Functions

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

Detailed Description

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
class csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >

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

Definition at line 36 of file fifo.h.


Constructor & Destructor Documentation

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >::csFIFO ( size_t  icapacity = 0,
const CapacityHandler &  ch = CapacityHandler() 
) [inline]

Construct the FIFO.

See csArray documentation for meaning of parameters.

Definition at line 51 of file fifo.h.


Member Function Documentation

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
T& csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >::Bottom (  )  [inline]

Return the last element.

Definition at line 114 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
bool csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >::Contains ( T const &  what  )  [inline]

Linearly search for an item.

Returns:
Whether the item was found.

Definition at line 166 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
bool csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >::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 157 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
void csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >::DeleteAll (  )  [inline]

Delete all items.

Definition at line 173 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
size_t csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >::GetSize (  )  const [inline]

Return the number of elements in the FIFO.

Definition at line 138 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
size_t csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >::Length (  )  const [inline]

Return the number of elements in the FIFO.

Deprecated:
Use GetSize() instead.

Definition at line 148 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
T csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >::PopBottom (  )  [inline]

Return and remove the last element.

Definition at line 95 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
T csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >::PopTop (  )  [inline]

Return and remove the first element.

Definition at line 58 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
void csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >::Push ( T const &  what  )  [inline]

Push an element onto the FIFO.

Definition at line 132 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = CS::Container::ArrayAllocDefault, class CapacityHandler = csArrayCapacityFixedGrow<16>>
T& csFIFO< T, ElementHandler, MemoryAllocator, CapacityHandler >::Top (  )  [inline]

Return the first element.

Definition at line 76 of file fifo.h.


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

Generated for Crystal Space 2.1 by doxygen 1.6.1