libcopp  1.1.0
Public Types | Public Member Functions | Private Attributes
copp::allocator::stack_allocator_pool< TPool > Class Template Reference

memory allocator this allocator will maintain buffer using malloc/free function More...

#include <stack_allocator_pool.h>

Collaboration diagram for copp::allocator::stack_allocator_pool< TPool >:
Collaboration graph

Public Types

typedef TPool pool_t
 

Public Member Functions

 stack_allocator_pool () UTIL_CONFIG_NOEXCEPT
 
 stack_allocator_pool (const std::shared_ptr< pool_t > &p) UTIL_CONFIG_NOEXCEPT
 
 ~stack_allocator_pool ()
 
void attach (const std::shared_ptr< pool_t > &p) UTIL_CONFIG_NOEXCEPT
 
void allocate (stack_context &ctx, std::size_t size) UTIL_CONFIG_NOEXCEPT
 
void deallocate (stack_context &ctx) UTIL_CONFIG_NOEXCEPT
 

Private Attributes

std::shared_ptr< pool_tpool_
 

Detailed Description

template<typename TPool>
class copp::allocator::stack_allocator_pool< TPool >

memory allocator this allocator will maintain buffer using malloc/free function

Definition at line 26 of file stack_allocator_pool.h.

Member Typedef Documentation

template<typename TPool>
typedef TPool copp::allocator::stack_allocator_pool< TPool >::pool_t

Definition at line 28 of file stack_allocator_pool.h.

Constructor & Destructor Documentation

template<typename TPool>
copp::allocator::stack_allocator_pool< TPool >::stack_allocator_pool ( )
inline

Definition at line 31 of file stack_allocator_pool.h.

template<typename TPool>
copp::allocator::stack_allocator_pool< TPool >::stack_allocator_pool ( const std::shared_ptr< pool_t > &  p)
inline

Definition at line 32 of file stack_allocator_pool.h.

template<typename TPool>
copp::allocator::stack_allocator_pool< TPool >::~stack_allocator_pool ( )
inline

Definition at line 33 of file stack_allocator_pool.h.

Member Function Documentation

template<typename TPool>
void copp::allocator::stack_allocator_pool< TPool >::allocate ( stack_context ctx,
std::size_t  size 
)
inline

allocate memory and attach to stack context [standard function]

Parameters
ctxstack context
sizeignored
Note
size must less or equal than attached

Definition at line 49 of file stack_allocator_pool.h.

References copp::allocator::stack_allocator_pool< TPool >::pool_.

template<typename TPool>
void copp::allocator::stack_allocator_pool< TPool >::attach ( const std::shared_ptr< pool_t > &  p)
inline

specify memory section allocated

Parameters
start_ptrbuffer start address
max_sizebuffer size
Note
must be called before allocate operation

Definition at line 41 of file stack_allocator_pool.h.

References copp::allocator::stack_allocator_pool< TPool >::pool_.

template<typename TPool>
void copp::allocator::stack_allocator_pool< TPool >::deallocate ( stack_context ctx)
inline

deallocate memory from stack context [standard function]

Parameters
ctxstack context

Definition at line 60 of file stack_allocator_pool.h.

References copp::allocator::stack_allocator_pool< TPool >::pool_.

Field Documentation

template<typename TPool>
std::shared_ptr<pool_t> copp::allocator::stack_allocator_pool< TPool >::pool_
private

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