Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ATHALLOCATORS_DATAPOOL_H
6 #define ATHALLOCATORS_DATAPOOL_H
40 #include "boost/iterator/iterator_adaptor.hpp"
50 template <
class VALUE>
61 template <
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(); }
Base::iterator iterator
Iterators over elements.
const_iterator(const typename handle_t::const_iterator &it)
handle_t::pointer pointer
DataPool(size_type n=0)
Constructors:
static void clear(VALUE *)
friend class boost::iterator_core_access
void reserve(unsigned int size)
Set the desired capacity.
static constexpr size_t s_minRefCount
minimum number of elements in pool
const_iterator begin() const
void reset()
release all elements in the pool.
const_iterator(const iterator &it)
DataPool(SG::Arena *arena, size_type n=0)
const_iterator end() const
VALUE * pointer
Pointer to an element.
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
unsigned int capacity()
return capacity of pool OK
void prepareToAdd(unsigned int size)
Prepare to add cached elements.
static void callClear(SG::ArenaAllocatorBase::pointer p)
Collection of memory allocators with a common lifetime,.
iterator(const typename handle_t::iterator &it)
iterator::reference dereference() const
void erase()
free all memory in the pool.
const_iterator::reference dereference() const
iterator end()
the end() method will allow looping over only valid elements and not over ALL elements of the pool
SG::ArenaCachingHandle< VALUE, alloc_t > handle_t
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.
static const std::string & typeName()
typename of pool
SG::ArenaPoolAllocator alloc_t
DataPool(const EventContext &ctx, size_type n=0)
Base::const_iterator const_iterator
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
Null cleanup functional — does no actual cleanup.
friend class boost::iterator_core_access
iterator begin()
begin iterators over pool
char * pointer
Type for pointers to elements.
unsigned int allocated()
return size already allocated OK
static alloc_t::Params initParams()
static const alloc_t::Params s_params