11 #ifndef ROOT_RTRIVIALTDS
12 #define ROOT_RTRIVIALTDS
21 class RTrivialDS final :
public ROOT::RDF::RDataSource {
23 unsigned int fNSlots = 0U;
24 ULong64_t fSize = 0ULL;
25 bool fSkipEvenEntries =
false;
26 std::vector<std::pair<ULong64_t, ULong64_t>> fEntryRanges;
27 std::vector<std::string> fColNames{
"col0"};
28 std::vector<ULong64_t> fCounter;
29 std::vector<ULong64_t *> fCounterAddr;
30 std::vector<void *> GetColumnReadersImpl(std::string_view name,
const std::type_info &);
33 std::string AsString() {
return "trivial data source"; };
36 RTrivialDS(ULong64_t size,
bool skipEvenEntries =
false);
38 const std::vector<std::string> &GetColumnNames()
const;
39 bool HasColumn(std::string_view colName)
const;
40 std::string GetTypeName(std::string_view)
const;
41 std::vector<std::pair<ULong64_t, ULong64_t>> GetEntryRanges();
42 bool SetEntry(
unsigned int slot, ULong64_t entry);
43 void SetNSlots(
unsigned int nSlots);
45 std::string GetLabel();
48 RInterface<RDFDetail::RLoopManager, RTrivialDS> MakeTrivialDataFrame(ULong64_t size,
bool skipEvenEntries =
false);