Logo ROOT   6.16/01
Reference Guide
RCustomColumnBase.hxx
Go to the documentation of this file.
1// Author: Enrico Guiraud, Danilo Piparo CERN 09/2018
2
3/*************************************************************************
4 * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOT_RCUSTOMCOLUMNBASE
12#define ROOT_RCUSTOMCOLUMNBASE
13
16
17#include <memory>
18#include <string>
19#include <vector>
20
21class TTreeReader;
22
23namespace ROOT {
24namespace Detail {
25namespace RDF {
26
28class RLoopManager;
29
31protected:
32 RLoopManager *fLoopManager; ///< A raw pointer to the RLoopManager at the root of this functional graph. It is only
33 /// guaranteed to contain a valid address during an event loop.
34 const std::string fName;
35 unsigned int fNChildren{0}; ///< number of nodes of the functional graph hanging from this object
36 unsigned int fNStopsReceived{0}; ///< number of times that a children node signaled to stop processing entries.
37 const unsigned int fNSlots; ///< number of thread slots used by this node, inherited from parent node.
38 const bool fIsDataSourceColumn; ///< does the custom column refer to a data-source column? (or a user-define column?)
39 std::vector<Long64_t> fLastCheckedEntry;
40 /// A unique ID that identifies this custom column.
41 /// Used e.g. to distinguish custom columns with the same name in different branches of the computation graph.
42 const unsigned int fID = GetNextID();
44
45 static unsigned int GetNextID();
46
47public:
48 RCustomColumnBase(RLoopManager *lm, std::string_view name, const unsigned int nSlots, const bool isDSColumn,
49 const RDFInternal::RBookedCustomColumns &customColumns);
50
52 virtual ~RCustomColumnBase();
53 virtual void InitSlot(TTreeReader *r, unsigned int slot) = 0;
54 virtual void *GetValuePtr(unsigned int slot) = 0;
55 virtual const std::type_info &GetTypeId() const = 0;
57 std::string GetName() const;
58 virtual void Update(unsigned int slot, Long64_t entry) = 0;
59 virtual void ClearValueReaders(unsigned int slot) = 0;
60 bool IsDataSourceColumn() const { return fIsDataSourceColumn; }
61 virtual void InitNode();
62 /// Return the unique identifier of this RCustomColumnBase.
63 unsigned int GetID() const { return fID; }
64};
65
66} // ns RDF
67} // ns Detail
68} // ns ROOT
69
70#endif // ROOT_RCUSTOMCOLUMNBASE
ROOT::R::TRInterface & r
Definition: Object.C:4
long long Long64_t
Definition: RtypesCore.h:69
unsigned int fNChildren
number of nodes of the functional graph hanging from this object
virtual void Update(unsigned int slot, Long64_t entry)=0
unsigned int GetID() const
Return the unique identifier of this RCustomColumnBase.
virtual void * GetValuePtr(unsigned int slot)=0
RLoopManager * fLoopManager
A raw pointer to the RLoopManager at the root of this functional graph.
unsigned int fNStopsReceived
number of times that a children node signaled to stop processing entries.
virtual void InitSlot(TTreeReader *r, unsigned int slot)=0
virtual void ClearValueReaders(unsigned int slot)=0
const bool fIsDataSourceColumn
does the custom column refer to a data-source column? (or a user-define column?)
std::vector< Long64_t > fLastCheckedEntry
virtual const std::type_info & GetTypeId() const =0
RLoopManager * GetLoopManagerUnchecked() const
RCustomColumnBase(RLoopManager *lm, std::string_view name, const unsigned int nSlots, const bool isDSColumn, const RDFInternal::RBookedCustomColumns &customColumns)
RDFInternal::RBookedCustomColumns fCustomColumns
RCustomColumnBase & operator=(const RCustomColumnBase &)=delete
const unsigned int fNSlots
number of thread slots used by this node, inherited from parent node.
const unsigned int fID
A unique ID that identifies this custom column.
The head node of a RDF computation graph.
Encapsulates the columns defined by the user.
A simple, robust and fast interface to read values from ROOT colmnar datasets such as TTree,...
Definition: TTreeReader.h:44
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
basic_string_view< char > string_view
Definition: RStringView.hxx:35