Skip to content

Commit d093a13

Browse files
committed
[df] Simplify nslots in RDataSource
The fNSlots data member is used by all data sources, thus it can be upstreamed to the base class.
1 parent 842fa29 commit d093a13

11 files changed

+3
-10
lines changed

tree/dataframe/inc/ROOT/RArrowDS.hxx

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ private:
3232
std::shared_ptr<arrow::Table> fTable;
3333
std::vector<std::pair<ULong64_t, ULong64_t>> fEntryRanges;
3434
std::vector<std::string> fColumnNames;
35-
size_t fNSlots = 0U;
3635

3736
std::vector<std::pair<size_t, size_t>> fGetterIndex; // (columnId, visitorId)
3837
std::vector<std::unique_ptr<ROOT::Internal::RDF::TValueGetter>> fValueGetters; // Visitors to be used to track and get entries. One per column.

tree/dataframe/inc/ROOT/RCsvDS.hxx

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ private:
7373
std::int64_t fDataLineNumber = 0;
7474
std::int64_t fLineNumber = 0; // used to skip the last lines
7575
std::int64_t fMaxLineNumber = -1; // set to non-negative if fOptions.fSkipLastNLines is set
76-
unsigned int fNSlots = 0U;
7776
std::unique_ptr<ROOT::Internal::RRawFile> fCsvFile;
7877
ULong64_t fEntryRangesRequested = 0ULL;
7978
ULong64_t fProcessedLines = 0ULL; // marks the progress of the consumption of the csv lines

tree/dataframe/inc/ROOT/RDF/RLazyDSImpl.hxx

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class RLazyDS final : public ROOT::RDF::RDataSource {
5151
const PointerHolderPtrs_t fPointerHoldersModels;
5252
std::vector<PointerHolderPtrs_t> fPointerHolders;
5353
std::vector<std::pair<ULong64_t, ULong64_t>> fEntryRanges{};
54-
unsigned int fNSlots{0};
5554

5655
Record_t GetColumnReadersImpl(std::string_view colName, const std::type_info &id) final
5756
{

tree/dataframe/inc/ROOT/RDataSource.hxx

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ protected:
114114

115115
virtual std::string AsString() { return "generic data source"; };
116116

117+
unsigned int fNSlots{};
118+
117119
public:
118120
RDataSource() = default;
119121
// Rule of five

tree/dataframe/inc/ROOT/RNTupleDS.hxx

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ class RNTupleDS final : public ROOT::RDF::RDataSource {
101101
/// to new page sources when the files in the chain change.
102102
std::vector<std::vector<Internal::RNTupleColumnReader *>> fActiveColumnReaders;
103103

104-
unsigned int fNSlots = 0;
105104
ULong64_t fSeenEntries = 0; ///< The number of entries so far returned by GetEntryRanges()
106105
std::vector<REntryRangeDS> fCurrentRanges; ///< Basis for the ranges returned by the last GetEntryRanges() call
107106
std::vector<REntryRangeDS> fNextRanges; ///< Basis for the ranges populated by the PrepareNextRanges() call

tree/dataframe/inc/ROOT/RRootDS.hxx

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ namespace RDF {
2727
/// It shows how to implement the RDataSource API for a complex kind of source such as TTrees.
2828
class RRootDS final : public ROOT::RDF::RDataSource {
2929
private:
30-
unsigned int fNSlots = 0U;
3130
std::string fTreeName;
3231
std::string fFileNameGlob;
3332
mutable TChain fModelChain; // Mutable needed for getting the column type name

tree/dataframe/inc/ROOT/RSqliteDS.hxx

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ private:
7878
void SqliteError(int errcode);
7979

8080
std::unique_ptr<Internal::RSqliteDSDataSet> fDataSet;
81-
unsigned int fNSlots;
8281
ULong64_t fNRow;
8382
std::vector<std::string> fColumnNames;
8483
std::vector<ETypes> fColumnTypes;

tree/dataframe/inc/ROOT/RTrivialDS.hxx

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ namespace RDF {
2525
/// it returns entries from GetEntryRanges forever or until a Range stops the event loop (for test purposes).
2626
class RTrivialDS final : public ROOT::RDF::RDataSource {
2727
private:
28-
unsigned int fNSlots = 0U;
2928
ULong64_t fSize = 0ULL;
3029
bool fSkipEvenEntries = false;
3130
std::vector<std::pair<ULong64_t, ULong64_t>> fEntryRanges;

tree/dataframe/inc/ROOT/RVecDS.hxx

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class RVecDS final : public ROOT::RDF::RDataSource {
5555
const PointerHolderPtrs_t fPointerHoldersModels;
5656
std::vector<PointerHolderPtrs_t> fPointerHolders;
5757
std::vector<std::pair<ULong64_t, ULong64_t>> fEntryRanges{};
58-
unsigned int fNSlots{0};
5958
std::function<void()> fDeleteRVecs;
6059

6160
Record_t GetColumnReadersImpl(std::string_view colName, const std::type_info &id)

tree/dataframe/src/RSqliteDS.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ constexpr char const *RSqliteDS::fgTypeNames[];
350350
///
351351
/// The constructor opens the sqlite file, prepares the query engine and determines the column names and types.
352352
RSqliteDS::RSqliteDS(const std::string &fileName, const std::string &query)
353-
: fDataSet(std::make_unique<Internal::RSqliteDSDataSet>()), fNSlots(0), fNRow(0)
353+
: fDataSet(std::make_unique<Internal::RSqliteDSDataSet>()), fNRow(0)
354354
{
355355
static bool hasSqliteVfs = RegisterSqliteVfs();
356356
if (!hasSqliteVfs)

tree/dataframe/test/RStreamingDS.hxx

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
/// A RDataSource that provides multiple entry ranges
1010
class RStreamingDS final : public ROOT::RDF::RDataSource {
11-
unsigned int fNSlots = 0u;
1211
unsigned int fCounter = 0u;
1312
const int fAns = 42;
1413
const int *fAnsPtr = &fAns;

0 commit comments

Comments
 (0)