File tree Expand file tree Collapse file tree 5 files changed +9
-7
lines changed
Expand file tree Collapse file tree 5 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1717#include " TString.h"
1818
1919#include < algorithm> // std::transform
20+ #include < cassert>
2021#include < string>
2122#include < typeinfo>
2223#include < vector>
@@ -130,7 +131,12 @@ public:
130131 // / Slots numbers are used to simplify parallel execution: RDataFrame guarantees that different threads will always
131132 // / pass different slot values when calling methods concurrently.
132133 // clang-format on
133- virtual void SetNSlots (unsigned int nSlots) = 0;
134+ virtual void SetNSlots (unsigned int nSlots)
135+ {
136+ assert (fNSlots == 0 );
137+ assert (nSlots > 0 );
138+ fNSlots = nSlots;
139+ };
134140
135141 // / \brief Returns the number of files from which the dataset is constructed
136142 virtual std::size_t GetNFiles () const { return 0 ; }
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ public:
173173 return true ;
174174 }
175175
176- void SetNSlots (unsigned int nSlots)
176+ void SetNSlots (unsigned int nSlots) final
177177 {
178178 fNSlots = nSlots;
179179 const auto nCols = fColNames .size ();
Original file line number Diff line number Diff line change @@ -48,8 +48,6 @@ public:
4848 RArraysDS &operator =(RArraysDS &&) = delete ;
4949 ~RArraysDS () final = default ;
5050
51- void SetNSlots (unsigned int ) final { }
52-
5351 const std::vector<std::string> &GetColumnNames () const final { return fColumnNames ; }
5452
5553 bool HasColumn (std::string_view name) const final
Original file line number Diff line number Diff line change @@ -45,8 +45,7 @@ public:
4545 auto entryRanges (std::move (fEntryRanges )); // empty fEntryRanges
4646 return entryRanges;
4747 };
48- bool SetEntry (unsigned int , ULong64_t) final { return true ;};
49- void SetNSlots (unsigned int ) final {};
48+ bool SetEntry (unsigned int , ULong64_t) final { return true ; };
5049 std::string GetLabel () final {
5150 return " NonCopiableColumnDS" ;
5251 }
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ public:
2222 RStreamingDS &operator =(RStreamingDS &&) = delete ;
2323 ~RStreamingDS () final = default ;
2424
25- void SetNSlots (unsigned int nSlots) final { fNSlots = nSlots; }
2625 const std::vector<std::string> &GetColumnNames () const final { return fColumnNames ; }
2726 bool HasColumn (std::string_view name) const final { return std::string (name) == " ans" ? true : false ; }
2827 std::string GetTypeName (std::string_view) const final { return " int" ; }
You can’t perform that action at this time.
0 commit comments