5#ifndef ATHALLOCATORS_DATAPOOL_H
6#define ATHALLOCATORS_DATAPOOL_H
40#include "boost/iterator/iterator_adaptor.hpp"
61template <
typename VALUE,
typename CLEAR = SG::DataPoolNullClear<VALUE> >
75 :
public boost::iterator_adaptor<
77 typename handle_t::iterator,
79 boost::forward_traversal_tag,
94 {
return &*this->base_reference(); }
98 :
public boost::iterator_adaptor<
100 typename handle_t::const_iterator,
102 boost::forward_traversal_tag,
120 {
return &*this->base_reference(); }
183 const_iterator
end()
const;
User interface for allocating memory that caches constructed objects. See Arena.h for an overview of ...
Pool-based allocator. See Arena.h for an overview of the arena-based memory allocators.
CONT::reference reference
const_iterator(const typename handle_t::const_iterator &it)
friend class boost::iterator_core_access
const_iterator::reference dereference() const
const_iterator(const iterator &it)
iterator::reference dereference() const
friend class boost::iterator_core_access
friend class const_iterator
iterator(const typename handle_t::iterator &it)
void reserve(unsigned int size)
Set the desired capacity.
static alloc_t::Params initParams()
DataPool(SG::Arena *arena, size_type n=0)
handle_t::pointer pointer
DataPool(const EventContext &ctx, size_type n=0)
DataPool(size_type n=0)
Constructors:
static const alloc_t::Params s_params
void erase()
free all memory in the pool.
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
static void callClear(SG::ArenaAllocatorBase::pointer p)
unsigned int capacity()
return capacity of pool OK
SG::ArenaCachingHandle< VALUE, alloc_t > handle_t
unsigned int allocated()
return size already allocated OK
void prepareToAdd(unsigned int size)
Prepare to add cached elements.
iterator end()
the end() method will allow looping over only valid elements and not over ALL elements of the pool
SG::ArenaPoolAllocator alloc_t
void reset()
release all elements in the pool.
const_iterator end() const
iterator begin()
begin iterators over pool
const_iterator begin() const
static const std::string & typeName()
typename of pool
static constexpr size_t s_minRefCount
char * pointer
Type for pointers to elements.
User interface for allocating memory that caches constructed objects.
Base::const_iterator const_iterator
Collection of memory allocators with a common lifetime,.
Null cleanup functional — does no actual cleanup.
static void clear(VALUE *)