ATLAS Offline Software
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 
18 #ifndef ATLALLOCATORS_ARENACACHINGHANDLE_H
19 #define ATLALLOCATORS_ARENACACHINGHANDLE_H
20 
21 
23 #include "AthAllocators/Arena.h"
24 
25 
26 namespace SG {
27 
28 
75 template <class T, class ALLOC>
77  : public ArenaHandleBaseT<T, ALLOC>
78 {
79 public:
82 
84  typedef T* pointer;
85 
88  typedef typename Base::iterator iterator;
89  typedef typename Base::const_iterator const_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
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
SG::ArenaCachingHandle::iterator
Base::iterator iterator
Iterators over elements.
Definition: ArenaCachingHandle.h:88
SG::ArenaCachingHandle
User interface for allocating memory that caches constructed objects.
Definition: ArenaCachingHandle.h:78
header
Definition: hcg.cxx:526
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
index
Definition: index.py:1
taskman.template
dictionary template
Definition: taskman.py:317
SG::ArenaCachingHandle::pointer
T * pointer
Pointer to an element.
Definition: ArenaCachingHandle.h:84
SG::ArenaHeader
Proxy for a group of Arenas.
Definition: ArenaHeader.h:54
SG::ArenaCachingHandle::allocate
pointer allocate()
Allocate a new element.
SG::ArenaCachingHandle::ArenaCachingHandle
ArenaCachingHandle(Arena *arena, const typename ALLOC::Params *params=nullptr)
Constructor, passing in an Arena and an optional parameter set.
SG::Arena
Collection of memory allocators with a common lifetime,.
Definition: Arena.h:238
SG::ArenaCachingHandle::Base
ArenaHandleBaseT< T, ALLOC > Base
Shorthand for our base class.
Definition: ArenaCachingHandle.h:81
SG::ArenaCachingHandle::makeAllocator
static std::unique_ptr< ArenaAllocatorBase > makeAllocator(const typename ALLOC::Params &params)
Internal helper: create a new Allocator instance.
ArenaCachingHandle.icc
Arena.h
Collection of memory allocators with a common lifetime, plus subsystem summary.
SG::ArenaCachingHandle::ArenaCachingHandle
ArenaCachingHandle(ArenaHeader *header, const typename ALLOC::Params *params=nullptr)
Constructor, passing in a Header and an optional parameter set.
SG::ArenaCachingHandle::ArenaCachingHandle
ArenaCachingHandle(ArenaHeader *header, size_t index)
Constructor, passing in an index.
SG::ArenaCachingHandle::ArenaCachingHandle
ArenaCachingHandle(const typename ALLOC::Params *params=nullptr)
Constructor, passing in an optional parameter set.
SG::ArenaCachingHandle::ArenaCachingHandle
ArenaCachingHandle(ArenaHeader *header, const EventContext &ctx, const typename ALLOC::Params *params=nullptr)
Constructor, passing in a Header, context, and an optional parameter set.
SG::ArenaCachingHandle::const_iterator
Base::const_iterator const_iterator
Definition: ArenaCachingHandle.h:89
ArenaHandleBaseT.h
Base class for Handle classes, containing parts that are independent of how the Allocator gets create...
SG::ArenaHandleBaseAllocT::params
const ALLOC::Params & params() const
Return our Allocator's parameters.
SG::ArenaCachingHandle::defaultParams_t
ALLOC::template initParams< T, false > defaultParams_t
The class that initializes the default parameter set.
Definition: ArenaCachingHandle.h:102
SG::ArenaHandleBaseT
Base class for Handle classes, containing parts that are independent of how the Allocator gets create...
Definition: ArenaHandleBaseT.h:39