Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bdb1378
[ntuple] fix argument comment
jblomer May 26, 2026
6840b0a
[ntuple] avoid throwing impossible exception
jblomer May 27, 2026
adcbd1f
[ntuple] don't throw in RNTupleModel::~RUpdater()
jblomer May 27, 2026
ff9976a
[ntuple] safer use of RException
jblomer May 27, 2026
437c89f
[ntuple] fix throwing exception in RNTupleDescriptor
jblomer May 27, 2026
9c2e2df
[ntuple] remove wrong forward declaration of RFieldVisitor
jblomer May 27, 2026
470bad9
[ntuple] minor improvement in optional assignments
jblomer May 27, 2026
cc27fff
[ntuple] minor readability improvement
jblomer May 27, 2026
4ff86ab
[ntuple] minor improvement in RPageSourceFile::CreateFromAnchor()
jblomer May 27, 2026
777f3c8
[ntuple] remove unused variable in RFieldBase::Create()
jblomer May 27, 2026
12ef34a
[ntuple] fix use-after-move in RNTupleDescriptorBuilder::AddColumn()
jblomer May 27, 2026
d669fe3
[NFC][ntuple] suppress clang-tidy false positive
jblomer May 27, 2026
e4f1dc2
[ntuple] fix widening method visibility change
jblomer May 27, 2026
97ac7e7
[ntuple] remove unusued usings
jblomer May 27, 2026
2e09146
[ntuple] move RAuxiliaryProcessorField to anonymous namespace
jblomer May 27, 2026
9e69e67
[ntuple] private linkage of stream operator in the merger
jblomer May 27, 2026
6fc8b1c
[ntuple] replace std::endl by \n
jblomer May 27, 2026
a3fb844
[ntuple] minor performance improvement in RPageSourceFile::LoadCluste…
jblomer May 27, 2026
6e9e6fc
[ntuple] use member move in RValue move ctor
jblomer May 27, 2026
067c8bd
[ntuple] minor perf improvement in type name normalization
jblomer May 27, 2026
847e7ed
[ntuple] make moving RPage(Ref) noexcept
jblomer May 27, 2026
1016c52
[ntuple] avoid some unnecessary value copies
jblomer May 28, 2026
2105800
[ntuple] mark some move constructors noexcept
jblomer May 28, 2026
ce47a2a
[ntuple] fix virtual destructor visibility
jblomer May 28, 2026
cc43a03
[ntuple] fix up RNTupleDescriptorBuilder::SetNTuple() signature
jblomer May 28, 2026
d13f1bc
[ntuple] remove duplicate includes
jblomer May 28, 2026
28ece18
[NFC][ntuple] suppress cling-tidy warning for RKeyBlob
jblomer Jun 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions tree/ntuple/inc/ROOT/RField/RFieldFundamental.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
#include <type_traits>

namespace ROOT {
namespace Experimental {

namespace Detail {
class RFieldVisitor;
} // namespace Detail

} // namespace Experimental

////////////////////////////////////////////////////////////////////////////////
/// Template specializations for concrete C++ fundamental types
Expand Down Expand Up @@ -419,14 +412,13 @@ protected:
fPrincipalColumn = fAvailableColumns[0].get();
}

~RRealField() override = default;

public:
using Base::SetColumnRepresentatives;

RRealField(std::string_view name, std::string_view typeName) : RSimpleField<T>(name, typeName) {}
RRealField(RRealField &&other) = default;
RRealField &operator=(RRealField &&other) = default;
~RRealField() override = default;

/// Sets this field to use a half precision representation, occupying half as much storage space (16 bits:
/// 1 sign bit, 5 exponent bits, 10 mantissa bits) on disk.
Expand Down
7 changes: 0 additions & 7 deletions tree/ntuple/inc/ROOT/RField/RFieldSTLMisc.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@
#include <variant>

