Skip to content

Commit eb4f35b

Browse files
committed
[ntuple] Refactor RNTupleProcessor subclass ctors
Mostly to reflect the new argument order in the factory methods. In addition, the default values in the `RNTupleJoinProcessor` ctor are redundant (these arguments are always passed by the caller), so they have been removed.
1 parent f71066b commit eb4f35b

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

tree/ntuple/inc/ROOT/RNTupleProcessor.hxx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,11 @@ private:
392392
/// \brief Construct a new RNTupleProcessor for processing a single RNTuple.
393393
///
394394
/// \param[in] ntuple The source specification (name and storage location) for the RNTuple to process.
395+
/// \param[in] model The model that specifies which fields should be read by the processor.
395396
/// \param[in] processorName Name of the processor. Unless specified otherwise in RNTupleProcessor::Create, this is
396397
/// the name of the underlying RNTuple.
397-
/// \param[in] model The model that specifies which fields should be read by the processor.
398-
RNTupleSingleProcessor(RNTupleOpenSpec ntuple, std::string_view processorName,
399-
std::unique_ptr<ROOT::RNTupleModel> model);
398+
RNTupleSingleProcessor(RNTupleOpenSpec ntuple, std::unique_ptr<ROOT::RNTupleModel> model,
399+
std::string_view processorName);
400400

401401
public:
402402
RNTupleSingleProcessor(const RNTupleSingleProcessor &) = delete;
@@ -447,15 +447,15 @@ private:
447447
/// \brief Construct a new RNTupleChainProcessor.
448448
///
449449
/// \param[in] ntuples The source specification (name and storage location) for each RNTuple to process.
450-
/// \param[in] processorName Name of the processor. Unless specified otherwise in RNTupleProcessor::CreateChain, this
451-
/// is the name of the first inner processor.
452450
/// \param[in] model The model that specifies which fields should be read by the processor. The pointer returned by
453451
/// RNTupleModel::MakeField can be used to access a field's value during the processor iteration. When no model is
454452
/// specified, it is created from the descriptor of the first RNTuple specified in `ntuples`.
453+
/// \param[in] processorName Name of the processor. Unless specified otherwise in RNTupleProcessor::CreateChain, this
454+
/// is the name of the first inner processor.
455455
///
456456
/// RNTuples are processed in the order in which they are specified.
457-
RNTupleChainProcessor(std::vector<std::unique_ptr<RNTupleProcessor>> processors, std::string_view processorName,
458-
std::unique_ptr<ROOT::RNTupleModel> model);
457+
RNTupleChainProcessor(std::vector<std::unique_ptr<RNTupleProcessor>> processors,
458+
std::unique_ptr<ROOT::RNTupleModel> model, std::string_view processorName);
459459

460460
public:
461461
RNTupleChainProcessor(const RNTupleChainProcessor &) = delete;
@@ -526,19 +526,18 @@ private:
526526
/// \param[in] joinFields The names of the fields on which to join, in case the specified processors are unaligned.
527527
/// The join is made based on the combined join field values, and therefore each field has to be present in each
528528
/// specified processor. If an empty list is provided, it is assumed that the processors are fully aligned.
529-
/// \param[in] processorName Name of the processor. Unless specified otherwise in RNTupleProcessor::CreateJoin, this
530-
/// is the name of the primary processor.
531529
/// \param[in] primaryModel An RNTupleModel specifying which fields from the primary processor can be read by the
532530
/// processor. If no model is provided, one will be created based on the descriptor of the primary processor.
533531
/// \param[in] auxModels A list of RNTupleModels specifying which fields from the corresponding auxiliary processor
534532
/// (according to the order of `auxProcessors`) can be read by the processor. If this vector is empty, the models
535533
/// will be inferred from their corresponding processors. This also applies to individual auxiliary processors for
536534
/// which the provided model is a `nullptr`.
535+
/// \param[in] processorName Name of the processor. Unless specified otherwise in RNTupleProcessor::CreateJoin, this
536+
/// is the name of the primary processor.
537537
RNTupleJoinProcessor(std::unique_ptr<RNTupleProcessor> primaryProcessor,
538538
std::vector<std::unique_ptr<RNTupleProcessor>> auxProcessors,
539-
const std::vector<std::string> &joinFields, std::string_view processorName,
540-
std::unique_ptr<ROOT::RNTupleModel> primaryModel = nullptr,
541-
std::vector<std::unique_ptr<ROOT::RNTupleModel>> auxModels = {});
539+
const std::vector<std::string> &joinFields, std::unique_ptr<ROOT::RNTupleModel> primaryModel,
540+
std::vector<std::unique_ptr<ROOT::RNTupleModel>> auxModels, std::string_view processorName);
542541

