IT_Bus::SimplePool< T, TFactory > Class Template Reference

#include <it_bus_pdk/simple_pool.h>

List of all members.


Detailed Description

template<class T, class TFactory>
class IT_Bus::SimplePool< T, TFactory >

Utility template class for pooling objects.

Definition at line 16 of file simple_pool.h.

Public Member Functions

 SimplePool (TFactory &factory)
 Constructor.
virtual ~SimplePool ()
 Destructor.
T * get_pool_entry () throw ((Exception))
 Method used to get an entry from the pool.
void return_pool_entry (T *) throw ((Exception))
 Method used to return an object back to the pool.

Private Attributes

TFactory * m_factory
IT_Vector< T * > m_pool


Member Function Documentation

template<class T, class TFactory>
T* IT_Bus::SimplePool< T, TFactory >::get_pool_entry (  )  throw ((Exception))

Method used to get an entry from the pool.

This will call TCreate::new_instance if there are no free entries in the pool. This will throw Exception if TFactory::new_instance creates a null object

Returns:
A pointer to a pooled object

template<class T, class TFactory>
void IT_Bus::SimplePool< T, TFactory >::return_pool_entry ( T *   )  throw ((Exception))

Method used to return an object back to the pool.

It will throw an exception if that object was not obtained from the pool.

Parameters:
A pointer to the object to be repooled


Generated on Tue Mar 20 15:28:14 2007 for Artix by  doxygen 1.5.1-p1