namespace ROOT {
namespace Experimental {

namespace Detail {
class RFieldVisitor;
} // namespace Detail

} // namespace Experimental

////////////////////////////////////////////////////////////////////////////////
/// Template specializations for C++ std::atomic
Expand Down
14 changes: 7 additions & 7 deletions tree/ntuple/inc/ROOT/RFieldBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ protected:
/// Set a user-defined function to be called after reading a value, giving a chance to inspect and/or modify the
/// value object.
/// Returns an index that can be used to remove the callback.
size_t AddReadCallback(ReadCallback_t func);
size_t AddReadCallback(const ReadCallback_t &func);
void RemoveReadCallback(size_t idx);

// Perform housekeeping tasks for global to cluster-local index translation
Expand Down Expand Up @@ -778,7 +778,7 @@ private:
std::shared_ptr<void> fObjPtr;
mutable std::atomic<const std::type_info *> fTypeInfo = nullptr;

RValue(RFieldBase *field, std::shared_ptr<void> objPtr) : fField(field), fObjPtr(objPtr) {}
RValue(RFieldBase *field, std::shared_ptr<void> objPtr) : fField(field), fObjPtr(std::move(objPtr)) {}

public:
RValue(const RValue &other) : fField(other.fField), fObjPtr(other.fObjPtr) {}
Expand All @@ -790,8 +790,8 @@ public:
fTypeInfo = nullptr;
return *this;
}
RValue(RValue &&other) : fField(other.fField), fObjPtr(other.fObjPtr) {}
RValue &operator=(RValue &&other)
RValue(RValue &&other) noexcept : fField(other.fField), fObjPtr(std::move(other.fObjPtr)) {}
RValue &operator=(RValue &&other) noexcept
{
fField = other.fField;
fObjPtr = other.fObjPtr;
Expand Down Expand Up @@ -829,7 +829,7 @@ public:
void Read(ROOT::NTupleSize_t globalIndex) { fField->Read(globalIndex, fObjPtr.get()); }
void Read(RNTupleLocalIndex localIndex) { fField->Read(localIndex, fObjPtr.get()); }

void Bind(std::shared_ptr<void> objPtr) { fObjPtr = objPtr; }
void Bind(std::shared_ptr<void> objPtr) { fObjPtr = std::move(objPtr); }
void BindRawPtr(void *rawPtr);
/// Replace the current object pointer by a pointer to a new object constructed by the field
void EmplaceNew() { fObjPtr = fField->CreateValue().GetPtr<void>(); }
Expand Down Expand Up @@ -927,8 +927,8 @@ public:
~RBulkValues();
RBulkValues(const RBulkValues &) = delete;
RBulkValues &operator=(const RBulkValues &) = delete;
RBulkValues(RBulkValues &&other);
RBulkValues &operator=(RBulkValues &&other);
RBulkValues(RBulkValues &&other) noexcept;
RBulkValues &operator=(RBulkValues &&other) noexcept;

// Sets `fValues` and `fSize`/`fCapacity` to the given values. The capacity is specified in number of values.
// Once a buffer is adopted, an attempt to read more values then available throws an exception.
Expand Down
4 changes: 3 additions & 1 deletion tree/ntuple/inc/ROOT/RFieldVisitor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ As an example of a concrete use case, see Internal::RPrintSchemaVisitor.
// clang-format on
class RFieldVisitor {
public:
virtual ~RFieldVisitor() = default;

virtual void VisitField(const ROOT::RFieldBase &field) = 0;
virtual void VisitFieldZero(const ROOT::RFieldZero &field) { VisitField(field); }
virtual void VisitArrayField(const ROOT::RArrayField &field) { VisitField(field); }
Expand Down Expand Up @@ -199,7 +201,7 @@ private:
public:
RPrintValueVisitor(ROOT::RFieldBase::RValue value, std::ostream &output, unsigned int level = 0,
RPrintOptions options = RPrintOptions())
: fValue(value), fOutput{output}, fLevel(level), fPrintOptions(options)
: fValue(std::move(value)), fOutput{output}, fLevel(level), fPrintOptions(options)
{
}

Expand Down
4 changes: 2 additions & 2 deletions tree/ntuple/inc/ROOT/RNTupleAttrWriting.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ public:
RNTupleAttrPendingRange(const RNTupleAttrPendingRange &) = delete;
RNTupleAttrPendingRange &operator=(const RNTupleAttrPendingRange &) = delete;

RNTupleAttrPendingRange(RNTupleAttrPendingRange &&other) { *this = std::move(other); }
RNTupleAttrPendingRange(RNTupleAttrPendingRange &&other) noexcept { *this = std::move(other); }

// NOTE: explicitly implemented to make sure that 'other' gets invalidated upon move.
RNTupleAttrPendingRange &operator=(RNTupleAttrPendingRange &&other)
RNTupleAttrPendingRange &operator=(RNTupleAttrPendingRange &&other) noexcept
{
if (&other != this) {
std::swap(fStart, other.fStart);
Expand Down
2 changes: 1 addition & 1 deletion tree/ntuple/inc/ROOT/RNTupleDescriptor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,7 @@ public:
std::uint16_t versionPatch);
void SetVersionForWriting();

void SetNTuple(const std::string_view name, const std::string_view description);
void SetNTuple(std::string_view name, std::string_view description);
/// Sets the `flag`-th bit of the feature flag to 1.
/// Note that `flag` itself is not a bitmask, just the bit index of the flag to enable.
void SetFeature(unsigned int flag);
Expand Down
6 changes: 3 additions & 3 deletions tree/ntuple/inc/ROOT/RNTupleModel.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public:
/// ~~~
///
/// Creating projections for fields containing `std::variant` or fixed-size arrays is unsupported.
RResult<void> AddProjectedField(std::unique_ptr<ROOT::RFieldBase> field, FieldMappingFunc_t mapping);
RResult<void> AddProjectedField(std::unique_ptr<ROOT::RFieldBase> field, const FieldMappingFunc_t &mapping);

/// Transitions an RNTupleModel from the *building* state to the *frozen* state, disabling adding additional fields
/// and enabling creating entries from it. Freezing an already-frozen model is a no-op. Throws an RException if the
Expand Down Expand Up @@ -418,7 +418,7 @@ struct RNTupleModelChangeset {

/// \see RNTupleModel::AddProjectedField()
ROOT::RResult<void>
AddProjectedField(std::unique_ptr<ROOT::RFieldBase> field, RNTupleModel::FieldMappingFunc_t mapping);
AddProjectedField(std::unique_ptr<ROOT::RFieldBase> field, const RNTupleModel::FieldMappingFunc_t &mapping);
};

} // namespace Internal
Expand Down Expand Up @@ -459,7 +459,7 @@ public:
void AddField(std::unique_ptr<ROOT::RFieldBase> field, std::string_view parentName = "");

/// \see RNTupleModel::AddProjectedField()
RResult<void> AddProjectedField(std::unique_ptr<ROOT::RFieldBase> field, FieldMappingFunc_t mapping);
RResult<void> AddProjectedField(std::unique_ptr<ROOT::RFieldBase> field, const FieldMappingFunc_t &mapping);
};

} // namespace ROOT
Expand Down
2 changes: 1 addition & 1 deletion tree/ntuple/inc/ROOT/RNTupleProcessorEntry.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private:
fQualifiedFieldName(qualifiedFieldName),
fValue(std::move(value)),
fIsValid(isValid),
fProcessorProvenance(provenance)
fProcessorProvenance(std::move(provenance))
{
}
};
Expand Down
6 changes: 3 additions & 3 deletions tree/ntuple/inc/ROOT/RNTupleReader.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,16 @@ public:
void DeactivateEntry(NTupleSize_t entryNumber);

