29 static const std::string empty =
"";
33std::optional<ROOT::Experimental::Internal::RNTupleProcessorEntry::FieldIndex_t>
35 std::string_view typeName)
const
42 const auto &fieldIdxs = it->second;
43 assert(!fieldIdxs.empty());
45 for (
auto idx : fieldIdxs) {
56 std::unique_ptr<ROOT::RFieldBase> field,
void *valuePtr,
59 auto fieldNameWithProcessorPrefix = qualifiedFieldName;
60 if (
const auto &processorPrefix = provenance.
Get(); !processorPrefix.empty())
61 fieldNameWithProcessorPrefix = processorPrefix +
"." + qualifiedFieldName;
63 if (
FindFieldIndex(fieldNameWithProcessorPrefix, field->GetTypeName()))
64 throw ROOT::RException(
R__FAIL(
"field \"" + fieldNameWithProcessorPrefix +
"\" is already present in the entry"));
70 auto value = field->CreateValue();
72 value.BindRawPtr(valuePtr);
80 std::unique_ptr<ROOT::RFieldBase> field)
87 auto newValue = field->CreateValue();
88 auto currValuePtr = fieldInfo.fValue.GetPtr<
void>();
89 newValue.Bind(currValuePtr);
90 fieldInfo.fField = std::move(field);
91 fieldInfo.fValue = std::move(newValue);
92 fieldInfo.fIsValid =
true;
94 fieldInfo.fIsValid =
false;
113std::unordered_set<ROOT::Experimental::Internal::RNTupleProcessorEntry::FieldIndex_t>
119 std::generate_n(std::inserter(fieldIdxs, fieldIdxs.begin()),
fProcessorValues.size(),
120 [i = 0]()
mutable { return i++; });
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
std::unordered_set< FieldIndex_t > GetFieldIndices() const
Get all field indices of this entry.
std::uint64_t FieldIndex_t
std::vector< RProcessorValue > fProcessorValues
std::optional< FieldIndex_t > FindFieldIndex(std::string_view canonicalFieldName, std::string_view typeName) const
Find the field index of the provided field in the entry.
std::unordered_map< std::string, std::vector< FieldIndex_t > > fFieldName2Index
void BindRawPtr(FieldIndex_t fieldIdx, void *valuePtr)
Bind a new value pointer to a field in the entry.
void UpdateField(FieldIndex_t fieldIdx, std::unique_ptr< ROOT::RFieldBase > field)
Update a field in the entry, preserving the value pointer.
const std::string & FindFieldName(FieldIndex_t fieldIdx) const
Find the name of a field from its field index.
void ReadValue(FieldIndex_t fieldIdx, ROOT::NTupleSize_t entryIdx)
Read the field value corresponding to the given field index for the provided entry index.
FieldIndex_t AddField(const std::string &qualifiedFieldName, std::unique_ptr< ROOT::RFieldBase > field, void *valuePtr, const RNTupleProcessorProvenance &provenance)
Add a new field to the entry.
std::string Get() const
Get the full processor provenance, in the form of "x.y.z".
Base class for all ROOT issued exceptions.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.