## 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 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 = csArrayMemoryAllocator<T>>
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 = csArrayMemoryAllocator<T>>
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 43 of file fifo.h.

## Member Function Documentation

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
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 82 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csFIFO< T, ElementHandler, MemoryAllocator >::DeleteAll | ( |  | ) | `[inline]`

| Delete all items. Definition at line 88 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
size_t csFIFO< T, ElementHandler, MemoryAllocator >::Length | ( |  | ) | `[inline]`

| Return number of elements. Definition at line 73 of file fifo.h.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
T csFIFO< T, ElementHandler, MemoryAllocator >::PopTop | ( |  | ) | `[inline]`

| Return and remove the first element. Definition at line 49 of file fifo.h. References CS_ASSERT.

template<class T, class ElementHandler = csArrayElementHandler<T>, class MemoryAllocator = csArrayMemoryAllocator<T>>
void csFIFO< T, ElementHandler, MemoryAllocator >::Push | ( | T const & | what | ) | `[inline]`

| Push an element onto the FIFO. Definition at line 67 of file fifo.h.

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

- csutil/fifo.h