ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
SG::ArenaNonConstPoolSTLAllocator< T > Class Template Reference

Forward declaration. More...

#include <ArenaPoolSTLAllocator.h>

Collaboration diagram for SG::ArenaNonConstPoolSTLAllocator< T >:

Public Member Functions

template<class U , class V >
 ArenaNonConstPoolSTLAllocator (const ArenaPoolSTLAllocator< U, V > &a, ArenaBlockAllocatorBase *poolptr_nc)
 Constructor. More...
 
void reset ()
 Free all allocated elements. More...
 
void erase ()
 Free all allocated elements and release memory back to the system. More...
 
void reserve (size_t size)
 Set the total number of elements cached by the allocator. More...
 
void protect ()
 Write-protect the memory managed by this allocator. More...
 
void unprotect ()
 Write-enable the memory managed by this allocator. More...
 

Private Attributes

ArenaBlockAllocatorBasem_poolptr_nc
 Non-const pointer to the underlying allocator. More...
 

Detailed Description

template<class T>
class SG::ArenaNonConstPoolSTLAllocator< T >

Forward declaration.

STL-style allocator wrapper for ArenaPoolAllocator.

Non-const variant for the case of the vetoed type.

See documentation above for details.

Definition at line 423 of file ArenaPoolSTLAllocator.h.

Constructor & Destructor Documentation

◆ ArenaNonConstPoolSTLAllocator()

template<class T >
template<class U , class V >
SG::ArenaNonConstPoolSTLAllocator< T >::ArenaNonConstPoolSTLAllocator ( const ArenaPoolSTLAllocator< U, V > &  a,
ArenaBlockAllocatorBase poolptr_nc 
)

Constructor.

Parameters
aAllocator to reference.
poolptr_ncNon-const pointer to the underlying allocator.

Member Function Documentation

◆ erase()

template<class T >
void SG::ArenaNonConstPoolSTLAllocator< T >::erase ( )

Free all allocated elements and release memory back to the system.

All elements allocated are freed, and all allocated blocks of memory are released back to the system. destructor should be called on them if it was provided (preceded by clear if provided and mustClear was set).

◆ protect()

template<class T >
void SG::ArenaNonConstPoolSTLAllocator< T >::protect ( )

Write-protect the memory managed by this allocator.

Adjust protection on the memory managed by this allocator to disallow writes.

◆ reserve()

template<class T >
void SG::ArenaNonConstPoolSTLAllocator< T >::reserve ( size_t  size)

Set the total number of elements cached by the allocator.

Parameters
sizeThe desired pool size.

This allows changing the number of elements that are currently free but cached. Any allocated elements are not affected by this call.

If size is greater than the total number of elements currently cached, then more will be allocated. This will preferably done with a single block, but that is not guaranteed; in addition, the allocator may allocate more elements than is requested.

If size is smaller than the total number of elements currently cached, as many blocks as possible will be released back to the system. It may not be possible to release the number of elements requested; this should be implemented on a best-effort basis.

◆ reset()

template<class T >
void SG::ArenaNonConstPoolSTLAllocator< T >::reset ( )

Free all allocated elements.

All elements allocated are returned to the free state. clear should be called on them if it was provided. The elements may continue to be cached internally, without returning to the system.

◆ unprotect()

template<class T >
void SG::ArenaNonConstPoolSTLAllocator< T >::unprotect ( )

Write-enable the memory managed by this allocator.

Adjust protection on the memory managed by this allocator to allow writes.

Member Data Documentation

◆ m_poolptr_nc

template<class T >
ArenaBlockAllocatorBase* SG::ArenaNonConstPoolSTLAllocator< T >::m_poolptr_nc
private

Non-const pointer to the underlying allocator.

Definition at line 617 of file ArenaPoolSTLAllocator.h.


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