explicit RActiveEntryToken(std::shared_ptr<RActiveEntriesControlBlock> ptrControlBlock)
: fPtrControlBlock(ptrControlBlock)
: fPtrControlBlock(std::move(ptrControlBlock))
{
}

public:
~RActiveEntryToken() { Reset(); }
RActiveEntryToken(const RActiveEntryToken &other);
RActiveEntryToken(RActiveEntryToken &&other);
RActiveEntryToken(RActiveEntryToken &&other) noexcept;
RActiveEntryToken &operator=(const RActiveEntryToken &other);
RActiveEntryToken &operator=(RActiveEntryToken &&other);
RActiveEntryToken &operator=(RActiveEntryToken &&other) noexcept;

NTupleSize_t GetEntryNumber() const { return fEntryNumber; }
/// Set or replace the entry number. If the entry number is replaced, the cluster corresponding to the new
Expand Down
8 changes: 4 additions & 4 deletions tree/ntuple/inc/ROOT/RNTupleView.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected:
}

RNTupleViewBase(std::unique_ptr<ROOT::RFieldBase> field, ROOT::RNTupleGlobalRange range, std::shared_ptr<T> objPtr)
: fField(std::move(field)), fFieldRange(range), fValue(fField->BindValue(objPtr))
: fField(std::move(field)), fFieldRange(range), fValue(fField->BindValue(std::move(objPtr)))
{
}

