11#ifndef ROOT_RDF_RCOLUMNREGISTER
12#define ROOT_RDF_RCOLUMNREGISTER
17#include <unordered_map>
45 using DefinesMap_t = std::unordered_map<std::string, std::shared_ptr<RDFDetail::RDefineBase>>;
47 using VariationsMap_t = std::unordered_multimap<std::string, std::shared_ptr<RVariationBase>>;
66 std::shared_ptr<const std::unordered_map<std::string, std::string>>
fAliases;
80 fAliases(std::make_shared<std::unordered_map<std::string, std::string>>()),
104 void AddColumn(
const std::shared_ptr<RDFDetail::RDefineBase> &column);
107 void AddAlias(std::string_view alias, std::string_view colName);
121 void AddVariation(
const std::shared_ptr<RVariationBase> &variation);
A binder for user-defined columns and aliases.
std::unordered_multimap< std::string, std::shared_ptr< RVariationBase > > VariationsMap_t
See fVariations for more information on this type.
RColumnRegister & operator=(const RColumnRegister &)=default
std::shared_ptr< const std::unordered_map< std::string, std::string > > fAliases
Immutable map of Aliases, can be shared among several nodes.
void AddVariation(const std::shared_ptr< RVariationBase > &variation)
Register a new systematic variation.
RColumnRegister(std::shared_ptr< RDFDetail::RLoopManager > lm)
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.
const DefinesMap_t & GetColumns() const
Returns a map of pointers to the defined columns.
std::shared_ptr< const VariationsMap_t > fVariations
Immutable multimap of Variations, can be shared among several nodes.
std::shared_ptr< const DefinesMap_t > fDefines
Immutable map of Defines, can be shared among several nodes.
bool HasName(std::string_view name) const
Check if the provided name is tracked in the names list.
void Clear()
Empty the contents of this ledger.
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.
void AddColumn(const std::shared_ptr< RDFDetail::RDefineBase > &column)
Add a new booked column.
const VariationsMap_t & GetVariations() const
Returns the multimap of systematic variations, see fVariations.
RVariationBase & FindVariation(const std::string &colName, const std::string &variationName) const
Return the RVariation object that handles the specified variation of the specified column.
RColumnRegister(const RColumnRegister &)=default
RColumnRegister(RColumnRegister &&)=default
std::unordered_map< std::string, std::shared_ptr< RDFDetail::RDefineBase > > DefinesMap_t
std::vector< std::string > GetVariationDeps(const std::string &column) const
Get the names of all variations that directly or indirectly affect a given column.
ColumnNames_t GetNames() const
Returns the list of the names of the defined columns (Defines + Aliases).
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
void AddName(std::string_view name)
Add a new name to the list returned by GetNames without booking a new column.
This type includes all parts of RVariation that do not depend on the callable signature.
std::vector< std::string > ColumnNames_t
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...