37 static std::string gEmpty;
76 clone.
fStringPool = std::make_unique<Internal::RStringPool>();
81std::unique_ptr<ROOT::RFieldBase>
85 auto streamerField = std::make_unique<ROOT::RStreamerField>(GetFieldName(), GetTypeName());
88 R__FAIL(
"streamer field " + GetFieldName() +
" has an emulated class but emulation is turned off"));
90 streamerField->SetOnDiskId(fFieldId);
98 auto invalidField = std::make_unique<ROOT::RInvalidField>(GetFieldName(), GetTypeName(),
"",
100 invalidField->SetOnDiskId(fFieldId);
103 throw RException(
R__FAIL(
"unexpected on-disk field structure value for field \"" + GetFieldName() +
"\""));
108 if (GetTypeName().empty()) {
109 switch (GetStructure()) {
111 std::vector<std::unique_ptr<ROOT::RFieldBase>> memberFields;
112 memberFields.reserve(fLinkIds.size());
113 for (
auto id : fLinkIds) {
115 auto field = memberDesc.
CreateField(ntplDesc, options);
118 memberFields.emplace_back(std::move(field));
120 auto recordField = std::make_unique<ROOT::RRecordField>(GetFieldName(), std::move(memberFields));
121 recordField->SetOnDiskId(fFieldId);
125 if (fLinkIds.size() != 1) {
126 throw RException(
R__FAIL(
"unsupported untyped collection for field \"" + GetFieldName() +
"\""));
132 collectionField->SetOnDiskId(fFieldId);
133 return collectionField;
135 default:
throw RException(
R__FAIL(
"unsupported untyped field structure for field \"" + GetFieldName() +
"\""));
140 const auto &fieldName = GetFieldName();
141 const auto &typeName = GetTypeAlias().empty() ? GetTypeName() : GetTypeAlias();
146 field->SetOnDiskId(fFieldId);
148 for (
auto &subfield : *field) {
149 const auto subfieldId = ntplDesc.
FindFieldId(subfield.GetFieldName(), subfield.GetParent()->GetOnDiskId());
150 subfield.SetOnDiskId(subfieldId);
154 return invalidField.
Clone(fieldName);
161 return std::make_unique<ROOT::RInvalidField>(GetFieldName(), GetTypeName(),
ex.what(),
190 clone.
fValueRange = std::make_unique<RValueRange>(*fValueRange);
199 if (!fCumulativeNElements) {
203 for (
const auto &pi : fPageInfos) {
204 if (firstInPage + pi.GetNElements() > idxInCluster) {
213 const auto N = fCumulativeNElements->size();
217 std::size_t left = 0;
218 std::size_t right =
N - 1;
219 std::size_t midpoint =
N;
220 while (left <= right) {
221 midpoint = (left + right) / 2;
222 if ((*fCumulativeNElements)[midpoint] <= idxInCluster) {
227 if ((midpoint == 0) || ((*fCumulativeNElements)[midpoint - 1] <= idxInCluster))
230 right = midpoint - 1;
234 auto pageInfo = fPageInfos[midpoint];
235 decltype(idxInCluster) firstInPage = (midpoint == 0) ? 0 : (*fCumulativeNElements)[midpoint - 1];
237 R__ASSERT((firstInPage + pageInfo.GetNElements()) > idxInCluster);
244 std::size_t pageSize)
249 const auto nElements =
250 std::accumulate(fPageInfos.begin(), fPageInfos.end(), 0U,
251 [](std::size_t
n,
const auto &pageInfo) { return n + pageInfo.GetNElements(); });
252 const auto nElementsRequired =
static_cast<std::uint64_t
>(columnRange.
GetNElements());
254 if (nElementsRequired == nElements)
256 R__ASSERT((nElementsRequired > nElements) &&
"invalid attempt to shrink RPageRange");
258 std::vector<RPageInfo> pageInfos;
260 const std::uint64_t nElementsPerPage = pageSize / element.
GetSize();
262 for (
auto nRemainingElements = nElementsRequired - nElements; nRemainingElements > 0;) {
264 pageInfo.
SetNElements(std::min(nElementsPerPage, nRemainingElements));
269 pageInfos.emplace_back(pageInfo);
273 pageInfos.insert(pageInfos.end(), std::make_move_iterator(fPageInfos.begin()),
274 std::make_move_iterator(fPageInfos.end()));
275 std::swap(fPageInfos, pageInfos);
276 return nElementsRequired - nElements;
287 std::uint64_t nbytes = 0;
288 for (
const auto &pr : fPageRanges) {
289 for (
const auto &pi : pr.second.GetPageInfos()) {
290 nbytes += pi.GetLocator().GetNBytesOnStorage();
303 for (
const auto &
d : fPageRanges)
337 return fName == other.
fName &&
352 for (
const auto &cd : fClusterDescriptors) {
353 if (!cd.second.ContainsColumn(physicalColumnId))
355 auto columnRange = cd.second.GetColumnRange(physicalColumnId);
356 result = std::max(
result, columnRange.GetFirstElementIndex() + columnRange.GetNElements());
363std::vector<ROOT::Internal::RNTupleClusterBoundaries>
366 std::vector<Internal::RNTupleClusterBoundaries> boundaries;
370 R__ASSERT(clusterDesc.GetNEntries() > 0);
372 clusterDesc.GetFirstEntryIndex(), clusterDesc.GetFirstEntryIndex() + clusterDesc.GetNEntries()});
380 std::string leafName(fieldName);
381 auto posDot = leafName.find_last_of(
'.');
382 if (posDot != std::string::npos) {
383 auto parentName = leafName.substr(0, posDot);
384 leafName = leafName.substr(posDot + 1);
385 parentId = FindFieldId(parentName, parentId);
387 auto itrFieldDesc = fFieldDescriptors.find(parentId);
388 if (itrFieldDesc == fFieldDescriptors.end())
390 for (
const auto linkId : itrFieldDesc->second.GetLinkIds()) {
391 if (fFieldDescriptors.at(linkId).GetFieldName() == leafName)
402 const auto &fieldDescriptor = fFieldDescriptors.at(fieldId);
403 auto prefix = GetQualifiedFieldName(fieldDescriptor.GetParentId());
405 return fieldDescriptor.GetFieldName();
406 return prefix +
"." + fieldDescriptor.GetFieldName();
412 return fVersionMajor == 0 && fVersionMinor == 0 && fVersionPatch < 1;
419 if (FieldTypeNamesMayNeedFixup()) {
428 return FindFieldId(fieldName, GetFieldZeroId());
432 std::uint32_t columnIndex,
433 std::uint16_t representationIndex)
const
435 auto itr = fFieldDescriptors.find(fieldId);
436 if (itr == fFieldDescriptors.cend())
438 if (columnIndex >= itr->second.GetColumnCardinality())
440 const auto idx = representationIndex * itr->second.GetColumnCardinality() + columnIndex;
441 if (itr->second.GetLogicalColumnIds().size() <= idx)
443 return itr->second.GetLogicalColumnIds()[idx];
447 std::uint32_t columnIndex,
448 std::uint16_t representationIndex)
const
450 auto logicalId = FindLogicalColumnId(fieldId, columnIndex, representationIndex);
453 return GetColumnDescriptor(logicalId).GetPhysicalId();
459 if (GetNClusterGroups() == 0)
464 std::size_t cgLeft = 0;
465 std::size_t cgRight = GetNClusterGroups() - 1;
466 while (cgLeft <= cgRight) {
467 const std::size_t cgMidpoint = (cgLeft + cgRight) / 2;
468 const auto &clusterIds = GetClusterGroupDescriptor(fSortedClusterGroupIds[cgMidpoint]).GetClusterIds();
471 const auto &clusterDesc = GetClusterDescriptor(clusterIds.front());
473 if (!clusterDesc.ContainsColumn(physicalColumnId))
476 const auto firstElementInGroup = clusterDesc.GetColumnRange(physicalColumnId).GetFirstElementIndex();
477 if (firstElementInGroup >
index) {
480 cgRight = cgMidpoint - 1;
484 const auto &lastColumnRange = GetClusterDescriptor(clusterIds.back()).GetColumnRange(physicalColumnId);
485 if ((lastColumnRange.GetFirstElementIndex() + lastColumnRange.GetNElements()) <=
index) {
487 cgLeft = cgMidpoint + 1;
493 std::size_t clusterLeft = 0;
494 std::size_t clusterRight = clusterIds.size() - 1;
495 while (clusterLeft <= clusterRight) {
496 const std::size_t clusterMidpoint = (clusterLeft + clusterRight) / 2;
497 const auto clusterId = clusterIds[clusterMidpoint];
498 const auto &columnRange = GetClusterDescriptor(clusterId).GetColumnRange(physicalColumnId);
500 if (columnRange.Contains(
index))
503 if (columnRange.GetFirstElementIndex() >
index) {
505 clusterRight = clusterMidpoint - 1;
509 if (columnRange.GetFirstElementIndex() + columnRange.GetNElements() <=
index) {
510 clusterLeft = clusterMidpoint + 1;
521 if (GetNClusterGroups() == 0)
526 std::size_t cgLeft = 0;
527 std::size_t cgRight = GetNClusterGroups() - 1;
528 while (cgLeft <= cgRight) {
529 const std::size_t cgMidpoint = (cgLeft + cgRight) / 2;
530 const auto &cgDesc = GetClusterGroupDescriptor(fSortedClusterGroupIds[cgMidpoint]);
532 if (cgDesc.GetMinEntry() > entryIdx) {
534 cgRight = cgMidpoint - 1;
538 if (cgDesc.GetMinEntry() + cgDesc.GetEntrySpan() <= entryIdx) {
539 cgLeft = cgMidpoint + 1;
545 const auto &clusterIds = cgDesc.GetClusterIds();
547 std::size_t clusterLeft = 0;
548 std::size_t clusterRight = clusterIds.size() - 1;
549 while (clusterLeft <= clusterRight) {
550 const std::size_t clusterMidpoint = (clusterLeft + clusterRight) / 2;
551 const auto &clusterDesc = GetClusterDescriptor(clusterIds[clusterMidpoint]);
553 if (clusterDesc.GetFirstEntryIndex() > entryIdx) {
555 clusterRight = clusterMidpoint - 1;
559 if (clusterDesc.GetFirstEntryIndex() + clusterDesc.GetNEntries() <= entryIdx) {
560 clusterLeft = clusterMidpoint + 1;
564 return clusterIds[clusterMidpoint];
577 const auto &clusterDesc = GetClusterDescriptor(clusterId);
578 const auto firstEntryInNextCluster = clusterDesc.GetFirstEntryIndex() + clusterDesc.GetNEntries();
579 return FindClusterId(firstEntryInNextCluster);
588 const auto &clusterDesc = GetClusterDescriptor(clusterId);
589 if (clusterDesc.GetFirstEntryIndex() == 0)
591 return FindClusterId(clusterDesc.GetFirstEntryIndex() - 1);
594std::vector<ROOT::DescriptorId_t>
597 std::vector<ROOT::DescriptorId_t> fields;
598 for (
const auto fieldId : fFieldIdsOrder) {
600 fields.emplace_back(fieldId);
607 : fNTuple(ntuple), fColumns(field.GetLogicalColumnIds())
614 std::deque<ROOT::DescriptorId_t> fieldIdQueue{ntuple.
GetFieldZeroId()};
616 while (!fieldIdQueue.empty()) {
617 auto currFieldId = fieldIdQueue.front();
618 fieldIdQueue.pop_front();
624 auto fieldId = field.GetId();
625 fieldIdQueue.push_back(fieldId);
632 std::vector<std::uint64_t>
result;
633 unsigned int base = 0;
634 std::uint64_t flags = 0;
636 if ((
f > 0) && ((
f % 64) == 0))
638 while (
f > base + 64) {
639 result.emplace_back(flags);
647 flags |= std::uint64_t(1) <<
f;
649 result.emplace_back(flags);
654 std::vector<RClusterDescriptor> &clusterDescs)
658 return R__FAIL(
"invalid attempt to add details of unknown cluster group");
659 if (iter->second.HasClusterDetails())
660 return R__FAIL(
"invalid attempt to re-populate cluster group details");
661 if (iter->second.GetNClusters() != clusterDescs.size())
662 return R__FAIL(
"mismatch of number of clusters");
664 std::vector<ROOT::DescriptorId_t> clusterIds;
665 for (
unsigned i = 0; i < clusterDescs.size(); ++i) {
666 clusterIds.emplace_back(clusterDescs[i].GetId());
669 return R__FAIL(
"invalid attempt to re-populate existing cluster");
673 return fClusterDescriptors[a].GetFirstEntryIndex() < fClusterDescriptors[b].GetFirstEntryIndex();
676 cgBuilder.AddSortedClusters(clusterIds);
677 iter->second = cgBuilder.MoveDescriptor().Unwrap();
685 return R__FAIL(
"invalid attempt to drop cluster details of unknown cluster group");
686 if (!iter->second.HasClusterDetails())
687 return R__FAIL(
"invalid attempt to drop details of cluster group summary");
689 for (
auto clusterId : iter->second.GetClusterIds())
691 iter->second = iter->second.CloneSummary();
699 std::unordered_set<ROOT::DescriptorId_t> invalidFields;
702 auto fieldId = colDesc.GetFieldId();
707 fieldId = field.GetParentId();
709 invalidFields.insert(fieldId);
719 "cannot create Model: descriptor contains unknown column types. Use 'SetForwardCompatible(true)' on the "
720 "RCreateModelOptions to create a partial model containing only the fields made up by known columns."));
722 auto fieldZero = std::make_unique<ROOT::RFieldZero>();
730 if (invalidFields.count(topDesc.GetId()) > 0) {
735 auto field = topDesc.CreateField(*
this, createFieldOpts);
742 const auto &invalid =
static_cast<const RInvalidField &
>(*field);
753 model->AddProjectedField(std::move(field), [
this](
const std::string &targetName) -> std::string {
757 model->AddField(std::move(field));
777 shareStringPool =
false;
866 std::uint64_t firstElementIndex,
867 std::uint32_t compressionSettings,
871 return R__FAIL(
"column ID mismatch");
872 if (fCluster.fColumnRanges.count(physicalId) > 0)
873 return R__FAIL(
"column ID conflict");
878 fCluster.fPageRanges[physicalId] = pageRange.
Clone();
879 fCluster.fColumnRanges[physicalId] = columnRange;
886 if (fCluster.fColumnRanges.count(physicalId) > 0)
887 return R__FAIL(
"column ID conflict");
892 fCluster.fColumnRanges[physicalId] = columnRange;
899 for (
auto &[
_, columnRange] : fCluster.fColumnRanges) {
900 if (!columnRange.IsSuppressed())
907 for (
const auto otherColumnLogicalId : fieldDesc.GetLogicalColumnIds()) {
909 if (otherColumnDesc.GetRepresentationIndex() == columnDesc.GetRepresentationIndex())
911 if (otherColumnDesc.GetIndex() != columnDesc.GetIndex())
915 const auto &otherColumnRange = fCluster.GetColumnRange(otherColumnDesc.GetPhysicalId());
916 if (otherColumnRange.IsSuppressed())
919 columnRange.SetFirstElementIndex(otherColumnRange.GetFirstElementIndex());
920 columnRange.SetNElements(otherColumnRange.GetNElements());
925 return R__FAIL(std::string(
"cannot find non-suppressed column for column ID ") +
926 std::to_string(columnRange.GetPhysicalColumnId()) +
927 ", cluster ID: " + std::to_string(fCluster.GetId()));
939 auto fnTraverseSubtree = [&](
ROOT::DescriptorId_t rootFieldId, std::uint64_t nRepetitionsAtThisLevel,
940 const auto &visitField,
const auto &enterSubtree) ->
void {
941 visitField(rootFieldId, nRepetitionsAtThisLevel);
943 const std::uint64_t nRepetitions = std::max(
f.GetNRepetitions(), std::uint64_t{1U}) * nRepetitionsAtThisLevel;
944 enterSubtree(
f.GetId(), nRepetitions, visitField, enterSubtree);
956 topLevelField.GetId(), std::max(topLevelField.GetNRepetitions(), std::uint64_t{1U}),
958 for (const auto &c : desc.GetColumnIterable(fieldId)) {
959 const ROOT::DescriptorId_t physicalId = c.GetPhysicalId();
960 auto &columnRange = fCluster.fColumnRanges[physicalId];
965 if (columnRange.GetPhysicalColumnId() == ROOT::kInvalidDescriptorId) {
966 columnRange.SetPhysicalColumnId(physicalId);
967 columnRange.SetFirstElementIndex(0);
968 columnRange.SetNElements(0);
969 columnRange.SetIsSuppressed(c.IsSuppressedDeferredColumn());
974 if (c.IsDeferredColumn()) {
975 if (c.GetRepresentationIndex() == 0) {
980 columnRange.SetFirstElementIndex(fCluster.GetFirstEntryIndex() * nRepetitions);
981 columnRange.SetNElements(fCluster.GetNEntries() * nRepetitions);
988 const auto &field = desc.GetFieldDescriptor(fieldId);
989 const auto firstReprColumnId = field.GetLogicalColumnIds()[c.GetIndex()];
990 const auto &firstReprColumnRange = fCluster.fColumnRanges[firstReprColumnId];
991 columnRange.SetFirstElementIndex(firstReprColumnRange.GetFirstElementIndex());
992 columnRange.SetNElements(firstReprColumnRange.GetNElements());
994 if (!columnRange.IsSuppressed()) {
995 auto &pageRange = fCluster.fPageRanges[physicalId];
996 pageRange.fPhysicalColumnId = physicalId;
997 const auto element = ROOT::Internal::RColumnElementBase::Generate<void>(c.GetType());
998 pageRange.ExtendToFitColumnRange(columnRange, *element, ROOT::Internal::RPage::kPageZeroSize);
1000 } else if (!columnRange.IsSuppressed()) {
1001 fCluster.fPageRanges[physicalId].fPhysicalColumnId = physicalId;
1013 return R__FAIL(
"unset cluster ID");
1014 if (fCluster.fNEntries == 0)
1015 return R__FAIL(
"empty cluster");
1016 for (
auto &pr : fCluster.fPageRanges) {
1017 if (fCluster.fColumnRanges.count(pr.first) == 0) {
1018 return R__FAIL(
"missing column range");
1020 pr.second.fCumulativeNElements.reset();
1021 const auto nPages = pr.second.fPageInfos.size();
1023 pr.second.fCumulativeNElements = std::make_unique<std::vector<NTupleSize_t>>();
1024 pr.second.fCumulativeNElements->reserve(nPages);
1026 for (
const auto &pi : pr.second.fPageInfos) {
1027 sum += pi.GetNElements();
1028 pr.second.fCumulativeNElements->emplace_back(
sum);
1033 std::swap(
result, fCluster);
1055 return R__FAIL(
"unset cluster group ID");
1057 std::swap(
result, fClusterGroup);
1068 std::swap(
result, fExtraTypeInfo);
1076 if (fDescriptor.fFieldDescriptors.count(fieldId) == 0)
1077 return R__FAIL(
"field with id '" + std::to_string(fieldId) +
"' doesn't exist");
1084 return R__FAIL(
"unset or unsupported RNTuple epoch version");
1093 for (
const auto &[fieldId, fieldDesc] : fDescriptor.fFieldDescriptors) {
1096 return R__FAIL(
"field with id '" + std::to_string(fieldId) +
"' has an invalid parent id");
1100 const auto columnCardinality = fieldDesc.GetColumnCardinality();
1101 if (columnCardinality == 0)
1106 const auto &logicalColumnIds = fieldDesc.GetLogicalColumnIds();
1107 const auto nColumns = logicalColumnIds.size();
1109 if ((nColumns + 1) == columnCardinality)
1112 const auto &lastColumn = fDescriptor.GetColumnDescriptor(logicalColumnIds.back());
1113 if (lastColumn.GetIndex() + 1 != columnCardinality)
1114 return R__FAIL(
"field with id '" + std::to_string(fieldId) +
"' has incomplete column representations");
1122 EnsureValidDescriptor().ThrowOnError();
1124 for (
const auto &[
id,
_] : fDescriptor.fClusterGroupDescriptors)
1125 fDescriptor.fSortedClusterGroupIds.emplace_back(
id);
1126 std::sort(fDescriptor.fSortedClusterGroupIds.begin(), fDescriptor.fSortedClusterGroupIds.end(),
1128 return fDescriptor.fClusterGroupDescriptors[a].GetMinEntry() <
1129 fDescriptor.fClusterGroupDescriptors[b].GetMinEntry();
1131 fDescriptor.fStringPool->Freeze();
1133 std::swap(
result, fDescriptor);
1138 std::uint16_t versionMinor, std::uint16_t versionPatch)
1141 throw RException(
R__FAIL(
"unsupported RNTuple epoch version: " + std::to_string(versionEpoch)));
1143 fDescriptor.fVersionEpoch = versionEpoch;
1144 fDescriptor.fVersionMajor = versionMajor;
1145 fDescriptor.fVersionMinor = versionMinor;
1146 fDescriptor.fVersionPatch = versionPatch;
1159 fDescriptor.fName = std::string(
name);
1160 fDescriptor.fDescription = std::string(description);
1165 if (flag > 0 && flag % 64 == 0)
1167 fDescriptor.fFeatureFlags.insert(flag);
1173 if (fDesc.fName.empty())
1174 return R__FAIL(
"attribute set name cannot be empty");
1175 if (fDesc.fAnchorLength == 0)
1176 return R__FAIL(
"invalid anchor length");
1178 return R__FAIL(
"invalid locator type");
1180 return std::move(fDesc);
1186 return R__FAIL(
"invalid logical column id");
1188 return R__FAIL(
"invalid physical column id");
1190 return R__FAIL(
"invalid field id, dangling column");
1199 if (fColumn.GetBitsOnStorage() < minBits || fColumn.GetBitsOnStorage() > maxBits)
1200 return R__FAIL(
"invalid column bit width");
1204 std::swap(
result, fColumn);
1212 clone.
InitFrom(source, stringPool);
1219 return R__FAIL(
"invalid field id");
1222 return R__FAIL(
"invalid field structure");
1225 return R__FAIL(
"invalid SoA flag on non-collection field");
1233 if (fField.GetFieldName().empty()) {
1234 return R__FAIL(
"name cannot be empty string \"\"");
1239 std::swap(
result, fField);
1266 const auto id = fieldDesc.
GetId();
1267 if (fDescriptor.fHeaderExtension)
1268 fDescriptor.fHeaderExtension->MarkExtendedField(fieldDesc);
1270 fDescriptor.fFieldZeroId =
id;
1273 fDescriptor.fFieldDescriptors.emplace(
id, std::move(fieldDesc));
1280 if (!(fieldExists = EnsureFieldExists(fieldId)))
1282 if (!(fieldExists = EnsureFieldExists(linkId)))
1283 return R__FAIL(
"child field with id '" + std::to_string(linkId) +
"' doesn't exist in NTuple");
1285 if (linkId == fDescriptor.GetFieldZeroId()) {
1286 return R__FAIL(
"cannot make FieldZero a child field");
1289 auto parentId = fDescriptor.fFieldDescriptors.at(linkId).GetParentId();
1291 return R__FAIL(
"field '" + std::to_string(linkId) +
"' already has a parent ('" + std::to_string(parentId) +
")");
1293 if (fieldId == linkId) {
1294 return R__FAIL(
"cannot make field '" + std::to_string(fieldId) +
"' a child of itself");
1296 fDescriptor.fFieldDescriptors.at(linkId).fParentId = fieldId;
1297 fDescriptor.fFieldDescriptors.at(fieldId).fLinkIds.push_back(linkId);
1305 if (!(fieldExists = EnsureFieldExists(sourceId)))
1307 if (!(fieldExists = EnsureFieldExists(targetId)))
1308 return R__FAIL(
"projected field with id '" + std::to_string(targetId) +
"' doesn't exist in NTuple");
1310 if (targetId == fDescriptor.GetFieldZeroId()) {
1311 return R__FAIL(
"cannot make FieldZero a projected field");
1313 if (sourceId == targetId) {
1314 return R__FAIL(
"cannot make field '" + std::to_string(targetId) +
"' a projection of itself");
1316 if (fDescriptor.fFieldDescriptors.at(sourceId).IsProjectedField()) {
1317 return R__FAIL(
"cannot make field '" + std::to_string(targetId) +
"' a projection of an already projected field");
1320 auto &targetDesc = fDescriptor.fFieldDescriptors.at(targetId);
1321 if (targetDesc.IsProjectedField() && targetDesc.GetProjectionSourceId() != sourceId) {
1322 return R__FAIL(
"field '" + std::to_string(targetId) +
"' has already a projection source ('" +
1323 std::to_string(targetDesc.GetProjectionSourceId()) +
")");
1325 fDescriptor.fFieldDescriptors.at(targetId).fProjectionSourceId = sourceId;
1331 const auto fieldId = columnDesc.GetFieldId();
1332 const auto columnIndex = columnDesc.GetIndex();
1333 const auto representationIndex = columnDesc.GetRepresentationIndex();
1335 auto fieldExists = EnsureFieldExists(fieldId);
1339 auto &fieldDesc = fDescriptor.fFieldDescriptors.find(fieldId)->second;
1341 if (columnDesc.IsAliasColumn()) {
1342 if (columnDesc.GetType() != fDescriptor.GetColumnDescriptor(columnDesc.GetPhysicalId()).GetType())
1343 return R__FAIL(
"alias column type mismatch");
1346 return R__FAIL(
"column index clash");
1348 if (columnIndex > 0) {
1350 return R__FAIL(
"out of bounds column index");
1352 if (representationIndex > 0) {
1354 return R__FAIL(
"out of bounds representation index");
1356 if (columnIndex == 0) {
1357 assert(fieldDesc.fColumnCardinality > 0);
1358 if (fDescriptor.FindLogicalColumnId(fieldId, fieldDesc.fColumnCardinality - 1, representationIndex - 1) ==
1360 return R__FAIL(
"incomplete column representations");
1363 if (columnIndex >= fieldDesc.fColumnCardinality)
1364 return R__FAIL(
"irregular column representations");
1368 fieldDesc.fColumnCardinality = columnIndex + 1;
1371 const auto logicalId = columnDesc.GetLogicalId();
1372 fieldDesc.fLogicalColumnIds.emplace_back(logicalId);
1374 if (!columnDesc.IsAliasColumn())
1375 fDescriptor.fNPhysicalColumns++;
1376 if (fDescriptor.fHeaderExtension)
1377 fDescriptor.fHeaderExtension->MarkExtendedColumn(columnDesc);
1378 fDescriptor.fColumnDescriptors.emplace(logicalId, std::move(columnDesc));
1385 const auto id = clusterGroup.GetId();
1386 if (fDescriptor.fClusterGroupDescriptors.count(
id) > 0)
1387 return R__FAIL(
"cluster group id clash");
1388 fDescriptor.fNEntries = std::max(fDescriptor.fNEntries, clusterGroup.GetMinEntry() + clusterGroup.GetEntrySpan());
1389 fDescriptor.fNClusters += clusterGroup.GetNClusters();
1390 fDescriptor.fClusterGroupDescriptors.emplace(
id, std::move(clusterGroup));
1402 if (!fDescriptor.fHeaderExtension)
1403 fDescriptor.fHeaderExtension = std::make_unique<RNTupleDescriptor::RHeaderExtension>();
1408 if (fDescriptor.GetNLogicalColumns() == 0)
1410 R__ASSERT(fDescriptor.GetNPhysicalColumns() > 0);
1412 for (
ROOT::DescriptorId_t id = fDescriptor.GetNLogicalColumns() - 1;
id >= fDescriptor.GetNPhysicalColumns(); --
id) {
1413 auto c = fDescriptor.fColumnDescriptors[
id].Clone();
1416 fDescriptor.fColumnDescriptors.erase(
id);
1417 for (
auto &link : fDescriptor.fFieldDescriptors[
c.fFieldId].fLogicalColumnIds) {
1418 if (link ==
c.fLogicalColumnId) {
1424 R__ASSERT(fDescriptor.fColumnDescriptors.count(
c.fLogicalColumnId) == 0);
1425 fDescriptor.fColumnDescriptors.emplace(
c.fLogicalColumnId, std::move(
c));
1429 if (
auto &xHeader = fDescriptor.fHeaderExtension) {
1430 for (
auto &columnId : xHeader->fExtendedColumnRepresentations) {
1431 if (columnId >= fDescriptor.GetNPhysicalColumns())
1439 auto clusterId = clusterDesc.GetId();
1440 if (fDescriptor.fClusterDescriptors.count(clusterId) > 0)
1441 return R__FAIL(
"cluster id clash");
1442 fDescriptor.fClusterDescriptors.emplace(clusterId, std::move(clusterDesc));
1450 if (std::find(fDescriptor.fExtraTypeInfoDescriptors.begin(), fDescriptor.fExtraTypeInfoDescriptors.end(),
1451 extraTypeInfoDesc) != fDescriptor.fExtraTypeInfoDescriptors.end()) {
1452 return R__FAIL(
"extra type info duplicates");
1454 fDescriptor.fExtraTypeInfoDescriptors.emplace_back(std::move(extraTypeInfoDesc));
1460 auto it = std::find(fDescriptor.fExtraTypeInfoDescriptors.begin(), fDescriptor.fExtraTypeInfoDescriptors.end(),
1462 if (it != fDescriptor.fExtraTypeInfoDescriptors.end())
1463 *it = std::move(extraTypeInfoDesc);
1465 fDescriptor.fExtraTypeInfoDescriptors.emplace_back(std::move(extraTypeInfoDesc));
1471 auto &attrSets = fDescriptor.fAttributeSets;
1472 if (std::find_if(attrSets.begin(), attrSets.end(), [&
name = attrSetDesc.GetName()](
const auto &desc) {
1473 return desc.GetName() == name;
1474 }) != attrSets.end()) {
1475 return R__FAIL(
"attribute sets with duplicate names");
1477 attrSets.push_back(std::move(attrSetDesc));
1587 if (fieldDesc.
GetTypeName().rfind(
"std::", 0) == 0)
1594 static const std::string gIntTypeNames[] = {
"bool",
"char",
"std::int8_t",
"std::uint8_t",
1595 "std::int16_t",
"std::uint16_t",
"std::int32_t",
"std::uint32_t",
1596 "std::int64_t",
"std::uint64_t"};
1597 return std::find(std::begin(gIntTypeNames), std::end(gIntTypeNames),
1605 return (fieldDesc.
GetTypeName().rfind(
"std::atomic<", 0) == 0);
#define R__FORWARD_ERROR(res)
Short-hand to return an RResult<T> in an error state (i.e. after checking)
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
RResult< ROOT::Experimental::RNTupleAttrSetDescriptor > MoveDescriptor()
Attempt to make an AttributeSet descriptor.
Used to loop over all the Attribute Sets linked to an RNTuple.
Metadata stored for every Attribute Set linked to an RNTuple.
bool operator==(const RNTupleAttrSetDescriptor &other) const
std::uint16_t fSchemaVersionMajor
RNTupleAttrSetDescriptor Clone() const
std::uint32_t fAnchorLength
uncompressed size of the linked anchor
RNTupleLocator fAnchorLocator
std::uint16_t fSchemaVersionMinor
A helper class for piece-wise construction of an RClusterDescriptor.
RResult< void > MarkSuppressedColumnRange(ROOT::DescriptorId_t physicalId)
Books the given column ID as being suppressed in this cluster.
RResult< void > CommitColumnRange(ROOT::DescriptorId_t physicalId, std::uint64_t firstElementIndex, std::uint32_t compressionSettings, const RClusterDescriptor::RPageRange &pageRange)
RClusterDescriptorBuilder & AddExtendedColumnRanges(const RNTupleDescriptor &desc)
Add column and page ranges for columns created during late model extension missing in this cluster.
RResult< void > CommitSuppressedColumnRanges(const RNTupleDescriptor &desc)
Sets the first element index and number of elements for all the suppressed column ranges.
RResult< RClusterDescriptor > MoveDescriptor()
Move out the full cluster descriptor including page locations.
A helper class for piece-wise construction of an RClusterGroupDescriptor.
RClusterGroupDescriptorBuilder & EntrySpan(std::uint64_t entrySpan)
RClusterGroupDescriptorBuilder & PageListLocator(const RNTupleLocator &pageListLocator)
static RClusterGroupDescriptorBuilder FromSummary(const RClusterGroupDescriptor &clusterGroupDesc)
RClusterGroupDescriptorBuilder & PageListLength(std::uint64_t pageListLength)
RClusterGroupDescriptorBuilder & MinEntry(std::uint64_t minEntry)
RResult< RClusterGroupDescriptor > MoveDescriptor()
RClusterGroupDescriptorBuilder & ClusterGroupId(ROOT::DescriptorId_t clusterGroupId)
RClusterGroupDescriptorBuilder & NClusters(std::uint32_t nClusters)
RResult< RColumnDescriptor > MoveDescriptor()
Attempt to make a column descriptor.
A column element encapsulates the translation between basic C++ types and their column representation...
static std::pair< std::uint16_t, std::uint16_t > GetValidBitRange(ROOT::ENTupleColumnType type)
Most types have a fixed on-disk bit width.
std::size_t GetSize() const
std::size_t GetPackedSize(std::size_t nElements=1U) const
A helper class for piece-wise construction of an RFieldDescriptor.
RResult< RFieldDescriptor > MoveDescriptor()
Attempt to make a field descriptor.
RFieldDescriptorBuilder & NRepetitions(std::uint64_t nRepetitions)
RFieldDescriptorBuilder & Structure(const ROOT::ENTupleStructure &structure)
RFieldDescriptorBuilder & TypeAlias(const std::string &typeAlias)
static RFieldDescriptor CloneDescriptor(const RFieldDescriptor &source, RStringPool &stringPool)
RFieldDescriptorBuilder & TypeVersion(std::uint32_t typeVersion)
RFieldDescriptorBuilder & IsSoACollection(bool val)
RFieldDescriptorBuilder & TypeChecksum(const std::optional< std::uint32_t > typeChecksum)
RFieldDescriptorBuilder & FieldDescription(const std::string &fieldDescription)
RFieldDescriptorBuilder & FieldVersion(std::uint32_t fieldVersion)
RFieldDescriptorBuilder & FieldName(const std::string &fieldName)
RFieldDescriptorBuilder & FieldId(ROOT::DescriptorId_t fieldId)
RFieldDescriptorBuilder & TypeName(const std::string &typeName)
void SetNTuple(std::string_view name, std::string_view description)
void SetSchemaFromExisting(const RNTupleDescriptor &descriptor)
Copies the "schema" part of descriptor into the builder's descriptor.
void SetVersionForWriting()
RResult< void > AddColumn(RColumnDescriptor &&columnDesc)
void AddField(RFieldDescriptor fieldDesc)
RResult< void > AddAttributeSet(Experimental::RNTupleAttrSetDescriptor &&attrSetDesc)
RResult< void > AddFieldProjection(ROOT::DescriptorId_t sourceId, ROOT::DescriptorId_t targetId)
void ReplaceExtraTypeInfo(RExtraTypeInfoDescriptor &&extraTypeInfoDesc)
RResult< void > AddExtraTypeInfo(RExtraTypeInfoDescriptor &&extraTypeInfoDesc)
void ShiftAliasColumns(std::uint32_t offset)
Shift column IDs of alias columns by offset
void SetVersion(std::uint16_t versionEpoch, std::uint16_t versionMajor, std::uint16_t versionMinor, std::uint16_t versionPatch)
RNTupleDescriptor MoveDescriptor()
void BeginHeaderExtension()
Mark the beginning of the header extension; any fields and columns added after a call to this functio...
RResult< void > AddCluster(RClusterDescriptor &&clusterDesc)
RResult< void > EnsureValidDescriptor() const
Checks whether invariants hold:
RResult< void > AddFieldLink(ROOT::DescriptorId_t fieldId, ROOT::DescriptorId_t linkId)
RResult< void > AddClusterGroup(RClusterGroupDescriptor &&clusterGroup)
RResult< void > EnsureFieldExists(ROOT::DescriptorId_t fieldId) const
void SetFeature(unsigned int flag)
Sets the flag-th bit of the feature flag to 1.
Used for string interning of repeated type names, field names, etc.
const std::string * Intern(std::string_view str)
Searches for str in the pool.
The window of element indexes of a particular column in a particular cluster.
bool IsSuppressed() const
void SetPhysicalColumnId(ROOT::DescriptorId_t id)
ROOT::DescriptorId_t GetPhysicalColumnId() const
void SetIsSuppressed(bool suppressed)
ROOT::NTupleSize_t GetNElements() const
void IncrementNElements(ROOT::NTupleSize_t by)
Metadata for RNTuple clusters.
ROOT::NTupleSize_t fFirstEntryIndex
Clusters can be swapped by adjusting the entry offsets of the cluster and all ranges.
std::unordered_map< ROOT::DescriptorId_t, RColumnRange > fColumnRanges
ROOT::NTupleSize_t fNEntries
ROOT::DescriptorId_t fClusterId
RClusterDescriptor Clone() const
bool operator==(const RClusterDescriptor &other) const
RColumnRangeIterable GetColumnRangeIterable() const
Returns an iterator over pairs { columnId, columnRange }. The iteration order is unspecified.
std::unordered_map< ROOT::DescriptorId_t, RPageRange > fPageRanges
std::uint64_t GetNBytesOnStorage() const
Clusters are bundled in cluster groups.
RNTupleLocator fPageListLocator
The page list that corresponds to the cluster group.
RClusterGroupDescriptor Clone() const
std::vector< ROOT::DescriptorId_t > fClusterIds
The cluster IDs can be empty if the corresponding page list is not loaded.
ROOT::DescriptorId_t GetId() const
std::uint64_t fMinEntry
The minimum first entry number of the clusters in the cluster group.
std::uint32_t fNClusters
Number of clusters is always known even if the cluster IDs are not (yet) populated.
std::uint32_t GetNClusters() const
std::uint64_t fPageListLength
Uncompressed size of the page list.
std::uint64_t GetPageListLength() const
std::uint64_t GetMinEntry() const
std::uint64_t GetEntrySpan() const
RNTupleLocator GetPageListLocator() const
ROOT::DescriptorId_t fClusterGroupId
std::uint64_t fEntrySpan
Number of entries that are (partially for sharded clusters) covered by this cluster group.
bool operator==(const RClusterGroupDescriptor &other) const
RClusterGroupDescriptor CloneSummary() const
Creates a clone without the cluster IDs.
Metadata stored for every column of an RNTuple.
ROOT::DescriptorId_t fPhysicalColumnId
Usually identical to the logical column ID, except for alias columns where it references the shadowed...
bool operator==(const RColumnDescriptor &other) const
ROOT::DescriptorId_t fLogicalColumnId
The actual column identifier, which is the link to the corresponding field.
std::unique_ptr< RValueRange > fValueRange
Optional value range (used e.g. by quantized real fields)
ROOT::DescriptorId_t fFieldId
Every column belongs to one and only one field.
std::int64_t fFirstElementIndex
The absolute value specifies the index for the first stored element for this column.
std::uint32_t fIndex
A field can be serialized into several columns, which are numbered from zero to $n$.
std::uint16_t fBitsOnStorage
The size in bits of elements of this column.
std::uint16_t fRepresentationIndex
A field may use multiple column representations, which are numbered from zero to $m$.
ROOT::ENTupleColumnType fType
The on-disk column type.
RColumnDescriptor Clone() const
Get a copy of the descriptor.
Base class for all ROOT issued exceptions.
A field translates read and write calls from/to underlying columns to/from tree values.
ROOT::ENTupleStructure GetStructure() const
@ kTraitEmulatedField
This field is a user defined type that was missing dictionaries and was reconstructed from the on-dis...
@ kTraitSoACollection
The field represents a collection in SoA layout.
@ kTraitInvalidField
This field is an instance of RInvalidField and can be safely static_cast to it.
@ kTraitTypeChecksum
The TClass checksum is set and valid.
const std::string & GetFieldName() const
const std::string & GetTypeAlias() const
const std::string & GetDescription() const
Get the field's description.
virtual std::uint32_t GetFieldVersion() const
Indicates an evolution of the mapping scheme from C++ type to columns.
virtual std::uint32_t GetTypeChecksum() const
Return the current TClass reported checksum of this class. Only valid if kTraitTypeChecksum is set.
std::uint32_t GetTraits() const
std::size_t GetNRepetitions() const
const std::string & GetTypeName() const
std::unique_ptr< RFieldBase > Clone(std::string_view newName) const
Copies the field and its subfields using a possibly new name and a new, unconnected set of columns.
virtual std::uint32_t GetTypeVersion() const
Indicates an evolution of the C++ type itself.
Metadata stored for every field of an RNTuple.
const std::string & GetTypeAlias() const
std::unique_ptr< ROOT::RFieldBase > CreateField(const RNTupleDescriptor &ntplDesc, const ROOT::RCreateFieldOptions &options={}) const
In general, we create a field simply from the C++ type name.
std::uint32_t fFieldVersion
The version of the C++-type-to-column translation mechanics.
ROOT::DescriptorId_t fFieldId
RFieldDescriptor Clone() const
Get a copy of the descriptor.
ROOT::DescriptorId_t GetId() const
std::uint64_t fNRepetitions
The number of elements per entry for fixed-size arrays.
const std::vector< ROOT::DescriptorId_t > & GetLogicalColumnIds() const
std::uint32_t fColumnCardinality
The number of columns in the column representations of the field.
ROOT::DescriptorId_t fProjectionSourceId
For projected fields, the source field ID.
static const std::string & GetEmptyString()
ROOT::ENTupleStructure GetStructure() const
bool operator==(const RFieldDescriptor &other) const
ROOT::DescriptorId_t fParentId
Establishes sub field relationships, such as classes and collections.
ROOT::DescriptorId_t GetParentId() const
ROOT::ENTupleStructure fStructure
The structural information carried by this field in the data model tree.
std::vector< ROOT::DescriptorId_t > fLinkIds
The pointers in the other direction from parent to children.
const std::string & GetFieldDescription() const
void InitFrom(const RFieldDescriptor &source, Internal::RStringPool &stringPool)
bool fIsSoACollection
Indicates if this is a collection that should be represented in memory by a SoA layout.
std::uint32_t fTypeVersion
The version of the C++ type itself.
const std::string & GetFieldName() const
std::unique_ptr< Internal::RStringPool > fStringPool
Optional string storage for a free-standing field descriptor.
std::vector< ROOT::DescriptorId_t > fLogicalColumnIds
The ordered list of columns attached to this field: first by representation index then by column inde...
const std::string & GetTypeName() const
std::optional< std::uint32_t > fTypeChecksum
For custom classes, we store the ROOT TClass reported checksum to facilitate the use of I/O rules tha...
Used in RFieldBase::Check() to record field creation failures.
@ kGeneric
Generic unrecoverable error.
@ kUnknownStructure
The field could not be created because its descriptor had an unknown structural role.
ECategory GetCategory() const
Loop over all the clusters of an RNTuple, ordered by first entry number.
Used to loop over all the cluster groups of an RNTuple in order of entry ranges.
Used to loop over a field's associated columns.
std::vector< ROOT::DescriptorId_t > fColumns
The descriptor ids of the columns ordered by field, representation, and column index.
RColumnDescriptorIterable(const RNTupleDescriptor &ntuple, const RFieldDescriptor &fieldDesc)
Used to loop over a field's child fields.
The on-storage metadata of an RNTuple.
const RColumnDescriptor & GetColumnDescriptor(ROOT::DescriptorId_t columnId) const
RFieldDescriptorIterable GetFieldIterable(const RFieldDescriptor &fieldDesc) const
std::set< unsigned int > fFeatureFlags
std::unordered_map< ROOT::DescriptorId_t, RClusterGroupDescriptor > fClusterGroupDescriptors
const RFieldDescriptor & GetFieldDescriptor(ROOT::DescriptorId_t fieldId) const
std::uint64_t fNPhysicalColumns
Updated by the descriptor builder when columns are added.
std::vector< Experimental::RNTupleAttrSetDescriptor > fAttributeSets
List of AttributeSets linked to this RNTuple.
ROOT::DescriptorId_t fFieldZeroId
Set by the descriptor builder.
std::uint64_t fNEntries
Updated by the descriptor builder when the cluster groups are added.
RClusterDescriptorIterable GetActiveClusterIterable() const
RClusterGroupDescriptorIterable GetClusterGroupIterable() const
std::size_t GetNActiveClusters() const
RColumnDescriptorIterable GetColumnIterable() const
bool operator==(const RNTupleDescriptor &other) const
std::uint64_t fOnDiskFooterSize
Like fOnDiskHeaderSize, contains both cluster summaries and page locations.
std::uint16_t fVersionMinor
Set by the descriptor builder when deserialized.
ROOT::DescriptorId_t FindClusterId(ROOT::NTupleSize_t entryIdx) const
ROOT::NTupleSize_t R__DEPRECATED(6, 46, "This function is ill-conceived in the descriptor " "as not all cluster descriptors may be present. This interface is no longer publicly exposed.") GetNElements(ROOT ROOT::DescriptorId_t GetFieldZeroId() const
Returns the logical parent of all top-level RNTuple data fields.
std::vector< std::uint64_t > GetFeatureFlags() const
std::unique_ptr< ROOT::RNTupleModel > CreateModel(const RCreateModelOptions &options=RCreateModelOptions()) const
Re-create the C++ model from the stored metadata.
std::string GetTypeNameForComparison(const RFieldDescriptor &fieldDesc) const
Adjust the type name of the passed RFieldDescriptor for comparison with another renormalized type nam...
std::unordered_map< ROOT::DescriptorId_t, RClusterDescriptor > fClusterDescriptors
Potentially a subset of all the available clusters.
std::size_t GetNClusters() const
ROOT::DescriptorId_t FindPhysicalColumnId(ROOT::DescriptorId_t fieldId, std::uint32_t columnIndex, std::uint16_t representationIndex) const
RExtraTypeInfoDescriptorIterable GetExtraTypeInfoIterable() const
std::shared_ptr< Internal::RStringPool > fStringPool
Storage for all the field strings. Shared among descriptor clones.
const RHeaderExtension * GetHeaderExtension() const
Return header extension information; if the descriptor does not have a header extension,...
std::uint64_t fNClusters
Updated by the descriptor builder when the cluster groups are added.
RNTupleDescriptor CloneSchema(bool shareStringPool) const
Creates a descriptor containing only the schema information about this RNTuple, i....
std::uint64_t fOnDiskHeaderXxHash3
Set by the descriptor builder when deserialized.
ROOT::DescriptorId_t FindFieldId(std::string_view fieldName, ROOT::DescriptorId_t parentId) const
std::string fName
The RNTuple name needs to be unique in a given storage location (file)
std::uint64_t fOnDiskHeaderSize
Set by the descriptor builder when deserialized.
RResult< void > DropClusterGroupDetails(ROOT::DescriptorId_t clusterGroupId)
std::uint16_t fVersionMajor
Set by the descriptor builder when deserialized.
std::vector< ROOT::DescriptorId_t > fSortedClusterGroupIds
References cluster groups sorted by entry range and thus allows for binary search.
std::unordered_map< ROOT::DescriptorId_t, RColumnDescriptor > fColumnDescriptors
ROOT::DescriptorId_t FindLogicalColumnId(ROOT::DescriptorId_t fieldId, std::uint32_t columnIndex, std::uint16_t representationIndex) const
std::unordered_map< ROOT::DescriptorId_t, RFieldDescriptor > fFieldDescriptors
RResult< void > AddClusterGroupDetails(ROOT::DescriptorId_t clusterGroupId, std::vector< RClusterDescriptor > &clusterDescs)
Methods to load and drop cluster group details (cluster IDs and page locations)
std::uint16_t fVersionPatch
Set by the descriptor builder when deserialized.
std::string fDescription
Free text from the user.
ROOT::Experimental::RNTupleAttrSetDescriptorIterable GetAttrSetIterable() const
RFieldDescriptorIterable GetTopLevelFields() const
std::uint16_t fVersionEpoch
Set by the descriptor builder when deserialized.
std::vector< RExtraTypeInfoDescriptor > fExtraTypeInfoDescriptors
RNTupleDescriptor Clone() const
ROOT::DescriptorId_t R__DEPRECATED(6, 46, "This function is ill-defined in the descriptor " "as not all cluster descriptors may be present. This interface is no longer exposed.") FindClusterId(ROOT ROOT::DescriptorId_t R__DEPRECATED(6, 46, "This function is ill-defined in the descriptor " "as not all cluster descriptors may be present. This interface is no longer exposed.") FindNextClusterId(ROOT ROOT::DescriptorId_t R__DEPRECATED(6, 46, "This function is ill-defined in the descriptor " "as not all cluster descriptors may be present. This interface is no longer exposed.") FindPrevClusterId(ROOT std::string GetQualifiedFieldName(ROOT::DescriptorId_t fieldId) const
Walks up the parents of the field ID and returns a field name of the form a.b.c.d In case of invalid ...
bool FieldTypeNamesMayNeedFixup() const
ROOT v6.34, with spec versions before 1.0.0.1, did not properly renormalize the type name.
std::uint64_t fGeneration
The generation of the descriptor.
std::unique_ptr< RHeaderExtension > fHeaderExtension
Generic information about the physical location of data.
void SetType(ELocatorType type)
void SetNBytesOnStorage(std::uint64_t nBytesOnStorage)
static std::unique_ptr< RNTupleModel > Create()
static std::unique_ptr< RNTupleModel > CreateBare()
Creates a "bare model", i.e. an RNTupleModel with no default entry.
static constexpr std::uint16_t kVersionPatch
static constexpr std::uint16_t kVersionMajor
static constexpr std::uint16_t kVersionEpoch
static constexpr std::uint16_t kVersionMinor
The class is used as a return type for operations that can fail; wraps a value of type T or an RError...
static std::unique_ptr< RVectorField > CreateUntyped(std::string_view fieldName, std::unique_ptr< RFieldBase > itemField)
RResult< void > EnsureValidNameForRNTuple(std::string_view name, std::string_view where)
Check whether a given string is a valid name according to the RNTuple specification.
ROOT::RResult< std::unique_ptr< ROOT::RFieldBase > > CallFieldBaseCreate(const std::string &fieldName, const std::string &typeName, const ROOT::RCreateFieldOptions &options, const ROOT::RNTupleDescriptor *desc, ROOT::DescriptorId_t fieldId)
bool IsCustomEnumFieldDesc(const RNTupleDescriptor &desc, const RFieldDescriptor &fieldDesc)
Tells if the field describes a user-defined enum type.
std::vector< ROOT::Internal::RNTupleClusterBoundaries > GetClusterBoundaries(const RNTupleDescriptor &desc)
Return the cluster boundaries for each cluster in this RNTuple.
std::string GetRenormalizedTypeName(const std::string &metaNormalizedName)
Given a type name normalized by ROOT meta, renormalize it for RNTuple. E.g., insert std::prefix.
bool IsStdAtomicFieldDesc(const RFieldDescriptor &fieldDesc)
Tells if the field describes a std::atomic<T> type.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
constexpr NTupleSize_t kInvalidNTupleIndex
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr DescriptorId_t kInvalidDescriptorId
Additional information about a page in an in-memory RPageRange.
Information about a single page in the context of a cluster's page range.
void SetLocator(const RNTupleLocator &locator)
std::uint32_t GetNElements() const
void SetNElements(std::uint32_t n)
void SetEmulateUnknownTypes(bool v)
void SetReturnInvalidOnError(bool v)
bool GetReturnInvalidOnError() const
bool GetEmulateUnknownTypes() const
Modifiers passed to CreateModel()
bool GetCreateBare() const
bool GetEmulateUnknownTypes() const
bool GetReconstructProjections() const
bool GetForwardCompatible() const
static uint64_t sum(uint64_t i)