Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::REntry Class Reference

The REntry is a collection of values in an RNTuple corresponding to a complete row in the data set.

The entry provides a memory-managed binder for a set of values read from fields in an RNTuple. The memory locations that are associated with values are managed through shared pointers.

Definition at line 54 of file REntry.hxx.

Public Types

using ConstIterator_t = decltype(fValues)::const_iterator
 

Public Member Functions

 REntry (const REntry &other)=delete
 
 REntry (REntry &&other)=default
 
 ~REntry ()=default
 
ConstIterator_t begin () const
 
template<typename T >
void BindRawPtr (ROOT::RFieldToken token, T *rawPtr)
 Bind the value for the field, referenced by token, to rawPtr.
 
template<typename T >
void BindRawPtr (std::string_view fieldName, T *rawPtr)
 Bind the value for the field, referenced by its name, to rawPtr.
 
template<typename T >
void BindValue (ROOT::RFieldToken token, std::shared_ptr< T > objPtr)
 Bind the value for the field, referenced by token, to objPtr.
 
template<typename T >
void BindValue (std::string_view fieldName, std::shared_ptr< T > objPtr)
 Bind the value for the field, referenced by its name, to objPtr.
 
void EmplaceNewValue (ROOT::RFieldToken token)
 Create a new value for the field referenced by token.
 
void EmplaceNewValue (std::string_view fieldName)
 Create a new value for the field referenced by its name.
 
ConstIterator_t end () const
 
std::uint64_t GetModelId () const
 
template<typename T >
std::shared_ptr< T > GetPtr (ROOT::RFieldToken token) const
 Get the (typed) pointer to the value for the field referenced by token.
 
template<typename T >
std::shared_ptr< T > GetPtr (std::string_view fieldName) const
 Get the (typed) pointer to the value for the field referenced by token.
 
std::uint64_t GetSchemaId () const
 
ROOT::RFieldToken GetToken (std::string_view fieldName) const
 The ordinal of the (sub)field fieldName; can be used in other methods to address the corresponding value.
 
const std::string & GetTypeName (ROOT::RFieldToken token) const
 
const std::string & GetTypeName (std::string_view fieldName) const
 
REntryoperator= (const REntry &other)=delete
 
REntryoperator= (REntry &&other)=default
 

Private Member Functions

 REntry ()=default
 Creation of entries can be done by the RNTupleModel, the RNTupleReader, or the RNTupleWriter.
 
 REntry (std::uint64_t modelId, std::uint64_t schemaId)
 
template<typename T >
std::shared_ptr< T > AddValue (ROOT::RField< T > &field)
 While building the entry, adds a new value for the field and returns the value's shared pointer.
 
void AddValue (ROOT::RFieldBase::RValue &&value)
 
std::size_t Append ()
 
void EnsureMatchingModel (ROOT::RFieldToken token) const
 
template<typename T >
void EnsureMatchingType (ROOT::RFieldToken token) const
 
const std::string & FindFieldName (ROOT::RFieldToken token) const
 This function has linear complexity, only use it for more helpful error messages!
 
void Read (ROOT::NTupleSize_t index)
 

Private Attributes

std::unordered_map< std::string, std::size_t > fFieldName2Token
 For fast lookup of token IDs given a (sub)field name present in the entry.
 
std::vector< std::string > fFieldTypes
 To ensure that the entry is standalone, a copy of all field types.
 
std::uint64_t fModelId = 0
 The entry must be linked to a specific model, identified by a model ID.
 
std::uint64_t fSchemaId = 0
 The entry and its tokens are also linked to a specific schema, identified by a schema ID.
 
std::vector< ROOT::RFieldBase::RValuefValues
 Corresponds to the fields of the linked model.
 

Friends

class Experimental::RNTupleChainProcessor
 
class Experimental::RNTupleFillContext
 
class Experimental::RNTupleJoinProcessor
 
class Experimental::RNTupleProcessor
 
class Experimental::RNTupleSingleProcessor
 
class RNTupleModel
 
class RNTupleReader
 

#include <ROOT/REntry.hxx>

Member Typedef Documentation

◆ ConstIterator_t

