|
|
|
Home / Open source / Terimber 2.0
pool< C > Class Template Referencecreator - responsable for creation and deleting objects
More...
#include <template.h>
List of all members.
Detailed Description
template<class C>
class pool< C >
creator - responsable for creation and deleting objects
class implementating the template pool of objects
Definition at line 40 of file template.h.
Member Typedef Documentation
responsible for creation and deletion of objects
Definition at line 46 of file template.h.
argument for creator
Definition at line 52 of file template.h.
Constructor & Destructor Documentation
template<class C>
BEGIN_TERIMBER_NAMESPACE pool< C >::pool |
( |
C & |
creator = C::static_constructor() , |
|
|
size_t |
pool_size = os_def_size | |
|
) |
| | [inline] |
constructor
- Parameters:
-
creator |
creator |
pool_size |
max pool capacity |
Definition at line 40 of file template.hpp.
Member Function Documentation
template<class C>
TYPENAME pool< C >::TYPE * pool< C >::loan_object |
( |
const ARG & |
arg = C::get_default_arg() , |
|
|
size_t |
timeout = C::get_default_timeout() | |
|
) |
| | [inline] |
returns object if it's in a pool within specified timeout
- Parameters:
-
arg |
argument for creator |
timeout |
timeout in milliseconds |
Definition at line 55 of file template.hpp.
References pool< C >::_busy_objects, pool< C >::_creator, pool< C >::_free_objects, pool< C >::_locker, pool< C >::_mtx, pool< C >::pool_entry::_obj, base_list< T >::empty(), keylocker::enter(), base_list< T >::front(), keylocker::leave(), list< T >::pop_front(), list< T >::push_back(), and mutex_keeper::unlock().
Referenced by threadpool::borrow_from_range(), threadpool::borrow_thread(), byte_consumer::byte_consumer(), byte_source::byte_source(), msg_communicator::construct_msg(), dbserver_impl::dbserver_impl(), xml_designer_impl::xml_designer_impl(), xml_persistor::xml_persistor(), and xml_processor::xml_processor().
template<class C>
void pool< C >::return_object |
( |
TYPE * |
obj, |
|
|
const ARG & |
arg = C::get_default_arg() | |
|
) |
| | [inline] |
returns object back to pool
- Parameters:
-
obj |
pointer to object |
arg |
argument for creator |
Definition at line 106 of file template.hpp.
References pool< C >::_busy_objects, pool< C >::_creator, pool< C >::_free_objects, pool< C >::_locker, pool< C >::_mtx, base_list< T >::begin(), base_list< T >::end(), list< T >::erase(), keylocker::leave(), list< T >::push_front(), TYPENAME, and mutex_keeper::unlock().
Referenced by msg_communicator::construct_msg(), msg_communicator::destroy_msg(), threadpool::off(), threadpool::v_do_job(), byte_consumer::~byte_consumer(), byte_manager::~byte_manager(), byte_source::~byte_source(), dbserver_impl::~dbserver_impl(), xml_designer_impl::~xml_designer_impl(), xml_grammar::~xml_grammar(), xml_persistor::~xml_persistor(), and xml_processor::~xml_processor().
template<class C>
void pool< C >::clear |
( |
const ARG & |
arg = C::get_default_arg() |
) |
[inline] |
template<class C>
void pool< C >::deactivate |
( |
size_t |
maxrest, |
|
|
const ARG & |
arg = C::get_default_arg() | |
|
) |
| | [inline] |
template<class C>
void pool< C >::purge |
( |
size_t |
maxrest, |
|
|
const ARG & |
arg = C::get_default_arg() | |
|
) |
| | [inline] |
template<class C>
void pool< C >::get_stats |
( |
size_t & |
free_objects, |
|
|
size_t & |
busy_objects | |
|
) |
| | const [inline] |
Member Data Documentation
The documentation for this class was generated from the following files:
|
|
|
|