Logo ROOT  
Reference Guide
RDFDescription.cxx
Go to the documentation of this file.
1// Author: Ivan Kabadzhov, Enrico Guiraud CERN 01/2022
2
3/*************************************************************************
4 * Copyright (C) 1995-2022, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
12#include <iostream>
13
14namespace ROOT {
15namespace RDF {
16
17RDFDescription::RDFDescription(const std::string &briefDescription, const std::string &fullDescription)
18 : fBriefDescription(briefDescription), fFullDescription(fullDescription){};
19
20std::string RDFDescription::AsString(bool shortFormat /*= false*/) const
21{
22 if (shortFormat)
23 return fBriefDescription;
24 else
25 return fBriefDescription + "\n\n" + fFullDescription;
26}
27
28void RDFDescription::Print(bool shortFormat /*= false*/) const
29{
30 std::cout << AsString(shortFormat);
31}
32
33std::ostream &operator<<(std::ostream &os, const RDFDescription &description)
34{
35 os << description.AsString();
36 return os;
37}
38
39} // namespace RDF
40} // namespace ROOT
41
42namespace cling {
43//////////////////////////////////////////////////////////////////////////
44/// Print an RDFDescription at the prompt
45std::string printValue(ROOT::RDF::RDFDescription *td)
46{
47 return td->AsString();
48}
49
50} // namespace cling
A DFDescription contains useful information about a given RDataFrame computation graph.
RDFDescription(const std::string &briefDescription, const std::string &fullDescription)
std::string AsString(bool shortFormat=false) const
void Print(bool shortFormat=false) const
std::ostream & operator<<(std::ostream &os, const RDFDescription &description)
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.