Definition at line 146 of file REntry.hxx.

Constructor & Destructor Documentation

◆ REntry() [1/4]

ROOT::REntry::REntry ( )
privatedefault

Creation of entries can be done by the RNTupleModel, the RNTupleReader, or the RNTupleWriter.

◆ REntry() [2/4]

ROOT::REntry::REntry ( std::uint64_t modelId,
std::uint64_t schemaId )
inlineexplicitprivate

Definition at line 77 of file REntry.hxx.

◆ REntry() [3/4]

ROOT::REntry::REntry ( const REntry & other)
delete

◆ REntry() [4/4]

ROOT::REntry::REntry ( REntry && other)
default

◆ ~REntry()

ROOT::REntry::~REntry ( )
default

Member Function Documentation

◆ AddValue() [1/2]

template<typename T >
std::shared_ptr< T > ROOT::REntry::AddValue ( ROOT::RField< T > & field)
inlineprivate

While building the entry, adds a new value for the field and returns the value's shared pointer.

Definition at line 88 of file REntry.hxx.

◆ AddValue() [2/2]

void ROOT::REntry::AddValue ( ROOT::RFieldBase::RValue && value)
inlineprivate

Definition at line 79 of file REntry.hxx.

◆ Append()

std::size_t ROOT::REntry::Append ( )
inlineprivate

Definition at line 104 of file REntry.hxx.

◆ begin()

ConstIterator_t ROOT::REntry::begin ( ) const
inline

Definition at line 256 of file REntry.hxx.

◆ BindRawPtr() [1/2]

template<typename T >
void ROOT::REntry::BindRawPtr ( ROOT::RFieldToken token,
T * rawPtr )
inline

Bind the value for the field, referenced by token, to rawPtr.

See also
BindRawPtr(std::string_view, T *)

Definition at line 202 of file REntry.hxx.

◆ BindRawPtr() [2/2]

template<typename T >
void ROOT::REntry::BindRawPtr ( std::string_view fieldName,
T * rawPtr )
inline

Bind the value for the field, referenced by its name, to rawPtr.

The caller retains ownership of the object and must ensure it is kept alive when reading or writing using the entry.

Note: if T = void, type checks are disabled. It is the caller's responsibility to match the field and object types.

Definition at line 217 of file REntry.hxx.

◆ BindValue() [1/2]

template<typename T >
void ROOT::REntry::BindValue ( ROOT::RFieldToken token,
std::shared_ptr< T > objPtr )
inline

Bind the value for the field, referenced by token, to objPtr.

See also
BindValue(std::string_view, std::shared_ptr<T>)

Definition at line 178 of file REntry.hxx.

◆ BindValue() [2/2]

template<typename T >
void ROOT::REntry::BindValue ( std::string_view fieldName,
std::shared_ptr< T > objPtr )
inline

Bind the value for the field, referenced by its name, to objPtr.

Ownership is shared with the caller and the object will be kept alive until it is replaced (by a call to EmplaceNewValue, BindValue, or BindRawPtr) or the entry is destructed.

Note: if T = void, type checks are disabled. It is the caller's responsibility to match the field and object types.

Definition at line 193 of file REntry.hxx.

◆ EmplaceNewValue() [1/2]

void ROOT::REntry::EmplaceNewValue ( ROOT::RFieldToken token)
inline

Create a new value for the field referenced by token.

Definition at line 165 of file REntry.hxx.

◆ EmplaceNewValue() [2/2]

void ROOT::REntry::EmplaceNewValue ( std::string_view fieldName)
inline

Create a new value for the field referenced by its name.

Definition at line 172 of file REntry.hxx.

◆ end()

ConstIterator_t ROOT::REntry::end ( ) const
inline

Definition at line 257 of file REntry.hxx.

◆ EnsureMatchingModel()

void ROOT::REntry::EnsureMatchingModel ( ROOT::RFieldToken token) const
inlineprivate

Definition at line 113 of file REntry.hxx.

◆ EnsureMatchingType()

template<typename T >
void ROOT::REntry::EnsureMatchingType ( ROOT::RFieldToken token) const
inlineprivate

Definition at line 135 of file REntry.hxx.

