Logo ROOT  
Reference Guide
RNTupleMetrics.cxx
Go to the documentation of this file.
1/// \file RNTupleMetrics.cxx
2/// \ingroup NTuple ROOT7
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2019-08-27
5/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6/// is welcome!
7
8/*************************************************************************
9 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
17
18#include <ostream>
19
21{
22}
23
25{
26 return fName + kFieldSeperator + fUnit + kFieldSeperator + fDescription + kFieldSeperator + ValueToString();
27}
28
30{
31 for (const auto &c : fCounters) {
32 if (c->GetName() == name)
33 return true;
34 }
35 return false;
36}
37
38void ROOT::Experimental::Detail::RNTupleMetrics::Print(std::ostream &output, const std::string &prefix) const
39{
40 if (!fIsEnabled) {
41 output << fName << " metrics disabled!" << std::endl;
42 return;
43 }
44
45 for (const auto &c : fCounters) {
46 output << prefix << fName << kNamespaceSeperator << c->ToString() << std::endl;
47 }
48 for (const auto c : fObservedMetrics) {
49 c->Print(output, prefix + fName + ".");
50 }
51}
52
54{
55 for (auto &c: fCounters)
56 c->Enable();
57 fIsEnabled = true;
58 for (auto m: fObservedMetrics)
59 m->Enable();
60}
61
63{
64 fObservedMetrics.push_back(&observee);
65}
#define c(i)
Definition: RSha256.hxx:101
char name[80]
Definition: TGX11.cxx:109
A collection of Counter objects with a name, a unit, and a description.
void ObserveMetrics(RNTupleMetrics &observee)
bool Contains(const std::string &name) const
void Print(std::ostream &output, const std::string &prefix="") const
auto * m
Definition: textangle.C:8
static void output(int code)
Definition: gifencode.c:226