Expand Down Expand Up @@ -232,7 +232,7 @@ protected:
}

RNTupleView(std::unique_ptr<ROOT::RFieldBase> field, ROOT::RNTupleGlobalRange range, std::shared_ptr<void> objPtr)
: RNTupleViewBase<void>(std::move(field), range, objPtr)
: RNTupleViewBase<void>(std::move(field), range, std::move(objPtr))
{
}

Expand Down Expand Up @@ -365,11 +365,11 @@ private:
public:
RNTupleCollectionView(const RNTupleCollectionView &other) = delete;
RNTupleCollectionView &operator=(const RNTupleCollectionView &other) = delete;
RNTupleCollectionView(RNTupleCollectionView &&other)
RNTupleCollectionView(RNTupleCollectionView &&other) noexcept(false)
: fSource(other.fSource), fField(std::move(other.fField)), fValue(fField.CreateValue())
{
}
RNTupleCollectionView &operator=(RNTupleCollectionView &&other)
RNTupleCollectionView &operator=(RNTupleCollectionView &&other) noexcept(false)
{
if (this == &other)
return *this;
Expand Down
4 changes: 2 additions & 2 deletions tree/ntuple/inc/ROOT/RPage.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public:
{}
RPage(const RPage &) = delete;
RPage &operator=(const RPage &) = delete;
RPage(RPage &&other)
RPage(RPage &&other) noexcept
{
fBuffer = other.fBuffer;
fPageAllocator = other.fPageAllocator;
Expand All @@ -92,7 +92,7 @@ public:
fClusterInfo = other.fClusterInfo;
other.fPageAllocator = nullptr;
}
RPage &operator=(RPage &&other)
RPage &operator=(RPage &&other) noexcept
{
if (this != &other) {
std::swap(fBuffer, other.fBuffer);
Expand Down
14 changes: 8 additions & 6 deletions tree/ntuple/inc/ROOT/RPageNullSink.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ class RPageNullSink : public ROOT::Internal::RPageSink {
ROOT::DescriptorId_t fNColumns = 0;
std::uint64_t fNBytesCurrentCluster = 0;

protected:
void InitImpl(ROOT::RNTupleModel &model) final
{
auto &fieldZero = ROOT::Internal::GetFieldZeroOfModel(model);
ConnectFields(fieldZero.GetMutableSubfields(), 0);
}
ROOT::Internal::RNTupleLink CommitDatasetImpl() final { return {}; }

public:
RPageNullSink(std::string_view ntupleName, const ROOT::RNTupleWriteOptions &options) : RPageSink(ntupleName, options)
{
Expand Down Expand Up @@ -66,11 +74,6 @@ public:
}
}
}
void InitImpl(ROOT::RNTupleModel &model) final
{
auto &fieldZero = ROOT::Internal::GetFieldZeroOfModel(model);
ConnectFields(fieldZero.GetMutableSubfields(), 0);
}
void UpdateSchema(const ROOT::Internal::RNTupleModelChangeset &changeset, ROOT::NTupleSize_t firstEntry) final
{
ConnectFields(changeset.fAddedFields, firstEntry);
Expand Down Expand Up @@ -104,7 +107,6 @@ public:
}
void CommitStagedClusters(std::span<RStagedCluster>) final {}
void CommitClusterGroup() final {}
ROOT::Internal::RNTupleLink CommitDatasetImpl() final { return {}; }
void CommitAttributeSet(std::string_view, const ROOT::Internal::RNTupleLink &) final {}

std::unique_ptr<RPageSink> CloneAsHidden(std::string_view, const RNTupleWriteOptions &) const final
Expand Down
4 changes: 2 additions & 2 deletions tree/ntuple/inc/ROOT/RPagePool.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ public:
RPageRef(const RPageRef &other) = delete;
RPageRef &operator=(const RPageRef &other) = delete;

RPageRef(RPageRef &&other) : RPageRef(other.fPage, other.fPagePool) { other.fPagePool = nullptr; }
RPageRef(RPageRef &&other) noexcept : RPageRef(other.fPage, other.fPagePool) { other.fPagePool = nullptr; }

RPageRef &operator=(RPageRef &&other)
RPageRef &operator=(RPageRef &&other) noexcept
{
if (this != &other) {
std::swap(fPage, other.fPage);
Expand Down
13 changes: 6 additions & 7 deletions tree/ntuple/inc/ROOT/RPageSinkBuf.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ namespace Internal {
*/
// clang-format on
class RPageSinkBuf : public RPageSink {
private:
/// A buffered column. The column is not responsible for RPage memory management (i.e. ReservePage),
/// which is handled by the enclosing RPageSinkBuf.
class RColumnBuf {
Expand All @@ -53,8 +52,8 @@ private:
RColumnBuf() = default;
RColumnBuf(const RColumnBuf&) = delete;
RColumnBuf& operator=(const RColumnBuf&) = delete;
RColumnBuf(RColumnBuf&&) = default;
RColumnBuf& operator=(RColumnBuf&&) = default;
RColumnBuf(RColumnBuf &&) noexcept = default;
RColumnBuf &operator=(RColumnBuf &&) noexcept = default;
~RColumnBuf() { DropBufferedPages(); }

/// Returns a reference to the newly buffered page. The reference remains
Expand Down Expand Up @@ -94,7 +93,6 @@ private:
RPageStorage::SealedPageSequence_t fSealedPages;
};

private:
/// I/O performance counters that get registered in fMetrics
struct RCounters {
ROOT::Experimental::Detail::RNTuplePlainCounter &fParallelZip;
Expand All @@ -120,7 +118,10 @@ private:
ROOT::DescriptorId_t fNColumns = 0;

void ConnectFields(const std::vector<ROOT::RFieldBase *> &fields, ROOT::NTupleSize_t firstEntry);
void FlushClusterImpl(std::function<void(void)> FlushClusterFn);
void FlushClusterImpl(const std::function<void(void)> &FlushClusterFn);

void InitImpl(ROOT::RNTupleModel &model) final;
RNTupleLink CommitDatasetImpl() final;

public:
explicit RPageSinkBuf(std::unique_ptr<RPageSink> inner);
Expand All @@ -136,7 +137,6 @@ public:

ROOT::NTupleSize_t GetNEntries() const final { return fInnerSink->GetNEntries(); }

void InitImpl(ROOT::RNTupleModel &model) final;
void UpdateSchema(const RNTupleModelChangeset &changeset, ROOT::NTupleSize_t firstEntry) final;
void UpdateExtraTypeInfo(const ROOT::RExtraTypeInfoDescriptor &extraTypeInfo) final;

Expand All @@ -148,7 +148,6 @@ public:
RStagedCluster StageCluster(ROOT::NTupleSize_t nNewEntries) final;
void CommitStagedClusters(std::span<RStagedCluster> clusters) final;
void CommitClusterGroup() final;
RNTupleLink CommitDatasetImpl() final;
void CommitAttributeSet(std::string_view attrSetName, const RNTupleLink &attrAnchorInfo) final;

RPage ReservePage(ColumnHandle_t columnHandle, std::size_t nElements) final;
Expand Down
Loading
Loading