Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::interprocess::cached_adaptive_pool< T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent > Singleton Reference

An STL node allocator that uses a segment manager as memory source. More...

#include <interprocess_fwd.hpp>

Inheritance diagram for boost::interprocess::cached_adaptive_pool< T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent >:
Collaboration diagram for boost::interprocess::cached_adaptive_pool< T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent >:

Classes

struct  rebind
 

Public Types

typedef
ipcdetail::cached_allocator_impl
< T,
ipcdetail::shared_adaptive_node_pool
< SegmentManager, sizeof_value
< T >::value, NodesPerBlock,
MaxFreeBlocks, OverheadPercent >, 2 > 
base_t
 
typedef
boost::interprocess::version_type
< cached_adaptive_pool, 2 > 
version
 

Public Member Functions

 cached_adaptive_pool (SegmentManager *segment_mngr, std::size_t max_cached_nodes=base_t::DEFAULT_MAX_CACHED_NODES)
 
template<class T2 >
 cached_adaptive_pool (const cached_adaptive_pool< T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent > &other)
 

Detailed Description

template<class T, class SegmentManager, std::size_t NodesPerBlock, std::size_t MaxFreeBlocks, unsigned char OverheadPercent>
singleton boost::interprocess::cached_adaptive_pool< T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent >

An STL node allocator that uses a segment manager as memory source.

The internal pointer type will of the same type (raw, smart) as "typename SegmentManager::void_pointer" type. This allows placing the allocator in shared memory, memory mapped-files, etc...

This node allocator shares a segregated storage between all instances of cached_adaptive_pool with equal sizeof(T) placed in the same memory segment. But also caches some nodes privately to avoid some synchronization overhead.

NodesPerBlock is the minimum number of nodes of nodes allocated at once when the allocator needs runs out of nodes. MaxFreeBlocks is the maximum number of totally free blocks that the adaptive node pool will hold. The rest of the totally free blocks will be deallocated with the segment manager.

OverheadPercent is the (approximated) maximum size overhead (1-20%) of the allocator: (memory usable for nodes / total memory allocated from the segment manager)

Member Typedef Documentation

template<class T, class SegmentManager, std::size_t NodesPerBlock, std::size_t MaxFreeBlocks, unsigned char OverheadPercent>
typedef ipcdetail::cached_allocator_impl< T , ipcdetail::shared_adaptive_node_pool < SegmentManager , sizeof_value<T>::value , NodesPerBlock , MaxFreeBlocks , OverheadPercent > , 2> boost::interprocess::cached_adaptive_pool< T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent >::base_t
template<class T, class SegmentManager, std::size_t NodesPerBlock, std::size_t MaxFreeBlocks, unsigned char OverheadPercent>
typedef boost::interprocess::version_type<cached_adaptive_pool, 2> boost::interprocess::cached_adaptive_pool< T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent >::version

Constructor & Destructor Documentation

template<class T, class SegmentManager, std::size_t NodesPerBlock, std::size_t MaxFreeBlocks, unsigned char OverheadPercent>
boost::interprocess::cached_adaptive_pool< T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent >::cached_adaptive_pool ( SegmentManager *  segment_mngr,
std::size_t  max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES 
)
inline
template<class T, class SegmentManager, std::size_t NodesPerBlock, std::size_t MaxFreeBlocks, unsigned char OverheadPercent>
template<class T2 >
boost::interprocess::cached_adaptive_pool< T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent >::cached_adaptive_pool ( const cached_adaptive_pool< T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent > &  other)
inline

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