ATLAS Offline Software
RAuxManager.cxx
Go to the documentation of this file.
1 // Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 // ROOT include(s):
4 #include <TError.h>
5 
6 // Local include(s):
10 
11 namespace xAOD {
12 
13  RAuxManager::RAuxManager( RAuxStore* store, ::Bool_t sharedOwner )
14  : m_store(), m_storePtr( store ) {
15 
16  if( sharedOwner ) {
17  m_store.reset( store );
18  }
19  }
20 
22  : m_store( parent.m_store ), m_storePtr( parent.m_storePtr ) {}
23 
25 
26  // Check if anything needs to be done:
27  if( this == &rhs ) {
28  return *this;
29  }
30 
31  // Do the assignment:
32  m_store = rhs.m_store;
33  m_storePtr = rhs.m_storePtr;
34 
35  return *this;
36  }
37 
38  ::Int_t RAuxManager::getEntry( ::Int_t getall ) {
39 
40  return m_storePtr->getEntry( getall );
41  }
42 
43  const void* RAuxManager::object() const {
44 
45  return m_storePtr;
46  }
47 
49 
50  return m_storePtr;
51  }
52 
53  void RAuxManager::setObject( void* ptr ) {
54 
55  if( m_store.get() ) {
56  m_store.reset( reinterpret_cast< RAuxStore* >( ptr ) );
57  }
58  m_storePtr = reinterpret_cast< RAuxStore* >( ptr );
59 
60  return;
61  }
62 
65  ::Bool_t RAuxManager::create() {
66 
67  return kTRUE;
68  }
69 
74  ::Bool_t RAuxManager::isSet() const {
75 
76  return kTRUE;
77  }
78 
84 
85  // Clear the store if it's a container store:
87  m_storePtr->resize( 0 );
88  m_storePtr->reset();
89  }
90 
91  return;
92  }
93 
95 
96  return m_storePtr;
97  }
98 
100 
101  return m_storePtr;
102  }
103 
104 } // namespace xAOD
xAOD::RAuxStore::structMode
EStructMode structMode() const
Return the structure mode of the object.
Definition: RAuxStore.cxx:91
SGTest::store
TestStore store
Definition: TestStore.cxx:23
xAOD::RAuxStore::kContainerStore
@ kContainerStore
The object describes an entire container.
Definition: RAuxStore.h:47
xAOD::RAuxManager::getStore
RAuxStore * getStore()
Get a type-specific pointer to the managed object.
Definition: RAuxManager.cxx:94
RAuxManager.h
xAOD::RAuxStore::reset
void reset()
Reset the store.
Definition: RAuxStore.cxx:202
RAuxStore.h
xAOD::RAuxManager::operator=
RAuxManager & operator=(const RAuxManager &rhs)
Assignment operator.
Definition: RAuxManager.cxx:24
xAOD::RAuxManager::m_storePtr
RAuxStore * m_storePtr
Pointer to the auxiliary store object.
Definition: RAuxManager.h:62
xAOD::RAuxStore
Definition: RAuxStore.h:36
xAOD::RAuxManager::getEntry
virtual ::Int_t getEntry(::Int_t getall=0) override
Function for updating the object in memory if needed.
Definition: RAuxManager.cxx:38
xAOD::RAuxManager::RAuxManager
RAuxManager(RAuxStore *store, ::Bool_t sharedOwner=kTRUE)
Constructor getting hold of an auxiliary store object.
Definition: RAuxManager.cxx:13
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
xAOD::RAuxStore::getEntry
::Int_t getEntry(Long64_t entry, ::Int_t getall=0)
Get entry from the input RNTuple.
Definition: RAuxStore.cxx:155
Message.h
xAOD::RAuxManager::reset
virtual void reset() override
Reset the object at the end of processing of an event.
Definition: RAuxManager.cxx:83
xAOD::RAuxManager::m_store
std::shared_ptr< RAuxStore > m_store
The auxiliary store object.
Definition: RAuxManager.h:60
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::RAuxManager::getConstStore
const SG::IConstAuxStore * getConstStore() const
Get a convenience pointer to the managed object.
Definition: RAuxManager.cxx:99
xAOD::RAuxManager::isSet
virtual ::Bool_t isSet() const override
Check if the object was set for the current event.
Definition: RAuxManager.cxx:74
xAOD::RAuxManager::object
virtual const void * object() const override
Function getting a const pointer to the object being handled.
Definition: RAuxManager.cxx:43
xAOD::RAuxStore::resize
virtual bool resize(size_t size) override
Resize the arrays to a given size.
Definition: RAuxStore.cxx:601
xAOD::RAuxManager
Manager for RAuxStore objects.
Definition: RAuxManager.h:25
xAOD::RAuxManager::setObject
virtual void setObject(void *obj) override
Function replacing the object being handled.
Definition: RAuxManager.cxx:53
xAOD::RAuxManager::create
virtual ::Bool_t create() override
Create the object for the current event.
Definition: RAuxManager.cxx:65
SG::IConstAuxStore
Interface for const operations on an auxiliary store.
Definition: IConstAuxStore.h:64