Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

CFixedPool< T > Class Template Reference

List of all members.

Detailed Description

template<typename T>
class CFixedPool< T >

A pool container.

Holds arbitrary type items by value. The good things about it:

Bad things: Basic things about this pool are: size(), hasSpace(), clear(), add(), erase(), begin() and end().
Parameters:
T  Type of the items.


Public Methods

 CFixedPool (int space)
 Constructor.

 ~CFixedPool ()
 Destructor.

int size () const
 Returns current item count.

int capacity () const
 Returns total capacity.

bool empty () const
 Returns whether the pool is empty.

bool hasSpace () const
 Returns whether the pool is not full.

T & add (const T &value=T())
 Adds item to pool.

void clear ()
 Clears the pool.

iterator erase (iterator it)
 Erases a single item.

iterator begin ()
 Returns iterator to the first item.

const_iterator begin () const
 Returns const iterator to the first item.

iterator end ()
 Returns iterator to the item "beyond the last".

const_iterator end () const
 Returns const iterator to the item "beyond the last".


Constructor & Destructor Documentation

template<typename T>
CFixedPool< T >::CFixedPool int    space [inline, explicit]
 

Constructor.

Parameters:
space  Maximum capacity of the pool.


Member Function Documentation

template<typename T>
T& CFixedPool< T >::add const T &    value = T() [inline]
 

Adds item to pool.

Copies the given item to the pool, and returns a reference to a copy. You should use the returned reference to point to an item in the pool (not the given one!).

Parameters:
value  The item.

template<class T>
CFixedPool< T >::iterator CFixedPool< T >::erase iterator    it
 

Erases a single item.

Parameters:
it  Iterator to the item that should be erased.
Returns :
Iterator to the next item (the supplied iterator gets invalid).


Generated on Thu Dec 5 17:27:58 2002 for LT Game Jam Session by doxygen1.2.17