ATLAS Offline Software
Loading...
Searching...
No Matches
ArenaHandleBaseAllocT.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-2019 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: ArenaHandleBaseAllocT.h 470529 2011-11-24 23:54:22Z ssnyder $
8
17
18
19#ifndef ATLALLOCATORS_ARENAHANDLEBASEALLOCT_H
20#define ATLALLOCATORS_ARENAHANDLEBASEALLOCT_H
21
22
26#include "GaudiKernel/System.h"
27#include <string>
28
29
30namespace SG {
31
32
51template <typename ALLOC>
53 : public ArenaHandleBase
54{
55public:
57 typedef ALLOC alloc_t;
58
59
67
68
77 const EventContext& ctx,
78 size_t index);
79
80
87
88
92 const typename ALLOC::Params& params() const;
93
94
95protected:
99 ALLOC* allocator();
100
101
105 const ALLOC* allocator() const;
106
107
117 template <class HANDLE, class DEFPARAMS>
118 static
119 size_t makeIndex (const typename ALLOC::Params* params);
120
121private:
133 : public ArenaAllocatorCreator
134 {
135 public:
138 typedef
139 std::unique_ptr<ArenaAllocatorBase> makeFunc_t (const typename ALLOC::Params&);
140
141
151 Creator (const std::string& name,
152 makeFunc_t* makeFunc,
153 const typename ALLOC::Params& params);
154
155
159 virtual std::unique_ptr<ArenaAllocatorBase> create();
160
161
165 const std::string& name() const;
166
167
168 protected:
171
173 typename ALLOC::Params m_params;
174 };
175};
176
177
178} // namespace SG
179
180
182
183
184#endif // not ATLALLOCATORS_ARENAHANDLEBASEALLOCT_H
Provide an interface for creating an arena Allocator. See Arena.h for an overview of the arena-based ...
Registry of allocator factories. See Arena.h for an overview of the arena-based memory allocators.
Base class for all Handle classes, containing parts that do not depend on the referenced type....
Provide an interface for creating an arena Allocator.
Part of Arena dealing with the list of allocators.
Definition ArenaBase.h:42
Creator(const std::string &name, makeFunc_t *makeFunc, const typename ALLOC::Params &params)
Constructor.
ALLOC::Params m_params
Set of parameters to use to create our allocator.
makeFunc_t * m_makeFunc
Function that creates an Allocator given a set of parameters.
const std::string & name() const
Return the name of the Allocator we create.
std::unique_ptr< ArenaAllocatorBase > makeFunc_t(const typename ALLOC::Params &)
Type for m_makeFunc — a function returning a new Allocator from a parameters structure.
virtual std::unique_ptr< ArenaAllocatorBase > create()
Create an allocator instance.
ALLOC * allocator()
Return our current Allocator.
ArenaHandleBaseAllocT(ArenaHeader *header, const EventContext &ctx, size_t index)
Constructor, passing in an index, for a specific event slot.
const ALLOC::Params & params() const
Return our Allocator's parameters.
ArenaHandleBaseAllocT(ArenaHeader *header, size_t index)
Constructor, passing in an index.
ArenaHandleBaseAllocT(ArenaBase *arena, size_t index)
Constructor, passing in an index, for a specific Arena.
ALLOC alloc_t
The Allocator we use.
const ALLOC * allocator() const
Return our current Allocator.
static size_t makeIndex(const typename ALLOC::Params *params)
Find the index for creating an allocator.
ArenaHandleBase(ArenaHeader *header, size_t index)
Constructor.
Proxy for a group of Arenas.
Definition ArenaHeader.h:54
Forward declaration.
Definition index.py:1