Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RNTupleModel::RUpdater Class Reference

A model is usually immutable after passing it to an RNTupleWriter.

However, for the rare cases that require changing the model after the fact, RUpdater provides limited support for incremental updates, e.g. addition of new fields.

See RNTupleWriter::CreateModelUpdater() for an example.

Definition at line 431 of file RNTupleModel.hxx.

Public Member Functions

 RUpdater (ROOT::RNTupleWriter &writer)
 ~RUpdater ()
void AddField (std::unique_ptr< ROOT::RFieldBase > field, std::string_view parentName="")
RResult< void > AddProjectedField (std::unique_ptr< ROOT::RFieldBase > field, FieldMappingFunc_t mapping)
void BeginUpdate ()
 Begin a new set of alterations to the underlying model.
void CommitUpdate ()
 Commit changes since the last call to BeginUpdate().
template<typename T>
std::shared_ptr< T > MakeField (std::string_view name, std::string_view description="")

Private Attributes

std::uint64_t fNewModelId = 0
 The model ID after committing.
Internal::RNTupleModelChangeset fOpenChangeset
ROOT::RNTupleWriterfWriter

#include <ROOT/RNTupleModel.hxx>

Constructor & Destructor Documentation

◆ RUpdater()

Definition at line 190 of file RNTupleModel.cxx.

◆ ~RUpdater()

Member Function Documentation

◆ AddField()

void ROOT::RNTupleModel::RUpdater::AddField ( std::unique_ptr< ROOT::RFieldBase > field,
std::string_view parentName = "" )

Definition at line 268 of file RNTupleModel.cxx.

◆ AddProjectedField()

See also
RNTupleModel::AddProjectedField()

Definition at line 284 of file RNTupleModel.cxx.

◆ BeginUpdate()

Begin a new set of alterations to the underlying model.

As a side effect, all REntry instances related to the model are invalidated.

Definition at line 204 of file RNTupleModel.cxx.

◆ CommitUpdate()

Commit changes since the last call to BeginUpdate().

All the invalidated REntries remain invalid. CreateEntry() or CreateBareEntry() can be used to create an REntry that matches the new model. Upon completion, BeginUpdate() can be called again to begin a new set of changes.

Definition at line 212 of file RNTupleModel.cxx.

◆ MakeField()

template<typename T>
std::shared_ptr< T > ROOT::RNTupleModel::RUpdater::MakeField ( std::string_view name,
std::string_view description = "" )
inline

Definition at line 449 of file RNTupleModel.hxx.

Member Data Documentation

◆ fNewModelId

std::uint64_t ROOT::RNTupleModel::RUpdater::fNewModelId = 0
private

The model ID after committing.

Definition at line 435 of file RNTupleModel.hxx.

◆ fOpenChangeset

Internal::RNTupleModelChangeset ROOT::RNTupleModel::RUpdater::fOpenChangeset
private

Definition at line 434 of file RNTupleModel.hxx.

◆ fWriter


The documentation for this class was generated from the following files: