ATLAS Offline Software
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 
18 #ifndef ATLALLOCATORS_ARENAHANDLE_H
19 #define ATLALLOCATORS_ARENAHANDLE_H
20 
21 
23 #include "AthAllocators/Arena.h"
24 
25 
26 namespace SG {
27 
28 
70 template <class T, class ALLOC>
72  : public ArenaHandleBaseT<T, ALLOC>
73 {
74 public:
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
SG::ArenaHandle
User interface for allocating memory.
Definition: ArenaHandle.h:73
SG::ArenaHandle::ArenaHandle
ArenaHandle(Arena *arena, const typename ALLOC::Params *params=nullptr)
Constructor, passing in an Arena and an optional parameter set.
header
Definition: hcg.cxx:526
SG::ArenaHandle::const_iterator
Base::const_iterator const_iterator
Definition: ArenaHandle.h:84
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::ArenaHandle::ArenaHandle
ArenaHandle(ArenaHeader *header, size_t index)
Constructor, passing in an index.
SG::ArenaHandle::allocate
void * allocate()
Allocate a new element.
SG::ArenaHandle::Base
ArenaHandleBaseT< T, ALLOC > Base
Shorthand for our base class.
Definition: ArenaHandle.h:76
index
Definition: index.py:1
SG::ArenaHandleBaseT::const_iterator
Const iterator.
Definition: ArenaHandleBaseT.h:144
SG::ArenaHandle::iterator
Base::iterator iterator
Iterators over elements.
Definition: ArenaHandle.h:83
taskman.template
dictionary template
Definition: taskman.py:317
ArenaHandle.icc
SG::ArenaHandle::ArenaHandle
ArenaHandle(ArenaHeader *header, const EventContext &ctx, const typename ALLOC::Params *params=nullptr)
Constructor, passing in a Header, context, and an optional parameter set.
SG::ArenaHandleBaseT::pointer
T * pointer
A pointer to the element type we're allocating.
Definition: ArenaHandleBaseT.h:42
SG::ArenaHandle::defaultParams_t
ALLOC::template initParams< T, false, true > defaultParams_t
The class that initializes the default parameter set.
Definition: ArenaHandle.h:97
SG::ArenaHandle::pointer
Base::pointer pointer
Pointer to an element.
Definition: ArenaHandle.h:79
SG::ArenaHandleBaseT::iterator
Non-const iterator.
Definition: ArenaHandleBaseT.h:100
SG::ArenaHeader
Proxy for a group of Arenas.
Definition: ArenaHeader.h:54
SG::Arena
Collection of memory allocators with a common lifetime,.
Definition: Arena.h:238
SG::ArenaHandle::ArenaHandle
ArenaHandle(const typename ALLOC::Params *params=nullptr)
Constructor, passing in an optional parameter set.
Arena.h
Collection of memory allocators with a common lifetime, plus subsystem summary.
SG::ArenaHandle::ArenaHandle
ArenaHandle(ArenaHeader *header, const typename ALLOC::Params *params=nullptr)
Constructor, passing in a Header and an optional parameter set.
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::ArenaHandleBaseT
Base class for Handle classes, containing parts that are independent of how the Allocator gets create...
Definition: ArenaHandleBaseT.h:39
SG::ArenaHandle::makeAllocator
static std::unique_ptr< ArenaAllocatorBase > makeAllocator(const typename ALLOC::Params &params)
Internal helper: create a new Allocator instance.