Wolframe, 0.0.3

_Wolframe::ObjectPool< objectType > Class Template Reference

Class represening a pool of objects. More...

#include <objectPool.hpp>

Public Member Functions

 ObjectPool (const unsigned to)
 
 ObjectPool ()
 
 ~ObjectPool ()
 
std::size_t available () const
 
objectType get ()
 
void add (objectType obj)
 
unsigned timeout () const
 
void timeout (unsigned to)
 

Static Public Member Functions

static void static_add (ObjectPool *pool, objectType obj)
 

Private Attributes

std::vector< objectType > m_availList
 list (vector really) of available objects More...
 
boost::mutex m_mutex
 condition variable associated mutex More...
 
boost::condition_variable m_cond
 the condition variable More...
 
unsigned m_timeout
 acquire timeout More...
 

Detailed Description

template<typename objectType>
class _Wolframe::ObjectPool< objectType >

Class represening a pool of objects.

Template Parameters
objectTypetype of object stored in the pool

Constructor & Destructor Documentation

template<typename objectType >
_Wolframe::ObjectPool< objectType >::ObjectPool ( const unsigned  to)
inline
template<typename objectType >
_Wolframe::ObjectPool< objectType >::ObjectPool ( )
inline
template<typename objectType >
_Wolframe::ObjectPool< objectType >::~ObjectPool ( )
inline

Member Function Documentation

template<typename objectType >
void _Wolframe::ObjectPool< objectType >::add ( objectType  obj)
inline
template<typename objectType >
std::size_t _Wolframe::ObjectPool< objectType >::available ( ) const
inline
template<typename objectType >
objectType _Wolframe::ObjectPool< objectType >::get ( )
inline
template<typename objectType >
static void _Wolframe::ObjectPool< objectType >::static_add ( ObjectPool< objectType > *  pool,
objectType  obj 
)
inlinestatic
template<typename objectType >
unsigned _Wolframe::ObjectPool< objectType >::timeout ( ) const
inline
template<typename objectType >
void _Wolframe::ObjectPool< objectType >::timeout ( unsigned  to)
inline

Member Data Documentation

template<typename objectType >
std::vector< objectType > _Wolframe::ObjectPool< objectType >::m_availList
private

list (vector really) of available objects

template<typename objectType >
boost::condition_variable _Wolframe::ObjectPool< objectType >::m_cond
private

the condition variable

template<typename objectType >
boost::mutex _Wolframe::ObjectPool< objectType >::m_mutex
private

condition variable associated mutex

template<typename objectType >
unsigned _Wolframe::ObjectPool< objectType >::m_timeout
private

acquire timeout


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