Logo ROOT   6.18/05
Reference Guide
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ROOT::Experimental::RNTupleModel Class Reference

The RNTupleModel encapulates the schema of an ntuple.

The ntuple model comprises a collection of hierarchically organized fields. From a frozen model, "entries" can be extracted. For convenience, the model provides a default entry. Models have a unique model identifier that faciliates checking whether entries are compatible with it (i.e.: have been extracted from that model). A model needs to be frozen before it can be used to create a live ntuple.

Definition at line 46 of file RNTupleModel.hxx.

Public Member Functions

 RNTupleModel ()
 
 RNTupleModel (const RNTupleModel &)=delete
 
 ~RNTupleModel ()=default
 
template<typename T >
void AddField (std::string_view fieldName, T *fromWhere)
 
void AddField (std::unique_ptr< Detail::RFieldBase > field)
 Adds a field whose type is not known at compile time. Thus there is no shared pointer returned. More...
 
RNTupleModelClone ()
 
std::unique_ptr< REntryCreateEntry ()
 
template<typename T >
T * Get (std::string_view fieldName)
 
REntryGetDefaultEntry ()
 
RFieldRootGetRootField ()
 
std::shared_ptr< RCollectionNTupleMakeCollection (std::string_view fieldName, std::unique_ptr< RNTupleModel > collectionModel)
 Ingests a model for a sub collection and attaches it to the current model. More...
 
template<typename T , typename... ArgsT>
std::shared_ptr< T > MakeField (std::string_view fieldName, ArgsT &&... args)
 Creates a new field and a corresponding tree value that is managed by a shared pointer. More...
 
RNTupleModeloperator= (const RNTupleModel &)=delete
 

Static Public Member Functions

static std::unique_ptr< RNTupleModelCreate ()
 

Private Attributes

std::unique_ptr< REntryfDefaultEntry
 Contains field values corresponding to the created top-level fields. More...
 
std::unique_ptr< RFieldRootfRootField
 Hierarchy of fields consisting of simple types and collections (sub trees) More...
 

#include <ROOT/RNTupleModel.hxx>

Constructor & Destructor Documentation

◆ RNTupleModel() [1/2]

ROOT::Experimental::RNTupleModel::RNTupleModel ( )

Definition at line 27 of file RNTupleModel.cxx.

◆ RNTupleModel() [2/2]

ROOT::Experimental::RNTupleModel::RNTupleModel ( const RNTupleModel )
delete

◆ ~RNTupleModel()

ROOT::Experimental::RNTupleModel::~RNTupleModel ( )
default

Member Function Documentation

◆ AddField() [1/2]

template<typename T >
void ROOT::Experimental::RNTupleModel::AddField ( std::string_view  fieldName,
T *  fromWhere 
)
inline

Definition at line 74 of file RNTupleModel.hxx.

◆ AddField() [2/2]

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

Adds a field whose type is not known at compile time. Thus there is no shared pointer returned.

Definition at line 42 of file RNTupleModel.cxx.

◆ Clone()

ROOT::Experimental::RNTupleModel * ROOT::Experimental::RNTupleModel::Clone ( )

Definition at line 32 of file RNTupleModel.cxx.

◆ Create()

static std::unique_ptr< RNTupleModel > ROOT::Experimental::RNTupleModel::Create ( )
inlinestatic

Definition at line 59 of file RNTupleModel.hxx.

◆ CreateEntry()

std::unique_ptr< ROOT::Experimental::REntry > ROOT::Experimental::RNTupleModel::CreateEntry ( )

Definition at line 59 of file RNTupleModel.cxx.

◆ Get()

template<typename T >
T * ROOT::Experimental::RNTupleModel::Get ( std::string_view  fieldName)
inline

Definition at line 81 of file RNTupleModel.hxx.

◆ GetDefaultEntry()

REntry * ROOT::Experimental::RNTupleModel::GetDefaultEntry ( )
inline

Definition at line 91 of file RNTupleModel.hxx.

◆ GetRootField()

RFieldRoot * ROOT::Experimental::RNTupleModel::GetRootField ( )
inline

Definition at line 90 of file RNTupleModel.hxx.

◆ MakeCollection()

std::shared_ptr< ROOT::Experimental::RCollectionNTuple > ROOT::Experimental::RNTupleModel::MakeCollection ( std::string_view  fieldName,
std::unique_ptr< RNTupleModel collectionModel 
)

Ingests a model for a sub collection and attaches it to the current model.

Definition at line 49 of file RNTupleModel.cxx.

◆ MakeField()

template<typename T , typename... ArgsT>
std::shared_ptr< T > ROOT::Experimental::RNTupleModel::MakeField ( std::string_view  fieldName,
ArgsT &&...  args 
)
inline

Creates a new field and a corresponding tree value that is managed by a shared pointer.

Definition at line 63 of file RNTupleModel.hxx.

◆ operator=()

RNTupleModel & ROOT::Experimental::RNTupleModel::operator= ( const RNTupleModel )
delete

Member Data Documentation

◆ fDefaultEntry

std::unique_ptr<REntry> ROOT::Experimental::RNTupleModel::fDefaultEntry
private

Contains field values corresponding to the created top-level fields.

Definition at line 50 of file RNTupleModel.hxx.

◆ fRootField

std::unique_ptr<RFieldRoot> ROOT::Experimental::RNTupleModel::fRootField
private

Hierarchy of fields consisting of simple types and collections (sub trees)

Definition at line 48 of file RNTupleModel.hxx.

Libraries for ROOT::Experimental::RNTupleModel:
[legend]

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