◆ FindFieldName()

const std::string & ROOT::REntry::FindFieldName ( ROOT::RFieldToken token) const
inlineprivate

This function has linear complexity, only use it for more helpful error messages!

Definition at line 122 of file REntry.hxx.

◆ GetModelId()

std::uint64_t ROOT::REntry::GetModelId ( ) const
inline

Definition at line 253 of file REntry.hxx.

◆ GetPtr() [1/2]

template<typename T >
std::shared_ptr< T > ROOT::REntry::GetPtr ( ROOT::RFieldToken token) const
inline

Get the (typed) pointer to the value for the field referenced by token.

See also
GetPtr(std::string_view)

Definition at line 226 of file REntry.hxx.

◆ GetPtr() [2/2]

template<typename T >
std::shared_ptr< T > ROOT::REntry::GetPtr ( std::string_view fieldName) const
inline

Get the (typed) pointer to the value for the field referenced by token.

Ownership is shared and the caller can continue to use the object after the entry is destructed.

Note: if T = void, type checks are disabled. It is the caller's responsibility to use the returned pointer according to the field type.

Definition at line 240 of file REntry.hxx.

◆ GetSchemaId()

std::uint64_t ROOT::REntry::GetSchemaId ( ) const
inline

Definition at line 254 of file REntry.hxx.

◆ GetToken()

ROOT::RFieldToken ROOT::REntry::GetToken ( std::string_view fieldName) const
inline

The ordinal of the (sub)field fieldName; can be used in other methods to address the corresponding value.

Definition at line 155 of file REntry.hxx.

◆ GetTypeName() [1/2]

const std::string & ROOT::REntry::GetTypeName ( ROOT::RFieldToken token) const
inline

Definition at line 245 of file REntry.hxx.

◆ GetTypeName() [2/2]

const std::string & ROOT::REntry::GetTypeName ( std::string_view fieldName) const
inline

Definition at line 251 of file REntry.hxx.

◆ operator=() [1/2]

REntry & ROOT::REntry::operator= ( const REntry & other)
delete

◆ operator=() [2/2]

REntry & ROOT::REntry::operator= ( REntry && other)
default

◆ Read()

void ROOT::REntry::Read ( ROOT::NTupleSize_t index)
inlineprivate

Definition at line 97 of file REntry.hxx.

Friends And Related Symbol Documentation

◆ Experimental::RNTupleChainProcessor

Definition at line 60 of file REntry.hxx.

◆ Experimental::RNTupleFillContext

Definition at line 57 of file REntry.hxx.

◆ Experimental::RNTupleJoinProcessor

Definition at line 61 of file REntry.hxx.

◆ Experimental::RNTupleProcessor

Definition at line 58 of file REntry.hxx.

◆ Experimental::RNTupleSingleProcessor

Definition at line 59 of file REntry.hxx.

◆ RNTupleModel

friend class RNTupleModel
friend

Definition at line 55 of file REntry.hxx.

◆ RNTupleReader

friend class RNTupleReader
friend

Definition at line 56 of file REntry.hxx.

Member Data Documentation

◆ fFieldName2Token

std::unordered_map<std::string, std::size_t> ROOT::REntry::fFieldName2Token
private

For fast lookup of token IDs given a (sub)field name present in the entry.

Definition at line 71 of file REntry.hxx.

◆ fFieldTypes

std::vector<std::string> ROOT::REntry::fFieldTypes
private

To ensure that the entry is standalone, a copy of all field types.

Definition at line 73 of file REntry.hxx.

◆ fModelId

std::uint64_t ROOT::REntry::fModelId = 0
private

The entry must be linked to a specific model, identified by a model ID.

Definition at line 65 of file REntry.hxx.

◆ fSchemaId

std::uint64_t ROOT::REntry::fSchemaId = 0
private

The entry and its tokens are also linked to a specific schema, identified by a schema ID.

Definition at line 67 of file REntry.hxx.

◆ fValues

std::vector<ROOT::RFieldBase::RValue> ROOT::REntry::fValues
private

Corresponds to the fields of the linked model.

Definition at line 69 of file REntry.hxx.

Libraries for ROOT::REntry:

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