ATLAS Offline Software
Loading...
Searching...
No Matches
ArenaHandle.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: ArenaHandle.h 470529 2011-11-24 23:54:22Z ssnyder $
8
16
17
18#ifndef ATLALLOCATORS_ARENAHANDLE_H
19#define ATLALLOCATORS_ARENAHANDLE_H
20
21
23#include "AthAllocators/Arena.h"
24
25
26namespace SG {
27
28
70template <class T, class ALLOC>
72 : public ArenaHandleBaseT<T, ALLOC>
73{
74public:
77
79 typedef typename Base::pointer pointer;
80
83 typedef typename Base::iterator iterator;
85
86
94
95
97 typedef typename ALLOC::template initParams<T, false, true> defaultParams_t;
98
99
105 ArenaHandle (const typename ALLOC::Params* params = nullptr);
106
107
116 const typename ALLOC::Params* params = nullptr);
117
118
128 const EventContext& ctx,
129 const typename ALLOC::Params* params = nullptr);
130
131
138 ArenaHandle (Arena* arena, const typename ALLOC::Params* params = nullptr);
139
140
147 void* allocate();
148
149
154 static
155 std::unique_ptr<ArenaAllocatorBase>
156 makeAllocator (const typename ALLOC::Params& params);
157
158
159 // The following methods are inherited:
160 // const ALLOC::Params& params() const;
161 // void reset();
162 // void erase();
163 // void reserve(size_t);
164 // const ArenaAllocatorBase::Stats& stats() const;
165 //
166 // The following inherited functions may be instantiated only
167 // if the Allocator supports them:
168 // iterator begin();
169 // const_iterator begin() const;
170 // iterator end();
171 // const_iterator end() const;
172 // void free (pointer p) const;
173 // void resetTo (pointer p) const;
174};
175
176
177} // namespace SG
178
179
181
182
183#endif // not ATLALLOCATORS_ARENAHANDLE_H
Base class for Handle classes, containing parts that are independent of how the Allocator gets create...
Collection of memory allocators with a common lifetime, plus subsystem summary.
const ALLOC::Params & params() const
Return our Allocator's parameters.
T * pointer
A pointer to the element type we're allocating.
ArenaHandleBaseT(ArenaHeader *header, size_t index)
Constructor, passing in an index.
Base::const_iterator const_iterator
Definition ArenaHandle.h:84
void * allocate()
Allocate a new element.
ArenaHandle(ArenaHeader *header, const typename ALLOC::Params *params=nullptr)
Constructor, passing in a Header and an optional parameter set.
ArenaHandle(ArenaHeader *header, size_t index)
Constructor, passing in an index.
ArenaHandle(ArenaHeader *header, const EventContext &ctx, const typename ALLOC::Params *params=nullptr)
Constructor, passing in a Header, context, and an optional parameter set.
ArenaHandle(Arena *arena, const typename ALLOC::Params *params=nullptr)
Constructor, passing in an Arena and an optional parameter set.
ArenaHandleBaseT< T, ALLOC > Base
Shorthand for our base class.
Definition ArenaHandle.h:76
Base::iterator iterator
Iterators over elements.
Definition ArenaHandle.h:83
ALLOC::template initParams< T, false, true > defaultParams_t
The class that initializes the default parameter set.
Definition ArenaHandle.h:97
static std::unique_ptr< ArenaAllocatorBase > makeAllocator(const typename ALLOC::Params &params)
Internal helper: create a new Allocator instance.
ArenaHandle(const typename ALLOC::Params *params=nullptr)
Constructor, passing in an optional parameter set.
Base::pointer pointer
Pointer to an element.
Definition ArenaHandle.h:79
Proxy for a group of Arenas.
Definition ArenaHeader.h:54
Collection of memory allocators with a common lifetime,.
Definition Arena.h:238
Forward declaration.
Definition index.py:1