ATLAS Offline Software
Loading...
Searching...
No Matches
ArenaCachingHandle.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: ArenaCachingHandle.h 470529 2011-11-24 23:54:22Z ssnyder $
8
16
17
18#ifndef ATLALLOCATORS_ARENACACHINGHANDLE_H
19#define ATLALLOCATORS_ARENACACHINGHANDLE_H
20
21
23#include "AthAllocators/Arena.h"
24
25
26namespace SG {
27
28
75template <class T, class ALLOC>
77 : public ArenaHandleBaseT<T, ALLOC>
78{
79public:
82
84 typedef T* pointer;
85
88 typedef typename Base::iterator iterator;
90
91
99
100
102 typedef typename ALLOC::template initParams<T, false> defaultParams_t;
103
104
110 ArenaCachingHandle (const typename ALLOC::Params* params = nullptr);
111
112
113
122 const typename ALLOC::Params* params = nullptr);
123
124
134 const EventContext& ctx,
135 const typename ALLOC::Params* params = nullptr);
136
137
144 ArenaCachingHandle (Arena* arena, const typename ALLOC::Params* params = nullptr);
145
146
153
154
159 static
160 std::unique_ptr<ArenaAllocatorBase>
161 makeAllocator (const typename ALLOC::Params& params);
162
163
164 // The following methods are inherited:
165 // const ALLOC::Params& params() const;
166 // void reset();
167 // void erase();
168 // void reserve(size_t);
169 // const ArenaAllocatorBase::Stats& stats() const;
170 //
171 // The following inherited functions may be instantiated only
172 // if the Allocator supports them:
173 // iterator begin();
174 // const_iterator begin() const;
175 // iterator end();
176 // const_iterator end() const;
177 // void free (pointer p) const;
178 // void resetTo (pointer p) const;
179};
180
181
182} // namespace SG
183
184
185
187
188
189
190#endif // not ATLALLOCATORS_ARENACACHINGHANDLE_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.
pointer allocate()
Allocate a new element.
Base::iterator iterator
Iterators over elements.
ArenaCachingHandle(ArenaHeader *header, size_t index)
Constructor, passing in an index.
ArenaCachingHandle(ArenaHeader *header, const typename ALLOC::Params *params=nullptr)
Constructor, passing in a Header and an optional parameter set.
ArenaHandleBaseT< T, ALLOC > Base
Shorthand for our base class.
ArenaCachingHandle(Arena *arena, const typename ALLOC::Params *params=nullptr)
Constructor, passing in an Arena and an optional parameter set.
ArenaCachingHandle(ArenaHeader *header, const EventContext &ctx, const typename ALLOC::Params *params=nullptr)
Constructor, passing in a Header, context, and an optional parameter set.
ALLOC::template initParams< T, false > defaultParams_t
The class that initializes the default parameter set.
Base::const_iterator const_iterator
static std::unique_ptr< ArenaAllocatorBase > makeAllocator(const typename ALLOC::Params &params)
Internal helper: create a new Allocator instance.
T * pointer
Pointer to an element.
ArenaCachingHandle(const typename ALLOC::Params *params=nullptr)
Constructor, passing in an optional parameter set.
const alloc_t::Params & params() const
ArenaHandleBaseT(ArenaHeader *header, size_t index)
Constructor, passing in an index.
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