Skip to content

Commit 628a891

Browse files
committed
[ntuple] add cloning for RImplSimple-based writer
1 parent 5fb82a8 commit 628a891

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tree/ntuple/src/RMiniFile.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,14 @@ ROOT::Internal::RNTupleFileWriter::CloneWithDifferentName(std::string_view ntupl
13261326
{
13271327
if (auto *file = std::get_if<RImplTFile>(&fFile)) {
13281328
return Append(ntupleName, *file->fDirectory, fNTupleAnchor.fMaxKeySize);
1329+
} else if (auto *file = std::get_if<RImplSimple>(&fFile)) {
1330+
auto writer = std::unique_ptr<RNTupleFileWriter>(new RNTupleFileWriter(ntupleName, fNTupleAnchor.GetMaxKeySize()));
1331+
auto &clonedFile = std::get<RImplSimple>(writer->fFile);
1332+
clonedFile.fShared = file->fShared;
1333+
clonedFile.fDirectIO = file->fDirectIO;
1334+
// TODO: use passed options
1335+
clonedFile.AllocateBuffers(RNTupleWriteOptions().GetWriteBufferSize());
1336+
return writer;
13291337
}
13301338
// TODO: support also non-TFile-based writers
13311339
throw ROOT::RException(R__FAIL("cannot clone a non-TFile-based RNTupleFileWriter."));

0 commit comments

Comments
 (0)