![]() |
ATLAS Offline Software
|
ArenaAllocatorRegistry implementation class. More...
Public Member Functions | |
| ~ArenaAllocatorRegistryImpl () | |
| Destructor. | |
| size_t | registerCreator (const std::string &name, std::unique_ptr< ArenaAllocatorCreator > creator) |
| Register a new allocator type. | |
| size_t | lookup (const std::string &name) |
| Look up the index for an allocator type name. | |
| std::unique_ptr< ArenaAllocatorBase > | create (size_t i) |
| Create a new instance of an allocator. | |
Private Types | |
| typedef std::map< std::string, size_t > | map_t |
| Map from names to indices. | |
| typedef std::lock_guard< std::mutex > | lock_t |
Private Attributes | |
| map_t | m_map |
| std::vector< std::unique_ptr< ArenaAllocatorCreator > > | m_creators |
| Vector of factory instances. | |
| std::mutex | m_mutex |
| Mutex to protect the contents. | |
ArenaAllocatorRegistry implementation class.
Definition at line 30 of file ArenaAllocatorRegistry.cxx.
|
private |
Definition at line 79 of file ArenaAllocatorRegistry.cxx.
|
private |
Map from names to indices.
Definition at line 70 of file ArenaAllocatorRegistry.cxx.
| SG::ArenaAllocatorRegistryImpl::~ArenaAllocatorRegistryImpl | ( | ) |
| std::unique_ptr< ArenaAllocatorBase > SG::ArenaAllocatorRegistryImpl::create | ( | size_t | i | ) |
Create a new instance of an allocator.
| i | The index of the allocator to create. |
Definition at line 150 of file ArenaAllocatorRegistry.cxx.
| size_t SG::ArenaAllocatorRegistryImpl::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 133 of file ArenaAllocatorRegistry.cxx.
| size_t SG::ArenaAllocatorRegistryImpl::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 102 of file ArenaAllocatorRegistry.cxx.
|
private |
Vector of factory instances.
Definition at line 74 of file ArenaAllocatorRegistry.cxx.
|
private |
Definition at line 71 of file ArenaAllocatorRegistry.cxx.
|
private |
Mutex to protect the contents.
Definition at line 77 of file ArenaAllocatorRegistry.cxx.