Skip to content

Commit 373837c

Browse files
committed
[ntuple] fix moving RNTupleCollectionView
Workaround. The underlying problem, moving the RField, is still broken. To be addressed at a later point.
1 parent 3d20381 commit 373837c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tree/ntuple/v7/inc/ROOT/RNTupleView.hxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,14 +354,14 @@ class RNTupleCollectionView {
354354

355355
private:
356356
Internal::RPageSource *fSource;
357-
RField<RNTupleCardinality<std::uint64_t>> fField;
357+
std::unique_ptr<RField<RNTupleCardinality<std::uint64_t>>> fField; // TODO(jblomer): fix moving RField
358358
RFieldBase::RValue fValue;
359359

360360
RNTupleCollectionView(DescriptorId_t fieldId, const std::string &fieldName, Internal::RPageSource *source)
361-
: fSource(source), fField(fieldName), fValue(fField.CreateValue())
361+
: fSource(source), fField(new RField<RNTupleCardinality<std::uint64_t>>(fieldName)), fValue(fField->CreateValue())
362362
{
363-
fField.SetOnDiskId(fieldId);
364-
Internal::CallConnectPageSourceOnField(fField, *source);
363+
fField->SetOnDiskId(fieldId);
364+
Internal::CallConnectPageSourceOnField(*fField, *source);
365365
}
366366

367367
static RNTupleCollectionView Create(DescriptorId_t fieldId, Internal::RPageSource *source)
@@ -382,10 +382,10 @@ private:
382382
DescriptorId_t GetFieldId(std::string_view fieldName)
383383
{
384384
auto descGuard = fSource->GetSharedDescriptorGuard();
385-
auto fieldId = descGuard->FindFieldId(fieldName, fField.GetOnDiskId());
385+
auto fieldId = descGuard->FindFieldId(fieldName, fField->GetOnDiskId());
386386
if (fieldId == kInvalidDescriptorId) {
387387
throw RException(R__FAIL("no field named '" + std::string(fieldName) + "' in collection '" +
388-
descGuard->GetQualifiedFieldName(fField.GetOnDiskId()) + "'"));
388+
descGuard->GetQualifiedFieldName(fField->GetOnDiskId()) + "'"));
389389
}
390390
return fieldId;
391391
}
@@ -400,15 +400,15 @@ public:
400400
RNTupleClusterRange GetCollectionRange(NTupleSize_t globalIndex) {
401401
ClusterSize_t size;
402402
RClusterIndex collectionStart;
403-
fField.GetCollectionInfo(globalIndex, &collectionStart, &size);
403+
fField->GetCollectionInfo(globalIndex, &collectionStart, &size);
404404
return RNTupleClusterRange(collectionStart.GetClusterId(), collectionStart.GetIndex(),
405405
collectionStart.GetIndex() + size);
406406
}
407407
RNTupleClusterRange GetCollectionRange(RClusterIndex clusterIndex)
408408
{
409409
ClusterSize_t size;
410410
RClusterIndex collectionStart;
411-
fField.GetCollectionInfo(clusterIndex, &collectionStart, &size);
411+
fField->GetCollectionInfo(clusterIndex, &collectionStart, &size);
412412
return RNTupleClusterRange(collectionStart.GetClusterId(), collectionStart.GetIndex(),
413413
collectionStart.GetIndex() + size);
414414
}

0 commit comments

Comments
 (0)