Logo ROOT  
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#include <deque>
21
22class TTreeReader;
23
24namespace ROOT {
25namespace Detail {
26namespace RDF {
27
29
31protected:
32 const std::string fName; ///< The name of the custom column
33 const std::string fType; ///< The type of the custom column as a text string
34 unsigned int fNChildren{0}; ///< number of nodes of the functional graph hanging from this object
35 unsigned int fNStopsReceived{0}; ///< number of times that a children node signaled to stop processing entries.
36 const unsigned int fNSlots; ///< number of thread slots used by this node, inherited from parent node.
37 const bool fIsDataSourceColumn; ///< does the custom column refer to a data-source column? (or a user-define column?)
38 std::vector<Long64_t> fLastCheckedEntry;
39 /// A unique ID that identifies this custom column.
40 /// Used e.g. to distinguish custom columns with the same name in different branches of the computation graph.
41 const unsigned int fID = GetNextID();
43 std::deque<bool> fIsInitialized; // because vector<bool> is not thread-safe
44
45 static unsigned int GetNextID();
46
47public:
49 bool isDSColumn, const RDFInternal::RBookedCustomColumns &customColumns);
50
53 virtual ~RCustomColumnBase();
54 virtual void InitSlot(TTreeReader *r, unsigned int slot) = 0;
55 virtual void *GetValuePtr(unsigned int slot) = 0;
56 virtual const std::type_info &GetTypeId() const = 0;
57 std::string GetName() const;
58 std::string GetTypeName() const;
59 virtual void Update(unsigned int slot, Long64_t entry) = 0;
60 virtual void ClearValueReaders(unsigned int slot) = 0;
61 bool IsDataSourceColumn() const { return fIsDataSourceColumn; }
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:71
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
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.
const std::string fType
The type of the custom column as a text string.
const std::string fName
The name of the custom column.
virtual void * GetValuePtr(unsigned int slot)=0
unsigned int fNStopsReceived
number of times that a children node signaled to stop processing entries.
virtual void InitSlot(TTreeReader *r, unsigned int slot)=0
RCustomColumnBase(std::string_view name, std::string_view type, unsigned int nSlots, bool isDSColumn, const RDFInternal::RBookedCustomColumns &customColumns)
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
RCustomColumnBase & operator=(RCustomColumnBase &&)=delete
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.
Encapsulates the columns defined by the user.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
Definition: TTreeReader.h:43
basic_string_view< char > string_view
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21