Logo ROOT  
Reference Guide
RDFBookedDefines.cxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
10
11namespace ROOT {
12namespace Internal {
13namespace RDF {
14
16{
17 const auto ccolnamesEnd = fDefinesNames->end();
18 return ccolnamesEnd != std::find(fDefinesNames->begin(), ccolnamesEnd, name);
19}
20
21void RBookedDefines::AddColumn(const std::shared_ptr<RDFDetail::RDefineBase> &column, std::string_view name)
22{
23 auto newCols = std::make_shared<RDefineBasePtrMap_t>(GetColumns());
24 const std::string colName(name);
25 (*newCols)[colName] = column;
26 fDefines = newCols;
27 AddName(colName);
28}
29
31{
32 const auto &names = GetNames();
33 if (std::find(names.begin(), names.end(), name) != names.end())
34 return; // must be a Redefine of an existing column. Nothing to do.
35
36 auto newColsNames = std::make_shared<ColumnNames_t>(names);
37 newColsNames->emplace_back(std::string(name));
38 fDefinesNames = newColsNames;
39}
40
41} // namespace RDF
42} // namespace Internal
43} // namespace ROOT
char name[80]
Definition: TGX11.cxx:110
bool HasName(std::string_view name) const
Check if the provided name is tracked in the names list.
void AddColumn(const std::shared_ptr< RDFDetail::RDefineBase > &column, std::string_view name)
Add a new booked column.
const RDefineBasePtrMap_t & GetColumns() const
Returns the list of the pointers to the defined columns.
ColumnNames_t GetNames() const
Returns the list of the names of the defined columns.
void AddName(std::string_view name)
Add a new name to the list returned by GetNames without booking a new column.
basic_string_view< char > string_view
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...