ATLAS Offline Software
Loading...
Searching...
No Matches
IObjectManager.cxx
Go to the documentation of this file.
1// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3// Local include(s).
5
6namespace xAOD::Details {
7
8IObjectManager::IObjectManager(std::unique_ptr<THolder> holder)
9 : m_holder(std::move(holder)) {}
10
12
13 if (parent.m_holder) {
14 m_holder = std::make_unique<THolder>(*parent.m_holder);
15 }
16}
17
18IObjectManager::IObjectManager(IObjectManager&& parent) noexcept = default;
19
21
23
24 // Check if we need to do anything.
25 if (this == &parent) {
26 return *this;
27 }
28
29 // Make a copy of the holder if there is one.
30 if (parent.m_holder) {
31 m_holder = std::make_unique<THolder>(*parent.m_holder);
32 } else {
33 m_holder.reset();
34 }
35
36 // Return this object.
37 return *this;
38}
39
41 default;
42
44
45 return m_holder.get();
46}
47
49
50 return m_holder.get();
51}
52
53} // namespace xAOD::Details
Manager for EDM objects created by ROOT.
std::unique_ptr< THolder > m_holder
Object holding onto an EDM object in memory.
IObjectManager(std::unique_ptr< THolder > holder)
Constructor.
const THolder * holder() const
Accessor to the Holder object.
IObjectManager & operator=(const IObjectManager &parent)
Copy assignment operator.
~IObjectManager() override
Destructor.
This class takes care of holding EDM objects in memory.
Definition THolder.h:35
STL namespace.