/// \file RNTupleDS.hxx /// \ingroup NTuple ROOT7 /// \author Jakob Blomer /// \date 2018-10-04 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback /// is welcome! /************************************************************************* * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_RNTupleDS #define ROOT_RNTupleDS #include #include #include #include #include #include #include namespace ROOT { namespace Experimental { class RNTupleReader; class REntry; class RNTupleDS final : public ROOT::RDF::RDataSource { /// Clones of the first reader, one for each slot std::vector> fReaders; std::vector> fEntries; /// The raw pointers wrapped by the RValue items of fEntries std::vector> fValuePtrs; unsigned fNSlots = 0; bool fHasSeenAllRanges = false; std::vector fColumnNames; std::vector fColumnTypes; public: explicit RNTupleDS(std::unique_ptr ntuple); ~RNTupleDS() = default; void SetNSlots(unsigned int nSlots) final; const std::vector &GetColumnNames() const final; bool HasColumn(std::string_view colName) const final; std::string GetTypeName(std::string_view colName) const final; std::vector> GetEntryRanges() final; bool SetEntry(unsigned int slot, ULong64_t entry) final; void Initialise() final; protected: Record_t GetColumnReadersImpl(std::string_view name, const std::type_info &) final; }; RDataFrame MakeNTupleDataFrame(std::string_view ntupleName, std::string_view fileName); } // ns Experimental } // ns ROOT #endif