Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Store< T > Class Template Reference

#include <store.hpp>

List of all members.


Detailed Description

template<typename T>
class Store< T >

A simple template data structure that encapsulates the process of memory management so that deleted objects are returned to a "store" for later "reallocation".

This avoids the overhead of memory allocation for objects that are frequently created and destroyed. The objects managed by this store must have default (zero parameter) constructors.

Definition at line 15 of file store.hpp.

Public Member Functions

 Store ()
 Constructor.

 ~Store ()
 Destructor.

T * newItem ()
 Retrieves a fresh item from the store.

void deleteItem (T *item)
 Returns a used item to the store.


Protected Attributes

std::stack< T * > items
 A stack of the items in the store.


Constructor & Destructor Documentation

template<typename T>
Store< T >::Store  )  [inline]
 

Constructor.

Definition at line 29 of file store.hpp.

template<typename T>
Store< T >::~Store  ) 
 

Destructor.

Definition at line 49 of file store.hpp.


Member Function Documentation

template<typename T>
void Store< T >::deleteItem T *  item  ) 
 

Returns a used item to the store.

Definition at line 68 of file store.hpp.

template<typename T>
T * Store< T >::newItem  ) 
 

Retrieves a fresh item from the store.

Definition at line 57 of file store.hpp.


Member Data Documentation

template<typename T>
std::stack<T*> Store< T >::items [protected]
 

A stack of the items in the store.

Definition at line 22 of file store.hpp.


The documentation for this class was generated from the following file:
Generated on Wed May 25 14:40:14 2005 for Arak by doxygen 1.3.6