ATLAS Offline Software
ArenaHandleBaseT.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-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: ArenaHandleBaseT.h 470529 2011-11-24 23:54:22Z ssnyder $
8 
19 #ifndef ATLALLOCATORS_ARENAHANDLEBASET_H
20 #define ATLALLOCATORS_ARENAHANDLEBASET_H
21 
24 #include "boost/iterator/iterator_adaptor.hpp"
25 #include <cstdlib>
26 
27 
28 namespace SG {
29 
30 
36 template <class T, class ALLOC>
38  : public ArenaHandleBaseAllocT<ALLOC>
39 {
40 public:
42  typedef T* pointer;
43 
46 
47 
55 
56 
65  const EventContext& ctx,
66  size_t index);
67 
68 
74  ArenaHandleBaseT (ArenaBase* arena, size_t index);
75 
76 
77  // Forward declaration.
78  class const_iterator;
79 
80 
94  class iterator
95  : public boost::iterator_adaptor<
96  iterator,
97  typename ALLOC::iterator,
98  T,
99  boost::forward_traversal_tag>
100  {
101  public:
106  iterator (const typename ALLOC::iterator& it);
107 
108 
109  // To allow initializing a @c const_iterator from an @c iterator.
110  friend class const_iterator;
111 
112 
113  private:
114  // Required by @c iterator_adaptor.
116 
117 
122  };
123 
124 
139  : public boost::iterator_adaptor<
140  const_iterator,
141  typename ALLOC::const_iterator,
142  T const,
143  boost::forward_traversal_tag>
144  {
145 
146  public:
151  const_iterator (const typename ALLOC::const_iterator& it);
152 
153 
159 
160 
161  private:
162  // Required by @c iterator_adaptor.
164 
165 
170  };
171 
172 
182 
183 
192  const_iterator begin() const;
193 
194 
202 
203 
210  const_iterator end() const;
211 
212 
223  void free (pointer p);
224 
225 
236  void resetTo (pointer p);
237 };
238 
239 
240 } // namespace SG
241 
242 
244 
245 
246 #endif // not ATLALLOCATORS_ARENAHANDLEBASET_H
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
SG::ArenaHandleBaseT::iterator::dereference
iterator::reference dereference() const
Dereference the iterator.
SG::ArenaHandleBaseT::end
iterator end()
Ending iterator.
header
Definition: hcg.cxx:526
SG::ArenaHandleBaseT::begin
const_iterator begin() const
Starting const iterator.
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
index
Definition: index.py:1
SG::ArenaHandleBaseT::const_iterator
Const iterator.
Definition: ArenaHandleBaseT.h:144
skel.it
it
Definition: skel.GENtoEVGEN.py:396
SG::ArenaHandleBaseT::end
const_iterator end() const
Ending const iterator.
SG::ArenaHandleBaseT::pointer
T * pointer
A pointer to the element type we're allocating.
Definition: ArenaHandleBaseT.h:42
SG::ArenaHandleBaseT::free
void free(pointer p)
Free an element.
SG::ArenaHandleBaseT::iterator::iterator
iterator(const typename ALLOC::iterator &it)
Constructor.
ArenaHeader.h
Proxy for a group of Arenas. See Arena.h for an overview of the arena-based memory allocators.
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
SG::ArenaHandleBaseT::ArenaHandleBaseT
ArenaHandleBaseT(ArenaBase *arena, size_t index)
Constructor, passing in an index, for a specific Arena.
SG::ArenaHandleBaseT::iterator
Non-const iterator.
Definition: ArenaHandleBaseT.h:100
SG::ArenaHeader
Proxy for a group of Arenas.
Definition: ArenaHeader.h:54
SG::ArenaBase
Part of Arena dealing with the list of allocators.
Definition: ArenaBase.h:42
SG::ArenaHandleBaseT::begin
iterator begin()
Starting iterator.
SG::ArenaHandleBaseT::const_iterator::dereference
const_iterator::reference dereference() const
Dereference the iterator.
SG::ArenaHandleBaseT::iterator::iterator_core_access
friend class boost::iterator_core_access
Definition: ArenaHandleBaseT.h:115
ArenaHandleBaseT.icc
SG::ArenaHandleBaseT::const_iterator::const_iterator
const_iterator(const iterator &it)
Constructor from a non-const iterator.
SG::ArenaHandleBaseAllocT
Base class for Handle classes, containing parts that depend only on the Allocator.
Definition: ArenaHandleBaseAllocT.h:54
ArenaHandleBaseAllocT.h
Base class for Handle classes, containing parts that depend only on the Allocator....
SG::ArenaHandleBaseT::const_iterator::iterator_core_access
friend class boost::iterator_core_access
Definition: ArenaHandleBaseT.h:163
dq_make_web_display.reference
reference
Definition: dq_make_web_display.py:44
SG::ArenaHandleBaseT::ArenaHandleBaseT
ArenaHandleBaseT(ArenaHeader *header, size_t index)
Constructor, passing in an index.
SG::ArenaHandleBaseT::ArenaHandleBaseT
ArenaHandleBaseT(ArenaHeader *header, const EventContext &ctx, size_t index)
Constructor, passing in an index, for a specific event slot.
SG::ArenaHandleBaseT::resetTo
void resetTo(pointer p)
Reset pool back to a previous state.
SG::ArenaHandleBaseT::const_iterator::const_iterator
const_iterator(const typename ALLOC::const_iterator &it)
Constructor.
SG::ArenaHandleBaseT
Base class for Handle classes, containing parts that are independent of how the Allocator gets create...
Definition: ArenaHandleBaseT.h:39
SG::ArenaHandleBaseT::Base
ArenaHandleBaseAllocT< ALLOC > Base
Shorthand for our base class.
Definition: ArenaHandleBaseT.h:45