Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RMetaData.hxx
Go to the documentation of this file.
1// Author: Ivan Kabadzhov CERN 10/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
11#ifndef ROOT_RDF_RMETADATA
12#define ROOT_RDF_RMETADATA
13
14#include <nlohmann/json.hpp>
15#include <string>
16
17namespace ROOT {
18namespace RDF {
19namespace Experimental {
20
21/**
22\class ROOT::RDF::Experimental::RMetaData
23\ingroup dataframe
24\brief Class behaving as a heterogenuous dictionary to store dataset metadata
25
26 This class should be passed to an RSample object which represents a single dataset sample.
27 Once a dataframe is built with RMetaData object, it could be accessed via DefinePerSample.
28*/
29class RMetaData {
31
32public:
33 void Add(const std::string &key, int val);
34 void Add(const std::string &key, double val);
35 void Add(const std::string &key, const std::string &val);
36
37 std::string Dump(const std::string &key) const; // always returns a string
38 int GetI(const std::string &key) const;
39 double GetD(const std::string &key) const;
40 std::string GetS(const std::string &key) const;
41 int GetI(const std::string &key, int defaultVal) const;
42 double GetD(const std::string &key, double defaultVal) const;
43 const std::string GetS(const std::string &key, const std::string &defaultVal) const;
44};
45
46} // namespace Experimental
47} // namespace RDF
48} // namespace ROOT
49
50#endif // ROOT_RDF_RMETADATA
Class behaving as a heterogenuous dictionary to store dataset metadata.
Definition RMetaData.hxx:29
std::string Dump(const std::string &key) const
Definition RMetaData.cxx:33
std::string GetS(const std::string &key) const
Definition RMetaData.cxx:56
void Add(const std::string &key, int val)
Definition RMetaData.cxx:18
double GetD(const std::string &key) const
Definition RMetaData.cxx:47
int GetI(const std::string &key) const
Definition RMetaData.cxx:38
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
basic_json<> json