20 std::uint16_t vSchemaMajor)
31 const auto &metaDesc =
fReader->GetDescriptor();
32 const auto &metaFieldIds = metaDesc.GetFieldZero().GetLinkIds();
36 std::to_string(metaFieldIds.size())));
39 const auto fieldId = metaFieldIds[i];
40 const auto &metaField = metaDesc.GetFieldDescriptor(fieldId);
48 for (
const auto fieldId : userFieldRoot.GetLinkIds()) {
49 const auto &fdesc = metaDesc.GetFieldDescriptor(fieldId);
50 auto userField =
RFieldBase::Create(fdesc.GetFieldName(), fdesc.GetTypeName()).Unwrap();
59 for (
auto i :
fReader->GetEntryRange()) {
60 auto start = entryRangeStartView(i);
61 auto len = entryRangeLenView(i);
66 [](
const auto &
a,
const auto &
b) { return a.first.GetStart() < b.first.GetStart(); });
73 return fReader->GetDescriptor();
92 const auto userFields = userRootField->GetMutableSubfields();
93 assert(entry.
fValues.size() == userFields.size());
94 for (std::size_t i = 0; i < userFields.size(); ++i) {
95 auto *field = userFields[i];
96 field->Read(index, entry.
fValues[i].GetPtr<
void>().get());
120 if (endEntry <= startEntry) {
122 <<
"empty range given when getting attributes from Attribute Set '" <<
GetDescriptor().GetName()
123 <<
"' (range given: [" << startEntry <<
", " << endEntry <<
")).";
137 if (endEntry <= startEntry) {
139 <<
"empty range given when getting attributes from Attribute Set '" <<
GetDescriptor().GetName()
140 <<
"' (range given: [" << startEntry <<
", " << endEntry <<
")).";
185 for (
auto it =
fCur; it !=
fEnd; ++it) {
186 const auto &[range, index] = *it;
187 const auto &firstLast = range.GetFirstLast();
193 const auto &[first, last] = *firstLast;
194 if (first >=
fFilter->fRange.GetEnd()) {
#define R__unlikely(expr)
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
#define R__LOG_WARNING(...)
decltype(std::declval< RNTupleAttrSetReader >().fEntryRanges.begin()) Iter_t
Iter_t SkipFiltered() const
bool FullyContained(RNTupleAttrRange range) const
std::optional< RFilter > fFilter
Iterable class used to loop over attribute entries.
A range of main entries referred to by an attribute entry.
static RNTupleAttrRange FromStartLength(ROOT::NTupleSize_t start, ROOT::NTupleSize_t length)
static RNTupleAttrRange FromStartEnd(ROOT::NTupleSize_t start, ROOT::NTupleSize_t end)
Creates an AttributeRange from [start, end), where end is one past the last valid entry of the range ...
ROOT::NTupleSize_t GetStart() const
Returns the beginning of the range.
ROOT::NTupleSize_t GetEnd() const
Returns one past the last valid index of the range, equal to GetStart() + GetLength().
RNTupleAttrEntryIterable GetAttributesInRange(NTupleSize_t startEntry, NTupleSize_t endEntry)
Returns all the attributes whose range is fully contained in [startEntry, endEntry).
std::unique_ptr< ROOT::RNTupleModel > fUserModel
The reconstructed user model.
const ROOT::RNTupleDescriptor & GetDescriptor() const
Returns the read-only descriptor of this attribute set.
std::unique_ptr< RNTupleReader > fReader
The internal Reader used to read the AttributeSet RNTuple.
RNTupleAttrSetReader(std::unique_ptr< RNTupleReader > reader, std::uint16_t vSchemaMajor)
RNTupleAttrEntryIterable GetAttributes()
Returns all the attributes in this Set. The returned attributes are sorted by entry range start.
friend class RNTupleAttrEntryIterable
std::vector< std::pair< RNTupleAttrRange, NTupleSize_t > > fEntryRanges
List containing pairs { entryRange, entryIndex }, used to quickly find out which entries in the Attri...
std::unique_ptr< REntry > CreateEntry()
Creates an entry suitable for use with LoadEntry.
RNTupleAttrEntryIterable GetAttributesContainingRange(NTupleSize_t startEntry, NTupleSize_t endEntry)
Returns all the attributes whose range fully contains [startEntry, endEntry).
RNTupleAttrRange LoadEntry(NTupleSize_t index)
Loads the attribute entry at position index into the default entry.
The REntry is a collection of values in an RNTuple corresponding to a complete row in the data set.
std::vector< ROOT::RFieldBase::RValue > fValues
Corresponds to the fields of the linked model.
std::uint64_t GetModelId() const
Base class for all ROOT issued exceptions.
std::vector< RFieldBase * > GetMutableSubfields()
static RResult< std::unique_ptr< RFieldBase > > Create(const std::string &fieldName, const std::string &typeName, const ROOT::RCreateFieldOptions &options, const ROOT::RNTupleDescriptor *desc, ROOT::DescriptorId_t fieldId)
Factory method to resurrect a field from the stored on-disk type information.
The on-storage metadata of an RNTuple.
The RNTupleModel encapulates the schema of an RNTuple.
REntry & GetDefaultEntry()
Retrieves the default entry of this model.
static std::unique_ptr< RNTupleModel > Create()
const std::uint16_t kSchemaVersionMajor
@ kMetaFieldIndex_RangeLen
@ kMetaFieldIndex_UserData
@ kMetaFieldIndex_RangeStart
constexpr const char * kMetaFieldNames[]
ROOT::RFieldZero & GetFieldZeroOfModel(RNTupleModel &model)
ROOT::RLogChannel & NTupleLog()
Log channel for RNTuple diagnostics.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.