ATLAS Offline Software
|
Registry of allocator factories. More...
#include <ArenaAllocatorRegistry.h>
Public Member Functions | |
size_t | registerCreator (const std::string &name, std::unique_ptr< ArenaAllocatorCreator > creator) |
Register a new allocator type. More... | |
size_t | lookup (const std::string &name) |
Look up the index for an allocator type name. More... | |
std::unique_ptr< ArenaAllocatorBase > | create (size_t i) |
Create a new instance of an allocator. More... | |
Static Public Member Functions | |
static ArenaAllocatorRegistry * | instance () |
Return a pointer to the global ArenaAllocatorRegistry instance. More... | |
Private Member Functions | |
ArenaAllocatorRegistry (const ArenaAllocatorRegistry &) | |
ArenaAllocatorRegistry & | operator= (const ArenaAllocatorRegistry &) |
ArenaAllocatorRegistry () | |
Constructor. Called only by instance . More... | |
~ArenaAllocatorRegistry () | |
Destructor. Called only by instance . More... | |
Private Attributes | |
std::unique_ptr< ArenaAllocatorRegistryImpl > | m_impl |
The implementation object. More... | |
Friends | |
class | ArenaAllocatorRegistryImpl |
Registry of allocator factories.
See Arena.h for an overview of the arena-based memory allocators.
Each Allocator type that the application uses is registered here; we assign to each one a small integer index. We can then create an instance of the Allocator given the index. Allocators have names; we also handle finding the index for an Allocator given the name.
Definition at line 43 of file ArenaAllocatorRegistry.h.
|
private |
|
private |
Constructor. Called only by instance
.
Constructor.
Definition at line 214 of file ArenaAllocatorRegistry.cxx.
|
private |
Destructor. Called only by instance
.
Destructor.
Definition at line 223 of file ArenaAllocatorRegistry.cxx.
std::unique_ptr< ArenaAllocatorBase > SG::ArenaAllocatorRegistry::create | ( | size_t | i | ) |
Create a new instance of an allocator.
i | The index of the allocator to create. |
Definition at line 195 of file ArenaAllocatorRegistry.cxx.
|
static |
Return a pointer to the global ArenaAllocatorRegistry
instance.
Definition at line 204 of file ArenaAllocatorRegistry.cxx.
size_t SG::ArenaAllocatorRegistry::lookup | ( | const std::string & | name | ) |
Look up the index for an allocator type name.
name | The name of the allocator type to find. |
std::string::npos
if it hasn't yet been registered. Definition at line 184 of file ArenaAllocatorRegistry.cxx.
|
private |
size_t SG::ArenaAllocatorRegistry::registerCreator | ( | const std::string & | name, |
std::unique_ptr< ArenaAllocatorCreator > | creator | ||
) |
Register a new allocator type.
name | The name of the allocator type. |
creator | The factory object to create instances of this type. The registry takes ownership of this pointer. |
If the allocator type already exists, then the index of the existing one is returned (and the object passed as creator
is deleted).
Definition at line 171 of file ArenaAllocatorRegistry.cxx.
|
friend |
Definition at line 98 of file ArenaAllocatorRegistry.h.
|
private |
The implementation object.
Definition at line 85 of file ArenaAllocatorRegistry.h.