![]() |
ATLAS Offline Software
|
Manager for EDM objects created by ROOT. More...
#include <RObjectManager.h>
Public Member Functions | |
RObjectManager (ROOT::RNTupleView< void > field, ::Long64_t &entry, THolder *holder=0, ::Bool_t renewOnRead=kFALSE) | |
Constructor. More... | |
RObjectManager (const RObjectManager &parent)=delete | |
Do not allow copy-constructing this object: More... | |
~RObjectManager () | |
Destructor. More... | |
RObjectManager & | operator= (const RObjectManager &parent)=delete |
Do not allow copying this object. More... | |
const std::string & | fieldName () const |
provide the field name More... | |
const THolder * | holder () const |
Accessor to the Holder object. More... | |
THolder * | holder () |
Accessor to the Holder object. More... | |
virtual ::Int_t | getEntry (::Int_t getall=0) override |
Function for updating the object in memory if needed. More... | |
virtual const void * | object () const override |
Function getting a const pointer to the object being handled. More... | |
virtual void * | object () override |
Function getting a pointer to the object being handled. More... | |
virtual void | setObject (void *obj) override |
Function replacing the object being handled. More... | |
virtual ::Bool_t | create () override |
Create the object for the current event. More... | |
virtual ::Bool_t | isSet () const override |
Check if the object was set for the current event. More... | |
virtual void | reset () override |
Reset the object at the end of processing of an event. More... | |
Private Attributes | |
ROOT::RNTupleView< void > | m_field |
The typeless object taking care of reading the field. More... | |
std::unique_ptr< THolder > | m_holder |
Holder object for the EDM object. More... | |
std::reference_wrapper<::Long64_t > | m_entryToLoad |
Entry number to load next. More... | |
::Long64_t | m_entry |
The last entry that was loaded for this field. More... | |
::Bool_t | m_isSet |
Was the object set for the current event? More... | |
::Bool_t | m_renewOnRead |
Should the object be recreated on each read? More... | |
Manager for EDM objects created by ROOT.
This class is used when an EDM object is meant to be created by ROOT's schema evolution system, behind the scenes.
Definition at line 43 of file RObjectManager.h.
xAOD::Experimental::RObjectManager::RObjectManager | ( | ROOT::RNTupleView< void > | field, |
::Long64_t & | entry, | ||
THolder * | holder = 0 , |
||
::Bool_t | renewOnRead = kFALSE |
||
) |
|
delete |
Do not allow copy-constructing this object:
xAOD::Experimental::RObjectManager::~RObjectManager | ( | ) |
|
overridevirtual |
Create the object for the current event.
Dummy implementation as full objects can't be missing.
Implements xAOD::TVirtualManager.
Definition at line 115 of file RObjectManager.cxx.
const std::string & xAOD::Experimental::RObjectManager::fieldName | ( | ) | const |
|
overridevirtual |
Function for updating the object in memory if needed.
This function is used to load the contents of a field only when it needs to be done.
It keeps track of which entry was already loaded for a field/object, and only asks the RNTupleView for the field to load an entry when it really has to be done. The next entry to load (m_entryToLoad) is managed by the owning Event object, set in this object's constructor.
Implements xAOD::TVirtualManager.
Definition at line 56 of file RObjectManager.cxx.
THolder * xAOD::Experimental::RObjectManager::holder | ( | ) |
Accessor to the Holder object.
Definition at line 43 of file RObjectManager.cxx.
Accessor to the Holder object.
Definition at line 36 of file RObjectManager.cxx.
|
overridevirtual |
Check if the object was set for the current event.
kTRUE
if the object for this event was set, kFALSE
otherwise Implements xAOD::TVirtualManager.
Definition at line 123 of file RObjectManager.cxx.
|
overridevirtual |
Function getting a const pointer to the object being handled.
This function gives an easy access to the object managed by this object.
Implements xAOD::TVirtualManager.
Definition at line 92 of file RObjectManager.cxx.
|
overridevirtual |
Function getting a pointer to the object being handled.
Implements xAOD::TVirtualManager.
Definition at line 97 of file RObjectManager.cxx.
|
delete |
Do not allow copying this object.
|
overridevirtual |
Reset the object at the end of processing of an event.
This function needs to be called after an event was filled into the output TTree.
It tells the manager object that it needs to wait for another object to be set up for the upcoming event.
Implements xAOD::TVirtualManager.
Definition at line 132 of file RObjectManager.cxx.
|
overridevirtual |
Function replacing the object being handled.
This is just a convenient way of calling THolder::Set from TEvent.
obj | The object to replace the previously managed one |
Implements xAOD::TVirtualManager.
Definition at line 106 of file RObjectManager.cxx.
|
private |
The last entry that was loaded for this field.
Definition at line 90 of file RObjectManager.h.
|
private |
Entry number to load next.
Definition at line 88 of file RObjectManager.h.
|
private |
The typeless object taking care of reading the field.
Definition at line 84 of file RObjectManager.h.
|
private |
Holder object for the EDM object.
Definition at line 86 of file RObjectManager.h.
|
private |
Was the object set for the current event?
Definition at line 92 of file RObjectManager.h.
|
private |
Should the object be recreated on each read?
Definition at line 94 of file RObjectManager.h.