29namespace Experimental {
56 std::unique_ptr<RNTupleModel>
fModel;
61 explicit RNTuple(std::unique_ptr<RNTupleModel> model);
96 std::unique_ptr<Detail::RPageSource>
fSource;
100 class RIterator :
public std::iterator<std::forward_iterator_tag, NTupleSize_t> {
118 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<RNTupleModel> model,
124 RNTupleReader(std::unique_ptr<RNTupleModel> model, std::unique_ptr<Detail::RPageSource> source);
138 for (
auto& value : *entry) {
139 value.GetField()->Read(index, &value);
148 template <
typename T>
173 std::unique_ptr<Detail::RPageSink>
fSink;
178 static std::unique_ptr<RNTupleWriter>
Recreate(std::unique_ptr<RNTupleModel> model,
181 RNTupleWriter(std::unique_ptr<RNTupleModel> model, std::unique_ptr<Detail::RPageSink> sink);
191 for (
auto& value : *entry) {
192 value.GetField()->Append(value);
224 for (
auto& treeValue : *entry) {
225 treeValue.GetField()->Append(treeValue);
RNTuple & operator=(const RNTuple &)=delete
NTupleSize_t fNEntries
The number of entries is constant for reading and reflects the sum of Fill() operations when writing.
RNTupleModel * GetModel()
RNTuple(const RNTuple &)=delete
RNTuple(std::unique_ptr< RNTupleModel > model)
Only the derived RNTupleReader and RNTupleWriter can be instantiated.
std::unique_ptr< RNTupleModel > fModel
A virtual ntuple for collections that can be used to some extent like a real ntuple.
ClusterSize_t * GetOffsetPtr()
RCollectionNTuple(std::unique_ptr< REntry > defaultEntry)
RCollectionNTuple(const RCollectionNTuple &)=delete
std::unique_ptr< REntry > fDefaultEntry
~RCollectionNTuple()=default
RCollectionNTuple & operator=(const RCollectionNTuple &)=delete
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
The RNTupleModel encapulates the schema of an ntuple.
bool operator!=(const iterator &rh) const
bool operator==(const iterator &rh) const
RIterator(NTupleSize_t index)
An RNTuple that is used to read data from storage.
static std::unique_ptr< RNTupleReader > Open(std::unique_ptr< RNTupleModel > model, std::string_view ntupleName, std::string_view storage)
RNTupleViewRange GetViewRange()
void LoadEntry(NTupleSize_t index, REntry *entry)
Fills a user provided entry after checking that the entry has been instantiated from the ntuple model...
NTupleSize_t GetNEntries()
RNTupleView< T > GetView(std::string_view fieldName)
Provides access to an individual field that can contain either a skalar value or a collection,...
std::unique_ptr< Detail::RPageSource > fSource
RNTupleReader(std::unique_ptr< RNTupleModel > model, std::unique_ptr< Detail::RPageSource > source)
The user imposes an ntuple model, which must be compatible with the model found in the data on storag...
RNTupleViewCollection GetViewCollection(std::string_view fieldName)
void LoadEntry(NTupleSize_t index)
Analogous to Fill(), fills the default entry of the model.
std::string GetInfo(const ENTupleInfo what=ENTupleInfo::kSummary)
A view for a collection, that can itself generate new ntuple views for its nested fields.
Used to loop over indexes (entries or collections) between start and end.
An RNTupleView provides read-only access to a single field of the ntuple.
An RNTuple that gets filled with entries (data) and writes them to storage.
void Fill(REntry *entry)
Multiple entries can have been instantiated from the tnuple model.
void CommitCluster()
Ensure that the data from the so far seen Fill calls has been written to storage.
RNTupleWriter(std::unique_ptr< RNTupleModel > model, std::unique_ptr< Detail::RPageSink > sink)
static std::unique_ptr< RNTupleWriter > Recreate(std::unique_ptr< RNTupleModel > model, std::string_view ntupleName, std::string_view storage)
NTupleSize_t fLastCommitted
static constexpr NTupleSize_t kDefaultClusterSizeEntries
RNTupleWriter(const RNTupleWriter &)=delete
RNTupleWriter & operator=(const RNTupleWriter &)=delete
std::unique_ptr< Detail::RPageSink > fSink
void Fill()
The simplest user interface if the default entry that comes with the ntuple model is used.
NTupleSize_t fClusterSizeEntries
basic_string_view< char > string_view
ENTupleInfo
Listing of the different options that can be returned by RNTupleReader::GetInfo()
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr NTupleSize_t kInvalidNTupleIndex
Namespace for new ROOT classes and functions.
Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t...