Crystal Space: csFIFO< T, ElementHandler, MemoryAllocator > Class Template Reference (Crystal Space Public API Reference)

| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# 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.
T | 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]`

Return and remove the first element.

Definition at line 56 of file fifo.h.

References CS_ASSERT, csArray< T, ElementHandler, MemoryAllocator, CapacityHandler >::Empty(), csArray< T, ElementHandler, MemoryAllocator, CapacityHandler >::Length(), csArray< T, ElementHandler, MemoryAllocator, CapacityHandler >::Pop(), and csArray< T, ElementHandler, MemoryAllocator, CapacityHandler >::Push().

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:

- csutil/fifo.h