ATLAS Offline Software
ArenaHandleBase.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: ArenaHandleBase.cxx 470529 2011-11-24 23:54:22Z ssnyder $
17 
18 
19 namespace SG {
20 
21 
29  : m_allocator ( (header ? header : ArenaHeader::defaultHeader()) ->
30  allocator (index))
31 {
32 }
33 
34 
43  const EventContext& ctx,
44  size_t index)
45  : m_allocator ( (header ? header : ArenaHeader::defaultHeader()) ->
46  allocator (ctx, index))
47 {
48 }
49 
50 
57  : m_allocator (arena->allocator (index))
58 {
59 }
60 
61 
72 {
73  return baseAllocator()->reset();
74 }
75 
76 
88 {
89  return baseAllocator()->erase();
90 }
91 
92 
112 {
113  return baseAllocator()->reserve (size);
114 }
115 
116 
122 {
123  return baseAllocator()->stats();
124 }
125 
126 
127 } // namespace SG
SG::ArenaHandleBase::baseAllocator
ArenaAllocatorBase * baseAllocator()
Return the current Allocator which we are referencing.
SG::ArenaAllocatorBase::stats
virtual Stats stats() const =0
Return the statistics block for this allocator.
SG::ArenaHandleBase::stats
ArenaAllocatorBase::Stats stats() const
Return the statistics block for this allocator, for the current Arena.
Definition: ArenaHandleBase.cxx:121
header
Definition: hcg.cxx:526
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
index
Definition: index.py:1
SG::ArenaHandleBase::erase
void erase()
Free all allocated elements and release memory back to the system (of this type in the current Arena)...
Definition: ArenaHandleBase.cxx:87
SG::ArenaAllocatorBase::reserve
virtual void reserve(size_t size)=0
Set the total number of elements cached by the allocator.
SG::ArenaAllocatorBase::erase
virtual void erase()=0
Free all allocated elements and release memory back to the system.
SG::ArenaHandleBase::reserve
void reserve(size_t size)
Set the total number of elements cached by the allocator (in the current Arena).
Definition: ArenaHandleBase.cxx:111
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
ArenaHandleBase.h
Base class for all Handle classes, containing parts that do not depend on the referenced type....
SG::ArenaAllocatorBase::Stats
Statistics for an allocator.
Definition: ArenaAllocatorBase.h:188
SG::ArenaHeader
Proxy for a group of Arenas.
Definition: ArenaHeader.h:54
ArenaAllocatorBase.h
Common base class for arena allocator classes. See Arena.h for an overview of the arena-based memory ...
SG::ArenaBase
Part of Arena dealing with the list of allocators.
Definition: ArenaBase.h:42
SG::ArenaHandleBase::reset
void reset()
Free all allocated elements (of this type in the current Arena).
Definition: ArenaHandleBase.cxx:71
SG::ArenaAllocatorBase::reset
virtual void reset()=0
Free all allocated elements.
SG::ArenaHandleBase::ArenaHandleBase
ArenaHandleBase(ArenaHeader *header, size_t index)
Constructor.
Definition: ArenaHandleBase.cxx:28