Class used to read a RNTupleAttrSet in the context of a RNTupleReader.
An RNTupleAttrSetReader is created via RNTupleReader::OpenAttributeSet. Once created, it may outlive its parent Reader. Reading Attributes works similarly to reading regular RNTuple entries: you can either create entries or just use the AttrSetReader Model's default entry and load data into it via LoadEntry.
~~ {.cpp}
Assuming reader is a RNTupleReader: auto attrSet = reader->OpenAttributeSet("MyAttrSet");
Just like how you would read a regular RNTuple, first get the pointer to the fields you want to read: auto &attrEntry = attrSet->GetModel().GetDefaultEntry(); auto pAttr = attrEntry->GetPtr<std::string>("myAttr");
Then select which attributes you want to read. E.g. read all attributes linked to the entry at index 10: for (auto idx : attrSet->GetAttributes(10)) { attrSet->LoadEntry(idx); cout << "entry " << idx << " has attribute " << *pAttr << "\n"; } ~~
Definition at line 114 of file RNTupleAttrReading.hxx.
Public Member Functions | |
| RNTupleAttrSetReader (const RNTupleAttrSetReader &)=delete | |
| RNTupleAttrSetReader (RNTupleAttrSetReader &&)=default | |
| ~RNTupleAttrSetReader ()=default | |
| std::unique_ptr< REntry > | CreateEntry () |
| Creates an entry suitable for use with LoadEntry. | |
| RNTupleAttrEntryIterable | GetAttributes () |
| Returns all the attributes in this Set. The returned attributes are sorted by entry range start. | |
| RNTupleAttrEntryIterable | GetAttributes (NTupleSize_t entryIndex) |
Returns all the attributes whose range contains index entryIndex. | |
| RNTupleAttrEntryIterable | GetAttributesContainingRange (NTupleSize_t startEntry, NTupleSize_t endEntry) |
Returns all the attributes whose range fully contains [startEntry, endEntry) | |
| RNTupleAttrEntryIterable | GetAttributesInRange (NTupleSize_t startEntry, NTupleSize_t endEntry) |
Returns all the attributes whose range is fully contained in [startEntry, endEntry) | |
| const ROOT::RNTupleDescriptor & | GetDescriptor () const |
| Returns the read-only descriptor of this attribute set. | |
| const ROOT::RNTupleModel & | GetModel () const |
| Returns the read-only model of this attribute set. | |
| std::size_t | GetNEntries () const |
| Returns the number of all attribute entries in this attribute set. | |
| RNTupleAttrRange | LoadEntry (NTupleSize_t index) |
Loads the attribute entry at position index into the default entry. | |
| RNTupleAttrRange | LoadEntry (NTupleSize_t index, REntry &entry) |
Loads the attribute entry at position index into the given entry. | |
| RNTupleAttrSetReader & | operator= (const RNTupleAttrSetReader &)=delete |
| RNTupleAttrSetReader & | operator= (RNTupleAttrSetReader &&)=default |
Private Member Functions | |
| RNTupleAttrSetReader (std::unique_ptr< RNTupleReader > reader, std::uint16_t vSchemaMajor) | |
Private Attributes | |
| std::vector< std::pair< RNTupleAttrRange, NTupleSize_t > > | fEntryRanges |
| List containing pairs { entryRange, entryIndex }, used to quickly find out which entries in the Attribute RNTuple contain entries that overlap a given range. | |
| std::unique_ptr< RNTupleReader > | fReader |
| The internal Reader used to read the AttributeSet RNTuple. | |
| std::unique_ptr< ROOT::RNTupleModel > | fUserModel |
| The reconstructed user model. | |
Friends | |
| class | RNTupleAttrEntryIterable |
| class | ROOT::RNTupleReader |
#include <ROOT/RNTupleAttrReading.hxx>
|
private |
Definition at line 20 of file RNTupleAttrReading.cxx.
|
delete |
|
default |
|
default |
| std::unique_ptr< ROOT::REntry > ROOT::Experimental::RNTupleAttrSetReader::CreateEntry | ( | ) |
Creates an entry suitable for use with LoadEntry.
This is a convenience method equivalent to GetModel().CreateEntry().
Definition at line 112 of file RNTupleAttrReading.cxx.
| ROOT::Experimental::RNTupleAttrEntryIterable ROOT::Experimental::RNTupleAttrSetReader::GetAttributes | ( | ) |
Returns all the attributes in this Set. The returned attributes are sorted by entry range start.
Definition at line 159 of file RNTupleAttrReading.cxx.
| ROOT::Experimental::RNTupleAttrEntryIterable ROOT::Experimental::RNTupleAttrSetReader::GetAttributes | ( | NTupleSize_t | entryIndex | ) |
Returns all the attributes whose range contains index entryIndex.
Definition at line 152 of file RNTupleAttrReading.cxx.
| ROOT::Experimental::RNTupleAttrEntryIterable ROOT::Experimental::RNTupleAttrSetReader::GetAttributesContainingRange | ( | NTupleSize_t | startEntry, |
| NTupleSize_t | endEntry ) |
Returns all the attributes whose range fully contains [startEntry, endEntry)
Definition at line 118 of file RNTupleAttrReading.cxx.
| ROOT::Experimental::RNTupleAttrEntryIterable ROOT::Experimental::RNTupleAttrSetReader::GetAttributesInRange | ( | NTupleSize_t | startEntry, |
| NTupleSize_t | endEntry ) |
Returns all the attributes whose range is fully contained in [startEntry, endEntry)
Definition at line 135 of file RNTupleAttrReading.cxx.
| const ROOT::RNTupleDescriptor & ROOT::Experimental::RNTupleAttrSetReader::GetDescriptor | ( | ) | const |
Returns the read-only descriptor of this attribute set.
Definition at line 72 of file RNTupleAttrReading.cxx.
|
inline |
Returns the read-only model of this attribute set.
Definition at line 139 of file RNTupleAttrReading.hxx.
|
inline |
Returns the number of all attribute entries in this attribute set.
Definition at line 153 of file RNTupleAttrReading.hxx.
| ROOT::Experimental::RNTupleAttrRange ROOT::Experimental::RNTupleAttrSetReader::LoadEntry | ( | ROOT::NTupleSize_t | index | ) |
Loads the attribute entry at position index into the default entry.
Returns the range of main RNTuple entries that the loaded set of attributes refers to.
Definition at line 106 of file RNTupleAttrReading.cxx.
| ROOT::Experimental::RNTupleAttrRange ROOT::Experimental::RNTupleAttrSetReader::LoadEntry | ( | ROOT::NTupleSize_t | index, |
| REntry & | entry ) |
Loads the attribute entry at position index into the given entry.
Returns the range of main RNTuple entries that the loaded set of attributes refers to.
Definition at line 78 of file RNTupleAttrReading.cxx.
|
delete |
|
default |
|
friend |
Definition at line 116 of file RNTupleAttrReading.hxx.
|
friend |
Definition at line 115 of file RNTupleAttrReading.hxx.
|
private |
List containing pairs { entryRange, entryIndex }, used to quickly find out which entries in the Attribute RNTuple contain entries that overlap a given range.
The list is sorted by range start, i.e. entryRange.first.Start().
Definition at line 121 of file RNTupleAttrReading.hxx.
|
private |
The internal Reader used to read the AttributeSet RNTuple.
Definition at line 123 of file RNTupleAttrReading.hxx.
|
private |
The reconstructed user model.
Definition at line 125 of file RNTupleAttrReading.hxx.