libcopp  1.2.0
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
copp::stack_pool< TAlloc > Class Template Reference

#include <stack_pool.h>

Collaboration diagram for copp::stack_pool< TAlloc >:
Collaboration graph

Data Structures

struct  configure_t
 
struct  constructor_delegator
 
struct  limit_t
 

Public Types

typedef TAlloc allocator_t
 
typedef std::shared_ptr< stack_pool< TAlloc > > ptr_t
 

Public Member Functions

 stack_pool (constructor_delegator)
 
 ~stack_pool ()
 
const limit_tget_limit () const
 
allocator_tget_origin_allocator () COPP_MACRO_NOEXCEPT
 
const allocator_tget_origin_allocator () const COPP_MACRO_NOEXCEPT
 
size_t set_stack_size (size_t sz)
 
size_t get_stack_size () const
 
size_t get_stack_size_offset () const
 
void set_max_stack_size (size_t sz) COPP_MACRO_NOEXCEPT
 
size_t get_max_stack_size () const COPP_MACRO_NOEXCEPT
 
void set_max_stack_number (size_t sz) COPP_MACRO_NOEXCEPT
 
size_t get_max_stack_number () const COPP_MACRO_NOEXCEPT
 
void set_min_stack_size (size_t sz) COPP_MACRO_NOEXCEPT
 
size_t get_min_stack_size () const COPP_MACRO_NOEXCEPT
 
void set_min_stack_number (size_t sz) COPP_MACRO_NOEXCEPT
 
size_t get_min_stack_number () const COPP_MACRO_NOEXCEPT
 
void set_auto_gc (bool v) COPP_MACRO_NOEXCEPT
 
bool is_auto_gc () const COPP_MACRO_NOEXCEPT
 
void set_gc_once_number (size_t v) COPP_MACRO_NOEXCEPT
 
size_t get_gc_once_number () const COPP_MACRO_NOEXCEPT
 
void allocate (stack_context &ctx) UTIL_CONFIG_NOEXCEPT
 
void deallocate (stack_context &ctx) UTIL_CONFIG_NOEXCEPT
 
size_t gc ()
 
void clear ()
 

Static Public Member Functions

static ptr_t create ()
 

Private Member Functions

 stack_pool () UTIL_CONFIG_DELETED_FUNCTION
 
 stack_pool (const stack_pool &) UTIL_CONFIG_DELETED_FUNCTION
 

Private Attributes

limit_t limits_
 
configure_t conf_
 
allocator_t alloc_
 
util::lock::spin_lock action_lock_
 
std::list< stack_contextfree_list_
 

Detailed Description

template<typename TAlloc>
class copp::stack_pool< TAlloc >

Definition at line 22 of file stack_pool.h.

Member Typedef Documentation

template<typename TAlloc >
typedef TAlloc copp::stack_pool< TAlloc >::allocator_t

Definition at line 24 of file stack_pool.h.

template<typename TAlloc >
typedef std::shared_ptr<stack_pool<TAlloc> > copp::stack_pool< TAlloc >::ptr_t

Definition at line 25 of file stack_pool.h.

Constructor & Destructor Documentation

template<typename TAlloc >
copp::stack_pool< TAlloc >::stack_pool ( )
private
template<typename TAlloc >
copp::stack_pool< TAlloc >::stack_pool ( const stack_pool< TAlloc > &  )
private
template<typename TAlloc >
copp::stack_pool< TAlloc >::stack_pool ( constructor_delegator  )
inline
template<typename TAlloc >
copp::stack_pool< TAlloc >::~stack_pool ( )
inline

Definition at line 60 of file stack_pool.h.

References copp::stack_pool< TAlloc >::clear().

Member Function Documentation

template<typename TAlloc >
void copp::stack_pool< TAlloc >::allocate ( stack_context ctx)
inline
template<typename TAlloc >
void copp::stack_pool< TAlloc >::clear ( )
inline
template<typename TAlloc >
static ptr_t copp::stack_pool< TAlloc >::create ( )
inlinestatic

Definition at line 52 of file stack_pool.h.

Referenced by CASE_TEST(), and main().

template<typename TAlloc >
void copp::stack_pool< TAlloc >::deallocate ( stack_context ctx)
inline
template<typename TAlloc >
size_t copp::stack_pool< TAlloc >::gc ( )
inline
template<typename TAlloc >
size_t copp::stack_pool< TAlloc >::get_gc_once_number ( ) const
inline
template<typename TAlloc >
const limit_t& copp::stack_pool< TAlloc >::get_limit ( ) const
inline

Definition at line 62 of file stack_pool.h.

References copp::stack_pool< TAlloc >::limits_.

template<typename TAlloc >
size_t copp::stack_pool< TAlloc >::get_max_stack_number ( ) const
inline
template<typename TAlloc >
size_t copp::stack_pool< TAlloc >::get_max_stack_size ( ) const
inline
template<typename TAlloc >
size_t copp::stack_pool< TAlloc >::get_min_stack_number ( ) const
inline
template<typename TAlloc >
size_t copp::stack_pool< TAlloc >::get_min_stack_size ( ) const
inline
template<typename TAlloc >
allocator_t& copp::stack_pool< TAlloc >::get_origin_allocator ( )
inline

Definition at line 65 of file stack_pool.h.

References copp::stack_pool< TAlloc >::alloc_.

template<typename TAlloc >
const allocator_t& copp::stack_pool< TAlloc >::get_origin_allocator ( ) const
inline

Definition at line 66 of file stack_pool.h.

References copp::stack_pool< TAlloc >::alloc_.

template<typename TAlloc >
size_t copp::stack_pool< TAlloc >::get_stack_size ( ) const
inline
template<typename TAlloc >
size_t copp::stack_pool< TAlloc >::get_stack_size_offset ( ) const
inline
template<typename TAlloc >
bool copp::stack_pool< TAlloc >::is_auto_gc ( ) const
inline
template<typename TAlloc >
void copp::stack_pool< TAlloc >::set_auto_gc ( bool  v)
inline
template<typename TAlloc >
void copp::stack_pool< TAlloc >::set_gc_once_number ( size_t  v)
inline
template<typename TAlloc >
void copp::stack_pool< TAlloc >::set_max_stack_number ( size_t  sz)
inline
template<typename TAlloc >
void copp::stack_pool< TAlloc >::set_max_stack_size ( size_t  sz)
inline
template<typename TAlloc >
void copp::stack_pool< TAlloc >::set_min_stack_number ( size_t  sz)
inline
template<typename TAlloc >
void copp::stack_pool< TAlloc >::set_min_stack_size ( size_t  sz)
inline
template<typename TAlloc >
size_t copp::stack_pool< TAlloc >::set_stack_size ( size_t  sz)
inline

Field Documentation

template<typename TAlloc >
util::lock::spin_lock copp::stack_pool< TAlloc >::action_lock_
private
template<typename TAlloc >
allocator_t copp::stack_pool< TAlloc >::alloc_
private
template<typename TAlloc >
configure_t copp::stack_pool< TAlloc >::conf_
private
template<typename TAlloc >
std::list<stack_context> copp::stack_pool< TAlloc >::free_list_
private
template<typename TAlloc >
limit_t copp::stack_pool< TAlloc >::limits_
private

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