11#ifndef ROOT_RDF_RCOLUMNREGISTER
12#define ROOT_RDF_RCOLUMNREGISTER
17#include <unordered_map>
24class RVariationsDescription;
41class RVariationReader;
91 using DefinesMap_t = std::unordered_map<std::string, std::shared_ptr<RDefinesWithReaders>>;
93 using VariationsMap_t = std::unordered_multimap<std::string, std::shared_ptr<RVariationsWithReaders>>;
101 std::shared_ptr<const std::unordered_map<std::string, std::string>>
fAliases;
131 void AddDefine(std::shared_ptr<RDFDetail::RDefineBase> column);
133 void AddAlias(std::string_view alias, std::string_view colName);
139 void AddVariation(std::shared_ptr<RVariationBase> variation);
150 const std::string &variationName,
const std::type_info &tid);
Pure virtual base class for all column reader types.
A binder for user-defined columns, variations and aliases.
bool IsDefineOrAlias(std::string_view name) const
Check if the provided name is tracked in the names list.
RColumnRegister & operator=(const RColumnRegister &)=default
ColumnNames_t BuildDefineNames() const
Return the list of the names of defined columns (no aliases).
std::shared_ptr< const std::unordered_map< std::string, std::string > > fAliases
Immutable map of Aliases, can be shared among several nodes.
RDFDetail::RDefineBase * GetDefine(const std::string &colName) const
Return the RDefine for the requested column name, or nullptr.
bool IsAlias(const std::string &name) const
Return true if the given column name is an existing alias.
std::vector< std::string > GetVariationsFor(const std::string &column) const
Get the names of the variations that directly provide alternative values for this column.
RDFDetail::RColumnReaderBase * GetReader(unsigned int slot, const std::string &colName, const std::string &variationName, const std::type_info &tid)
Return a RDefineReader or a RVariationReader, or nullptr if not available.
std::shared_ptr< const ColumnNames_t > fColumnNames
Names of Defines and Aliases registered so far.
std::string ResolveAlias(std::string_view alias) const
Return the actual column name that the alias resolves to.
std::unordered_multimap< std::string, std::shared_ptr< RVariationsWithReaders > > VariationsMap_t
See fVariations for more information on this type.
void AddVariation(std::shared_ptr< RVariationBase > variation)
Register a new systematic variation.
std::shared_ptr< VariationsMap_t > fVariations
Immutable multimap of Variations, can be shared among several nodes.
void AddDefine(std::shared_ptr< RDFDetail::RDefineBase > column)
Add a new defined column.
RColumnRegister(const RColumnRegister &)=default
RColumnRegister(RColumnRegister &&)=default
std::vector< std::string > GetVariationDeps(const std::string &column) const
Get the names of all variations that directly or indirectly affect a given column.
ROOT::RDF::RVariationsDescription BuildVariationsDescription() const
ColumnNames_t GetNames() const
Return the list of the names of the defined columns (Defines + Aliases).
std::shared_ptr< DefinesMap_t > fDefines
Immutable collection of Defines, can be shared among several nodes.
void AddAlias(std::string_view alias, std::string_view colName)
Add a new alias to the ledger.
std::shared_ptr< RDFDetail::RLoopManager > fLoopManager
std::vector< std::string > ColumnNames_t
RVariationsWithReaders * FindVariationAndReaders(const std::string &colName, const std::string &variationName)
Return the RVariationsWithReaders object that handles the specified variation of the specified column...
void AddName(std::string_view name)
Add a new name to the list returned by GetNames without booking a new column.
std::unordered_map< std::string, std::shared_ptr< RDefinesWithReaders > > DefinesMap_t
Column reader for defined columns.
A helper type that keeps track of RDefine objects and their corresponding RDefineReaders.
std::vector< std::unordered_map< std::string, std::unique_ptr< RDefineReader > > > fReadersPerVariation
RDefineBase & GetDefine() const
RDefineReader & GetReader(unsigned int slot, const std::string &variationName)
std::shared_ptr< RDefineBase > fDefine
This type includes all parts of RVariation that do not depend on the callable signature.
Column reader that reads the value for a specific column, variation and slot.
std::vector< std::unordered_map< std::string, std::unique_ptr< RVariationReader > > > fReadersPerVariation
RVariationReader & GetReader(unsigned int slot, const std::string &colName, const std::string &variationName)
Return a column reader for the given slot, column and variation.
std::shared_ptr< RVariationBase > fVariation
RVariationBase & GetVariation() const
A descriptor for the systematic variations known to a given RDataFrame node.
std::vector< std::string > ColumnNames_t
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.