File indexing completed on 2025-01-18 10:10:48
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 unsigned int fNSlots = 0U;
0029 ULong64_t fSize = 0ULL;
0030 bool fSkipEvenEntries = false;
0031 std::vector<std::pair<ULong64_t, ULong64_t>> fEntryRanges;
0032 std::vector<std::string> fColNames{"col0"};
0033 std::vector<ULong64_t> fCounter;
0034 std::vector<ULong64_t *> fCounterAddr;
0035 std::vector<void *> GetColumnReadersImpl(std::string_view name, const std::type_info &) final;
0036
0037 protected:
0038 std::string AsString() final { return "trivial data source"; };
0039
0040 public:
0041 RTrivialDS(ULong64_t size, bool skipEvenEntries = false);
0042
0043 RTrivialDS();
0044 ~RTrivialDS();
0045 const std::vector<std::string> &GetColumnNames() const final;
0046 bool HasColumn(std::string_view colName) const final;
0047 std::string GetTypeName(std::string_view) const final;
0048 std::vector<std::pair<ULong64_t, ULong64_t>> GetEntryRanges() final;
0049 bool SetEntry(unsigned int slot, ULong64_t entry) final;
0050 void SetNSlots(unsigned int nSlots) final;
0051 void Initialize() final;
0052 std::string GetLabel() final;
0053 };
0054
0055
0056
0057
0058
0059
0060 RInterface<RDFDetail::RLoopManager> MakeTrivialDataFrame(ULong64_t size, bool skipEvenEntries = false);
0061
0062 RInterface<RDFDetail::RLoopManager> MakeTrivialDataFrame();
0063
0064 }
0065
0066 }
0067
0068 #endif