File indexing completed on 2025-09-16 09:08:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_RTRIVIALTDS
0012 #define ROOT_RTRIVIALTDS
0013
0014 #include "ROOT/RDF/RInterface.hxx"
0015 #include "ROOT/RDataSource.hxx"
0016
0017 namespace ROOT {
0018
0019 namespace RDF {
0020
0021
0022
0023
0024
0025
0026 class RTrivialDS final : public ROOT::RDF::RDataSource {
0027 private:
0028 ULong64_t fSize = 0ULL;
0029 bool fSkipEvenEntries = false;
0030 std::vector<std::pair<ULong64_t, ULong64_t>> fEntryRanges;
0031 std::vector<std::string> fColNames{"col0"};
0032 std::vector<ULong64_t> fCounter;
0033 std::vector<ULong64_t *> fCounterAddr;
0034 std::vector<void *> GetColumnReadersImpl(std::string_view name, const std::type_info &) final;
0035
0036 protected:
0037 std::string AsString() final { return "trivial data source"; };
0038
0039 public:
0040 RTrivialDS(ULong64_t size, bool skipEvenEntries = false);
0041
0042 RTrivialDS();
0043
0044 RTrivialDS(const RTrivialDS &) = delete;
0045 RTrivialDS &operator=(const RTrivialDS &) = delete;
0046 RTrivialDS(RTrivialDS &&) = delete;
0047 RTrivialDS &operator=(RTrivialDS &&) = delete;
0048 ~RTrivialDS() final = default;
0049
0050 const std::vector<std::string> &GetColumnNames() const final;
0051 bool HasColumn(std::string_view colName) const final;
0052 std::string GetTypeName(std::string_view) const final;
0053 std::vector<std::pair<ULong64_t, ULong64_t>> GetEntryRanges() final;
0054 bool SetEntry(unsigned int slot, ULong64_t entry) final;
0055 void SetNSlots(unsigned int nSlots) final;
0056 void Initialize() final;
0057 std::string GetLabel() final;
0058 };
0059
0060
0061
0062
0063
0064
0065 RInterface<RDFDetail::RLoopManager> MakeTrivialDataFrame(ULong64_t size, bool skipEvenEntries = false);
0066
0067 RInterface<RDFDetail::RLoopManager> MakeTrivialDataFrame();
0068
0069 }
0070
0071 }
0072
0073 #endif