543542
public:
544543
RNTupleJoinProcessor(const RNTupleJoinProcessor &) = delete;

tree/ntuple/src/RNTupleProcessor.cxx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ROOT::Experimental::RNTupleProcessor::Create(RNTupleOpenSpec ntuple, std::unique
3636
std::string_view processorName)
3737
{
3838
return std::unique_ptr<RNTupleSingleProcessor>(
39-
new RNTupleSingleProcessor(std::move(ntuple), processorName, std::move(model)));
39+
new RNTupleSingleProcessor(std::move(ntuple), std::move(model), processorName));
4040
}
4141

4242
std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
@@ -78,7 +78,7 @@ ROOT::Experimental::RNTupleProcessor::CreateChain(std::vector<std::unique_ptr<RN
7878
}
7979

8080
return std::unique_ptr<RNTupleChainProcessor>(
81-
new RNTupleChainProcessor(std::move(innerProcessors), processorName, std::move(model)));
81+
new RNTupleChainProcessor(std::move(innerProcessors), std::move(model), processorName));
8282
}
8383

8484
std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
@@ -145,15 +145,15 @@ std::unique_ptr<ROOT::Experimental::RNTupleProcessor> ROOT::Experimental::RNTupl
145145
}
146146

147147
return std::unique_ptr<RNTupleJoinProcessor>(
148-
new RNTupleJoinProcessor(std::move(primaryProcessor), std::move(auxProcessors), joinFields, processorName,
149-
std::move(primaryModel), std::move(auxModels)));
148+
new RNTupleJoinProcessor(std::move(primaryProcessor), std::move(auxProcessors), joinFields,
149+
std::move(primaryModel), std::move(auxModels), processorName));
150150
}
151151

152152
//------------------------------------------------------------------------------
153153

154154
ROOT::Experimental::RNTupleSingleProcessor::RNTupleSingleProcessor(RNTupleOpenSpec ntuple,
155-
std::string_view processorName,
156-
std::unique_ptr<ROOT::RNTupleModel> model)
155+
std::unique_ptr<ROOT::RNTupleModel> model,
156+
std::string_view processorName)
157157
: RNTupleProcessor(processorName, std::move(model)), fNTupleSpec(std::move(ntuple))
158158
{
159159
if (!fModel) {
@@ -251,8 +251,8 @@ void ROOT::Experimental::RNTupleSingleProcessor::AddEntriesToJoinTable(Internal:
251251
//------------------------------------------------------------------------------
252252

253253
ROOT::Experimental::RNTupleChainProcessor::RNTupleChainProcessor(
254-
std::vector<std::unique_ptr<RNTupleProcessor>> processors, std::string_view processorName,
255-
std::unique_ptr<ROOT::RNTupleModel> model)
254+
std::vector<std::unique_ptr<RNTupleProcessor>> processors, std::unique_ptr<ROOT::RNTupleModel> model,
255+
std::string_view processorName)
256256
: RNTupleProcessor(processorName, std::move(model)), fInnerProcessors(std::move(processors))
257257
{
258258
if (fProcessorName.empty()) {
@@ -357,8 +357,8 @@ void ROOT::Experimental::RNTupleChainProcessor::AddEntriesToJoinTable(Internal::
357357

358358
ROOT::Experimental::RNTupleJoinProcessor::RNTupleJoinProcessor(
359359
std::unique_ptr<RNTupleProcessor> primaryProcessor, std::vector<std::unique_ptr<RNTupleProcessor>> auxProcessors,
360-
const std::vector<std::string> &joinFields, std::string_view processorName,
361-
std::unique_ptr<ROOT::RNTupleModel> primaryModel, std::vector<std::unique_ptr<ROOT::RNTupleModel>> auxModels)
360+
const std::vector<std::string> &joinFields, std::unique_ptr<ROOT::RNTupleModel> primaryModel,
361+
std::vector<std::unique_ptr<ROOT::RNTupleModel>> auxModels, std::string_view processorName)
362362
: RNTupleProcessor(processorName, nullptr),
363363
fPrimaryProcessor(std::move(primaryProcessor)),
364364
fAuxiliaryProcessors(std::move(auxProcessors))

0 commit comments

Comments
 (0)