ATLAS Offline Software
Loading...
Searching...
No Matches
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
16
17#ifndef ATLALLOCATORS_ARENAALLOCATORREGISTRY_H
18#define ATLALLOCATORS_ARENAALLOCATORREGISTRY_H
19
20
22#include <cstdlib>
23#include <string>
24#include <memory>
25
26
27namespace SG {
28
29
32
33
44{
45public:
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
83private:
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
Provide an interface for creating an arena Allocator. See Arena.h for an overview of the arena-based ...
Common base class for arena allocator classes.
ArenaAllocatorRegistry implementation class.
std::unique_ptr< ArenaAllocatorBase > create(size_t i)
Create a new instance of an allocator.
size_t registerCreator(const std::string &name, std::unique_ptr< ArenaAllocatorCreator > creator)
Register a new allocator type.
ArenaAllocatorRegistry()
Constructor. Called only by instance.
ArenaAllocatorRegistry & operator=(const ArenaAllocatorRegistry &)
ArenaAllocatorRegistry(const ArenaAllocatorRegistry &)
size_t lookup(const std::string &name)
Look up the index for an allocator type name.
~ArenaAllocatorRegistry()
Destructor. Called only by instance.
std::unique_ptr< ArenaAllocatorRegistryImpl > m_impl
The implementation object.
static ArenaAllocatorRegistry * instance()
Return a pointer to the global ArenaAllocatorRegistry instance.
Forward declaration.