lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Public Types | Public Member Functions | Static Public Attributes
lean::memory::object_pool< Element, ChunkSize, Heap, StaticChunkSize, Alignment > Class Template Reference

Object pool. More...

#include <object_pool.h>

Inherits noncopyable.

List of all members.

Public Types

typedef Element value_type
 Value type.
typedef Heap heap_type
 Heap type.
typedef heap_type::size_type size_type
 Size type.

Public Member Functions

LEAN_INLINE object_pool (size_type chunkSize=ChunkSize)
 Constructor.
LEAN_INLINE ~object_pool ()
 Destructor.
void clear ()
 Destructs all objects and frees all chunks allocated by this allocator.
LEAN_INLINE void * allocate () throw ()
 Places the given value into this object pool. Copy construction MAY NOT THROW.
LEAN_INLINE Element * place (const Element &value) throw ()
 Places the given value into this object pool. Copy construction MAY NOT THROW.

Static Public Attributes

static const size_type chunk_size = ChunkSize
 Chunk size.
static const size_type alignment = Alignment
 Alignment.

Detailed Description

template<class Element, size_t ChunkSize, class Heap = default_heap, size_t StaticChunkSize = ChunkSize, size_t Alignment = alignof(Element)>
class lean::memory::object_pool< Element, ChunkSize, Heap, StaticChunkSize, Alignment >

Object pool.


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