// Author: Enrico Guiraud, Danilo Piparo CERN 9/2017 /************************************************************************* * Copyright (C) 1995-2018, 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_RTRIVIALTDS #define ROOT_RTRIVIALTDS #include "ROOT/RDF/RInterface.hxx" #include "ROOT/RDataSource.hxx" namespace ROOT { namespace RDF { class RTrivialDS final : public ROOT::RDF::RDataSource { private: unsigned int fNSlots = 0U; ULong64_t fSize = 0ULL; bool fSkipEvenEntries = false; std::vector> fEntryRanges; std::vector fColNames{"col0"}; std::vector fCounter; std::vector fCounterAddr; std::vector GetColumnReadersImpl(std::string_view name, const std::type_info &); protected: std::string AsString() { return "trivial data source"; }; public: RTrivialDS(ULong64_t size, bool skipEvenEntries = false); ~RTrivialDS(); const std::vector &GetColumnNames() const; bool HasColumn(std::string_view colName) const; std::string GetTypeName(std::string_view) const; std::vector> GetEntryRanges(); bool SetEntry(unsigned int slot, ULong64_t entry); void SetNSlots(unsigned int nSlots); void Initialise(); std::string GetLabel(); }; RInterface MakeTrivialDataFrame(ULong64_t size, bool skipEvenEntries = false); } // ns RDF } // ns ROOT #endif