Warning, file /include/root/ROOT/RTrivialDS.hxx was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_RTRIVIALDS
0012 #define ROOT_RTRIVIALDS
0013
0014 #include "ROOT/RDF/RInterface.hxx"
0015 #include "ROOT/RDataSource.hxx"
0016
0017 namespace ROOT::Internal::RDF {
0018 class R__CLING_PTRCHECK(off) RTrivialDSColumnReader final : public ROOT::Detail::RDF::RColumnReaderBase {
0019 ULong64_t *fValuePtr;
0020 void *GetImpl(Long64_t) final { return fValuePtr; }
0021
0022 public:
0023 RTrivialDSColumnReader(ULong64_t *valuePtr) : fValuePtr(valuePtr) {}
0024 };
0025 }
0026
0027 namespace ROOT {
0028
0029 namespace RDF {
0030
0031
0032
0033
0034
0035
0036 class RTrivialDS final : public ROOT::RDF::RDataSource {
0037 private:
0038 ULong64_t fSize = 0ULL;
0039 bool fSkipEvenEntries = false;
0040 std::vector<std::pair<ULong64_t, ULong64_t>> fEntryRanges;
0041 std::vector<std::string> fColNames{"col0"};
0042 std::vector<ULong64_t> fCounter;
0043 std::vector<ULong64_t *> fCounterAddr;
0044 std::vector<void *> GetColumnReadersImpl(std::string_view name, const std::type_info &) final;
0045
0046 protected:
0047 std::string AsString() final { return "trivial data source"; };
0048
0049 public:
0050 RTrivialDS(ULong64_t size, bool skipEvenEntries = false);
0051
0052 RTrivialDS();
0053
0054 RTrivialDS(const RTrivialDS &) = delete;
0055 RTrivialDS &operator=(const RTrivialDS &) = delete;
0056 RTrivialDS(RTrivialDS &&) = delete;
0057 RTrivialDS &operator=(RTrivialDS &&) = delete;
0058 ~RTrivialDS() final = default;
0059
0060 const std::vector<std::string> &GetColumnNames() const final;
0061 bool HasColumn(std::string_view colName) const final;
0062 std::string GetTypeName(std::string_view) const final;
0063 std::vector<std::pair<ULong64_t, ULong64_t>> GetEntryRanges() final;
0064 bool SetEntry(unsigned int slot, ULong64_t entry) final;
0065 void SetNSlots(unsigned int nSlots) final;
0066 void Initialize() final;
0067 std::string GetLabel() final;
0068
0069 std::unique_ptr<ROOT::Detail::RDF::RColumnReaderBase>
0070 GetColumnReaders(unsigned int slot, std::string_view colName, const std::type_info &tid) final;
0071 };
0072
0073
0074
0075
0076
0077
0078 RInterface<RDFDetail::RLoopManager> MakeTrivialDataFrame(ULong64_t size, bool skipEvenEntries = false);
0079
0080 RInterface<RDFDetail::RLoopManager> MakeTrivialDataFrame();
0081
0082 }
0083
0084 }
0085
0086 #endif