Logo ROOT  
Reference Guide
No Matches
ROOT::Experimental::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 139 of file RNTupleModel.hxx.

Public Member Functions

 RUpdater (RNTupleWriter &writer)
 ~RUpdater ()
template<typename T >
void AddField (const NameWithDescription_t &fieldNameDesc, T *fromWhere)
void AddField (std::unique_ptr< Detail::RFieldBase > field)
RResult< void > AddProjectedField (std::unique_ptr< Detail::RFieldBase > field, std::function< std::string(const std::string &)> mapping)
void BeginUpdate ()
 Begin a new set of alterations to the underlying model.
void CommitUpdate ()
 Commit changes since the last call to BeginUpdate().

Private Attributes

Detail::RNTupleModelChangeset fOpenChangeset

#include <ROOT/RNTupleModel.hxx>

Constructor & Destructor Documentation

◆ RUpdater()

ROOT::Experimental::RNTupleModel::RUpdater::RUpdater ( RNTupleWriter writer)

Definition at line 131 of file RNTupleModel.cxx.

◆ ~RUpdater()

ROOT::Experimental::RNTupleModel::RUpdater::~RUpdater ( )

Definition at line 146 of file RNTupleModel.hxx.

Member Function Documentation

◆ AddField() [1/2]

template<typename T >
void ROOT::Experimental::RNTupleModel::RUpdater::AddField ( const NameWithDescription_t fieldNameDesc,
T *  fromWhere 

Definition at line 157 of file RNTupleModel.hxx.

◆ AddField() [2/2]

void ROOT::Experimental::RNTupleModel::RUpdater::AddField ( std::unique_ptr< Detail::RFieldBase field)

Definition at line 152 of file RNTupleModel.cxx.

◆ AddProjectedField()

ROOT::Experimental::RResult< void > ROOT::Experimental::RNTupleModel::RUpdater::AddProjectedField ( std::unique_ptr< Detail::RFieldBase field,
std::function< std::string(const std::string &)>  mapping 

Definition at line 160 of file RNTupleModel.cxx.

◆ BeginUpdate()

void ROOT::Experimental::RNTupleModel::RUpdater::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 136 of file RNTupleModel.cxx.

◆ CommitUpdate()

void ROOT::Experimental::RNTupleModel::RUpdater::CommitUpdate ( )

Commit changes since the last call to BeginUpdate().

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

Definition at line 141 of file RNTupleModel.cxx.

Member Data Documentation

◆ fOpenChangeset

Detail::RNTupleModelChangeset ROOT::Experimental::RNTupleModel::RUpdater::fOpenChangeset

Definition at line 142 of file RNTupleModel.hxx.

◆ fWriter

RNTupleWriter& ROOT::Experimental::RNTupleModel::RUpdater::fWriter

Definition at line 141 of file RNTupleModel.hxx.

Libraries for ROOT::Experimental::RNTupleModel::RUpdater:

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