ATLAS Offline Software
Loading...
Searching...
No Matches
RObjectManager.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef XAODROOTACCESS_TOOLS_ROBJECTMANAGER_H
8#define XAODROOTACCESS_TOOLS_ROBJECTMANAGER_H
9
10// Local include(s).
12
13// ROOT include(s).
14#include <ROOT/RNTupleView.hxx>
15
16// System include(s).
17#include <functional>
18#include <memory>
19
20namespace xAOD::Experimental {
21
31
32 public:
34 RObjectManager(ROOT::RNTupleView<void> field, const ::Long64_t& entry,
35 std::unique_ptr<THolder> holder);
38
40 ROOT::RNTupleView<void>& field();
42 const ROOT::RNTupleView<void>& field() const;
43
45 virtual ::Int_t getEntry(::Int_t getall = 0) override;
46
48 virtual const void* object() const override;
50 virtual void* object() override;
52 virtual void setObject(void* obj) override;
53
55 virtual ::Bool_t create() override;
57 virtual ::Bool_t isSet() const override;
59 virtual void reset() override;
60
61 private:
63 ROOT::RNTupleView<void> m_field;
65 std::unique_ptr<THolder> m_holder;
67 std::reference_wrapper<const ::Long64_t> m_entryToLoad;
69 ::Long64_t m_entry;
71 ::Bool_t m_isSet;
72
73}; // class RObjectManager
74
75} // namespace xAOD::Experimental
76
77#endif // XAODROOTACCESS_TOOLS_ROBJECTMANAGER_H
Manager for EDM objects created by ROOT.
const THolder * holder() const
Accessor to the Holder object.
std::reference_wrapper< const ::Long64_t > m_entryToLoad
Entry number to load next.
virtual::Int_t getEntry(::Int_t getall=0) override
Function for updating the object in memory if needed.
virtual::Bool_t create() override
Create the object for the current event.
RObjectManager(ROOT::RNTupleView< void > field, const ::Long64_t &entry, std::unique_ptr< THolder > holder)
Constructor.
::Bool_t m_isSet
Was the object set for the current event?
std::unique_ptr< THolder > m_holder
Holder object for the EDM object.
ROOT::RNTupleView< void > m_field
The typeless object taking care of reading the field.
virtual void reset() override
Reset the object at the end of processing of an event.
::Long64_t m_entry
The last entry that was loaded for this field.
virtual void setObject(void *obj) override
Function replacing the object being handled.
virtual const void * object() const override
Function getting a const pointer to the object being handled.
virtual::Bool_t isSet() const override
Check if the object was set for the current event.
ROOT::RNTupleView< void > & field()
Accessor to the field (non-const)