13#ifndef ATHALLOCATORS_ARENAPOOLALLOCATOR_H
14#define ATHALLOCATORS_ARENAPOOLALLOCATOR_H
18#include "boost/iterator/iterator_adaptor.hpp"
54 :
public boost::iterator_adaptor<
58 boost::forward_traversal_tag>
100 :
public boost::iterator_adaptor<
104 boost::forward_traversal_tag>
193 virtual void reset()
override;
204 virtual void erase() override final;
272#include "AthAllocators/ArenaPoolAllocator.icc"
Common functionality for block-oriented allocators.
char * pointer
Type for pointers to elements.
const Params & params() const
Return this Allocator's parameters.
ArenaBlockAllocatorBase(const Params ¶ms)
Constructor.
A large memory block that gets carved into smaller uniform elements.
Const iterator for the pool.
const_iterator(const iterator &it)
Constructor from iterator.
const_iterator(pointer p, const ArenaBlock *block)
Constructor.
const_iterator()
Default constructor.
friend class boost::iterator_core_access
const ArenaBlock * m_block
Block containing the current element.
void increment()
Move the iterator forward.
Non-const iterator for the pool.
iterator(pointer p, ArenaBlock *block)
Constructor.
void increment()
Move the iterator forward.
ArenaBlock * m_block
Block containing the current element.
friend class boost::iterator_core_access
friend class const_iterator
iterator()
Default constructor.
pointer allocate()
Allocate a new element.
pointer m_end
One past the last available element in the current block, of null.
iterator begin()
Starting pool iterator.
virtual void reset() override
Free all allocated elements.
void resetTo(pointer p)
Reset pool back to a previous state.
void refill()
Add more free elements to the pool.
void clearBlock()
Reset all elements in the topmost block, and move the block to the free list.
virtual ~ArenaPoolAllocator()
Destructor.
ArenaPoolAllocator & operator=(const ArenaPoolAllocator &)=delete
pointer m_ptr
Pointer to the next free element to allocate, or null.
ArenaPoolAllocator(const Params ¶ms)
Constructor.
void swap(ArenaPoolAllocator &other)
Swap.
virtual void erase() override final
Free all allocated elements and release memory back to the system.
iterator end()
Ending pool iterator.
ArenaPoolAllocator(const ArenaPoolAllocator &)=delete
Don't allow copy construction or assignment.