You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to write (something equivalent to) the following:
auto m = RNTupleModel::Create();
auto field = RFieldBase::Create("v", "ROOT::VecOps::RVec<int>").Unwrap();
ROOT::RVec<int> rvec = {1, 2, 3};
m->AddField(std::move(field), (void*)&rvec);
auto w = RNTupleWriter::Recreate(std::move(m), "r", "somefile.root");
but that RNTupleModel::AddField signature is missing and I could not find another way to do this correctly.
For example the following example code adds a single field to the model ("v") but it adds two corresponding RFieldValues to model->GetDefaultEntry(), one explicitly with m->GetDefaultEntry()->CaptureValue() and one implicitly with the m->AddField(std::move(field)) call.
// write out RVec
{
auto m = RNTupleModel::Create();
auto field = RFieldBase::Create("v", "ROOT::VecOps::RVec<int>").Unwrap();
ROOT::RVec<int> rvec = {1, 2, 3};
m->GetDefaultEntry()->CaptureValue(field->CaptureValue(&rvec));
m->AddField(std::move(field));
auto w = RNTupleWriter::Recreate(std::move(m), "r", fileGuard.GetPath());
w->Fill();
rvec.clear();
rvec.push_back(42);
w->Fill();
}
The text was updated successfully, but these errors were encountered:
It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.
I would like to write (something equivalent to) the following:
but that
RNTupleModel::AddField
signature is missing and I could not find another way to do this correctly.For example the following example code adds a single field to the model ("v") but it adds two corresponding RFieldValues to
model->GetDefaultEntry()
, one explicitly withm->GetDefaultEntry()->CaptureValue()
and one implicitly with them->AddField(std::move(field))
call.The text was updated successfully, but these errors were encountered: