ATLAS Offline Software
Arena.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: Arena.cxx 470529 2011-11-24 23:54:22Z ssnyder $
14 #include "AthAllocators/Arena.h"
16 
17 namespace SG {
18 
19 
26 Arena::Arena (const std::string& name, ArenaHeader* header /*= 0*/)
27  : ArenaBase (name),
28  m_header (header)
29 {
30  if (!m_header) {
32  }
33  m_header->addArena (this);
34 }
35 
36 
41 {
42  m_header->delArena (this);
43 }
44 
45 
50 {
51  return m_header;
52 }
53 
54 
60 {
61  return m_header->setArena (this);
62 }
63 
64 
70  : m_header (a.header()),
71  m_prev (a.makeCurrent())
72 {
73 }
74 
75 
80 {
81  m_header->setArena (m_prev);
82 }
83 
84 
85 } // namespace SG
header
Definition: hcg.cxx:526
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::Arena::header
ArenaHeader * header()
Return the ArenaHeader with which this Arena is associated.
Definition: Arena.cxx:49
SG::Arena::makeCurrent
ArenaBase * makeCurrent()
Make this Arena the current one for its ArenaHeader.
Definition: Arena.cxx:59
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::Arena
Collection of memory allocators with a common lifetime,.
Definition: Arena.h:238
SG::ArenaBase
Part of Arena dealing with the list of allocators.
Definition: ArenaBase.h:42
SG::Arena::~Arena
~Arena()
Destructor.
Definition: Arena.cxx:40
SG::Arena::Arena
Arena(const std::string &name, ArenaHeader *header=0)
Constructor.
Definition: Arena.cxx:26
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::ArenaHeader::defaultHeader
static ArenaHeader * defaultHeader()
Return the global default Header instance.
Definition: ArenaHeader.cxx:164
Arena.h
Collection of memory allocators with a common lifetime, plus subsystem summary.
a
TList * a
Definition: liststreamerinfos.cxx:10
SG::Arena::Push::~Push
~Push()
Destructor.
Definition: Arena.cxx:79
SG::ArenaHeader::delArena
void delArena(ArenaBase *a)
Remove an Arena from the group.
Definition: ArenaHeader.cxx:101
SG::Arena::m_header
ArenaHeader * m_header
The ArenaHeader with which we're associated.
Definition: Arena.h:300
SG::Arena::Push::Push
Push(Arena &a)
Constructor.
Definition: Arena.cxx:69
SG::ArenaHeader::setArena
ArenaBase * setArena(ArenaBase *arena)
Set the current Arena for the current thread.
Definition: ArenaHeader.cxx:59
SG::ArenaHeader::addArena
void addArena(ArenaBase *a)
Add a new Arena to the group.
Definition: ArenaHeader.cxx:72