Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RCustomColumnBase.cxx
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 
13 #include "ROOT/RStringView.hxx"
14 #include "RtypesCore.h" // Long64_t
15 
16 #include <string>
17 #include <vector>
18 
19 using ROOT::Detail::RDF::RCustomColumnBase;
20 using ROOT::Detail::RDF::RLoopManager;
21 namespace RDFInternal = ROOT::Internal::RDF;
22 
23 unsigned int RCustomColumnBase::GetNextID()
24 {
25  static unsigned int id = 0U;
26  ++id;
27  return id;
28 }
29 
30 RCustomColumnBase::RCustomColumnBase(RLoopManager *lm, std::string_view name, const unsigned int nSlots,
31  const bool isDSColumn, const RDFInternal::RBookedCustomColumns &customColumns)
32  : fLoopManager(lm), fName(name), fNSlots(nSlots), fIsDataSourceColumn(isDSColumn), fCustomColumns(customColumns),
33  fIsInitialized(nSlots, false)
34 {
35  fLoopManager->RegisterCustomColumn(this);
36 }
37 
38 // pin vtable. Work around cling JIT issue.
39 RCustomColumnBase::~RCustomColumnBase()
40 {
41  fLoopManager->DeRegisterCustomColumn(this);
42 }
43 
44 std::string RCustomColumnBase::GetName() const
45 {
46  return fName;
47 }
48 
49 void RCustomColumnBase::InitNode()
50 {
51  fLastCheckedEntry = std::vector<Long64_t>(fNSlots, -1);
52 }