Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
A pool of handles on a given class. More...
#include <bayeux/datatools/handle_pool.h>
Public Types | |
typedef T | element_type |
typedef datatools::handle< element_type > | handle_type |
Public Member Functions | |
handle_pool () | |
Construct an empty pool. More... | |
handle_pool (size_t size_) | |
Construct a pool with a default size. More... | |
virtual | ~handle_pool () |
Destructor. More... | |
void | clear () |
Empty the pool. More... | |
size_t | get_capacity () const |
Return the number of handles the pool can contain. More... | |
size_t | get_number_of_used_item () const |
Return the number of handles currently in use. More... | |
void | reset () |
Set the number of used handles in the pool to zero. More... | |
void | resize (size_t size_) |
Change number of handles pool can contain. More... | |
const handle_type & | create () |
Return a const reference to a new handle. More... | |
void | dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool abridged_=true) const |
Input pool capacity and used handles to an output stream. More... | |
void | resize_impl (size_t size_) |
Implementation for public resize method. More... | |
Protected Attributes | |
std::vector< handle_type > | _buffer_ |
size_t | _number_of_used_item_ |
A pool of handles on a given class.
typedef T datatools::handle_pool< T >::element_type |
typedef datatools::handle<element_type> datatools::handle_pool< T >::handle_type |
datatools::handle_pool< T >::handle_pool | ( | ) |
Construct an empty pool.
|
explicit |
Construct a pool with a default size.
|
virtual |
Destructor.
void datatools::handle_pool< T >::clear | ( | ) |
Empty the pool.
const handle_pool< T >::handle_type & datatools::handle_pool< T >::create | ( | ) |
Return a const reference to a new handle.
void datatools::handle_pool< T >::dump | ( | std::ostream & | out_ = std::clog , |
const std::string & | title_ = "" , |
||
const std::string & | indent_ = "" , |
||
bool | abridged_ = true |
||
) | const |
Input pool capacity and used handles to an output stream.
size_t datatools::handle_pool< T >::get_capacity | ( | ) | const |
Return the number of handles the pool can contain.
size_t datatools::handle_pool< T >::get_number_of_used_item | ( | ) | const |
Return the number of handles currently in use.
void datatools::handle_pool< T >::reset | ( | ) |
Set the number of used handles in the pool to zero.
void datatools::handle_pool< T >::resize | ( | size_t | size_ | ) |
Change number of handles pool can contain.
void datatools::handle_pool< T >::resize_impl | ( | size_t | size_ | ) |
Implementation for public resize method.
|
protected |
|
protected |