ATLAS Offline Software
ArenaAllocatorRegistry.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: ArenaAllocatorRegistry.h 470529 2011-11-24 23:54:22Z ssnyder $
8 
17 #ifndef ATLALLOCATORS_ARENAALLOCATORREGISTRY_H
18 #define ATLALLOCATORS_ARENAALLOCATORREGISTRY_H
19 
20 
22 #include <cstdlib>
23 #include <string>
24 #include <memory>
25 
26 
27 namespace SG {
28 
29 
30 class ArenaAllocatorBase;
31 class ArenaAllocatorRegistryImpl;
32 
33 
44 {
45 public:
56  size_t registerCreator (const std::string& name,
57  std::unique_ptr<ArenaAllocatorCreator> creator);
58 
59 
66  size_t lookup (const std::string& name);
67 
68 
74  std::unique_ptr<ArenaAllocatorBase> create (size_t i);
75 
76 
81 
82 
83 private:
85  std::unique_ptr<ArenaAllocatorRegistryImpl> m_impl;
86 
87  // Disallow copying.
90 
93 
96 
97  // Just to avoid compiler warnings.
99 };
100 
101 
102 } // namespace SG
103 
104 
105 #endif // not ATLALLOCATORS_ARENAALLOCATORREGISTRY_H
SG::ArenaAllocatorRegistry::instance
static ArenaAllocatorRegistry * instance()
Return a pointer to the global ArenaAllocatorRegistry instance.
Definition: ArenaAllocatorRegistry.cxx:204
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::ArenaAllocatorRegistryImpl
ArenaAllocatorRegistry implementation class.
Definition: ArenaAllocatorRegistry.cxx:31
SG::ArenaAllocatorRegistry::ArenaAllocatorRegistry
ArenaAllocatorRegistry(const ArenaAllocatorRegistry &)
SG::ArenaAllocatorRegistry::m_impl
std::unique_ptr< ArenaAllocatorRegistryImpl > m_impl
The implementation object.
Definition: ArenaAllocatorRegistry.h:85
ArenaAllocatorCreator.h
Provide an interface for creating an arena Allocator. See Arena.h for an overview of the arena-based ...
SG::ArenaAllocatorRegistry::ArenaAllocatorRegistry
ArenaAllocatorRegistry()
Constructor. Called only by instance.
Definition: ArenaAllocatorRegistry.cxx:214
SG::ArenaAllocatorRegistry::operator=
ArenaAllocatorRegistry & operator=(const ArenaAllocatorRegistry &)
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::ArenaAllocatorRegistry
Registry of allocator factories.
Definition: ArenaAllocatorRegistry.h:44
SG::ArenaAllocatorRegistry::create
std::unique_ptr< ArenaAllocatorBase > create(size_t i)
Create a new instance of an allocator.
Definition: ArenaAllocatorRegistry.cxx:195
SG::ArenaAllocatorRegistry::lookup
size_t lookup(const std::string &name)
Look up the index for an allocator type name.
Definition: ArenaAllocatorRegistry.cxx:184
SG::ArenaAllocatorRegistry::~ArenaAllocatorRegistry
~ArenaAllocatorRegistry()
Destructor. Called only by instance.
Definition: ArenaAllocatorRegistry.cxx:223
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::ArenaAllocatorRegistry::registerCreator
size_t registerCreator(const std::string &name, std::unique_ptr< ArenaAllocatorCreator > creator)
Register a new allocator type.
Definition: ArenaAllocatorRegistry.cxx:171