ATLAS Offline Software
Loading...
Searching...
No Matches
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
17
18
19#ifndef ATLALLOCATORS_ARENAHANDLEBASET_H
20#define ATLALLOCATORS_ARENAHANDLEBASET_H
21
24#include "boost/iterator/iterator_adaptor.hpp"
25#include <cstdlib>
26
27
28namespace SG {
29
30
36template <class T, class ALLOC>
38 : public ArenaHandleBaseAllocT<ALLOC>
39{
40public:
42 typedef T* pointer;
43
46
47
55
56
65 const EventContext& ctx,
66 size_t index);
67
68
75
76
77 // Forward declaration.
78 class const_iterator;
79
80
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
193
194
202
203
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
Base class for Handle classes, containing parts that depend only on the Allocator....
Proxy for a group of Arenas. See Arena.h for an overview of the arena-based memory allocators.
CONT::reference reference
Part of Arena dealing with the list of allocators.
Definition ArenaBase.h:42
ArenaHandleBaseAllocT(ArenaHeader *header, size_t index)
Constructor, passing in an index.
const_iterator::reference dereference() const
Dereference the iterator.
const_iterator(const typename ALLOC::const_iterator &it)
Constructor.
const_iterator(const iterator &it)
Constructor from a non-const iterator.
iterator(const typename ALLOC::iterator &it)
Constructor.
iterator::reference dereference() const
Dereference the iterator.
friend class boost::iterator_core_access
const_iterator begin() const
Starting const iterator.
T * pointer
A pointer to the element type we're allocating.
ArenaHandleBaseT(ArenaHeader *header, const EventContext &ctx, size_t index)
Constructor, passing in an index, for a specific event slot.
iterator end()
Ending iterator.
ArenaHandleBaseT(ArenaBase *arena, size_t index)
Constructor, passing in an index, for a specific Arena.
iterator begin()
Starting iterator.
const_iterator end() const
Ending const iterator.
ArenaHandleBaseT(ArenaHeader *header, size_t index)
Constructor, passing in an index.
ArenaHandleBaseAllocT< ALLOC > Base
Shorthand for our base class.
void free(pointer p)
Free an element.
void resetTo(pointer p)
Reset pool back to a previous state.
Proxy for a group of Arenas.
Definition ArenaHeader.h:54
Forward declaration.
Definition index.py:1