Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
IOptions.cxx
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023, CERN
3 */
4
5#include <Math/IOptions.h>
6
7#include <Math/Error.h>
8
9namespace ROOT {
10namespace Math {
11
12double IOptions::RValue(const char *name) const
13{
14 double val = 0;
15 bool ret = GetRealValue(name, val);
16 if (!ret)
17 MATH_ERROR_MSGVAL("IOptions::RValue", " return 0 - real option not found", name);
18 return val;
19}
20
21int IOptions::IValue(const char *name) const
22{
23 int val = 0;
24 bool ret = GetIntValue(name, val);
25 if (!ret)
26 MATH_ERROR_MSGVAL("IOptions::IValue", " return 0 - integer option not found", name);
27 return val;
28}
29
30std::string IOptions::NamedValue(const char *name) const
31{
32 std::string val;
33 bool ret = GetNamedValue(name, val);
34 if (!ret)
35 MATH_ERROR_MSGVAL("IOptions::NamedValue", " return empty string - named option not found", name);
36 return val;
37}
38
39/// method which need to be re-implemented by the derived classes
40void IOptions::SetRealValue(const char *, double)
41{
42 MATH_ERROR_MSG("IOptions::SetRealValue", "Invalid setter method called");
43}
44
45void IOptions::SetIntValue(const char *, int)
46{
47 MATH_ERROR_MSG("IOptions::SetIntValue", "Invalid setter method called");
48}
49
50void IOptions::SetNamedValue(const char *, const char *)
51{
52 MATH_ERROR_MSG("IOptions::SetNamedValue", "Invalid setter method called");
53}
54
55/// print options
56void IOptions::Print(std::ostream &) const
57{
58 MATH_INFO_MSG("IOptions::Print", "it is not implemented");
59}
60
61} // namespace Math
62} // namespace ROOT
#define MATH_INFO_MSG(loc, str)
Pre-processor macro to report messages which can be configured to use ROOT error or simply an std::io...
Definition Error.h:77
#define MATH_ERROR_MSGVAL(loc, txt, x)
Definition Error.h:109
#define MATH_ERROR_MSG(loc, str)
Definition Error.h:83
char name[80]
Definition TGX11.cxx:110
virtual bool GetIntValue(const char *, int &) const
Definition IOptions.h:64
virtual void SetIntValue(const char *, int)
Definition IOptions.cxx:45
double RValue(const char *name) const
Definition IOptions.cxx:12
std::string NamedValue(const char *name) const
Definition IOptions.cxx:30
virtual void SetRealValue(const char *, double)
method which need to be re-implemented by the derived classes
Definition IOptions.cxx:40
int IValue(const char *name) const
Definition IOptions.cxx:21
virtual bool GetRealValue(const char *, double &) const
Definition IOptions.h:63
virtual void SetNamedValue(const char *, const char *)
Definition IOptions.cxx:50
virtual bool GetNamedValue(const char *, std::string &) const
Definition IOptions.h:65
virtual void Print(std::ostream &=std::cout) const
print options
Definition IOptions.cxx:56
Namespace for new Math classes and functions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...