BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ROOT::Math::IOptions Class Referenceabstract

Description

Generic interface for defining configuration options of a numerical algorithm

Definition at line 30 of file IOptions.h.

Inheritance diagram for ROOT::Math::IOptions:
[legend]

Public Member Functions

 IOptions ()
 
virtual ~IOptions ()
 
virtual IOptionsClone () const =0
 
virtual bool GetIntValue (const char *, int &) const
 
virtual bool GetNamedValue (const char *, std::string &) const
 
virtual bool GetRealValue (const char *, double &) const
 
template<typename T >
bool GetValue (const char *name, T &t) const
 
int IValue (const char *name) const
 
std::string NamedValue (const char *name) const
 
virtual void Print (std::ostream &=std::cout) const
 print options More...
 
double RValue (const char *name) const
 
virtual void SetIntValue (const char *, int)
 
virtual void SetNamedValue (const char *, const char *)
 
virtual void SetRealValue (const char *, double)
 method wich need to be re-implemented by the derived classes More...
 
void SetValue (const char *name, const char *val)
 
void SetValue (const char *name, double val)
 set option value More...
 
void SetValue (const char *name, int val)
 

Private Member Functions

bool DoGetValue (const char *name, double &val) const
 
bool DoGetValue (const char *name, int &val) const
 
bool DoGetValue (const char *name, std::string &val) const
 

Constructor & Destructor Documentation

◆ IOptions()

ROOT::Math::IOptions::IOptions ( )
inline

Definition at line 34 of file IOptions.h.

34 {}

◆ ~IOptions()

virtual ROOT::Math::IOptions::~IOptions ( )
inlinevirtual

Definition at line 36 of file IOptions.h.

36 {}// { if (fExtraOptions) delete fExtraOptions; }

Member Function Documentation

◆ Clone()

virtual IOptions* ROOT::Math::IOptions::Clone ( ) const
pure virtual

Implemented in ROOT::Math::GenAlgoOptions.

◆ DoGetValue() [1/3]

bool ROOT::Math::IOptions::DoGetValue ( const char *  name,
double &  val 
) const
inlineprivate

Definition at line 103 of file IOptions.h.

103 { return GetRealValue(name,val); }
virtual bool GetRealValue(const char *, double &) const
Definition: IOptions.h:83

References GetRealValue().

Referenced by GetValue().

Here is the call graph for this function:

◆ DoGetValue() [2/3]

bool ROOT::Math::IOptions::DoGetValue ( const char *  name,
int &  val 
) const
inlineprivate

Definition at line 105 of file IOptions.h.

105 { return GetIntValue(name,val); }
virtual bool GetIntValue(const char *, int &) const
Definition: IOptions.h:85

References GetIntValue().

Here is the call graph for this function:

◆ DoGetValue() [3/3]

bool ROOT::Math::IOptions::DoGetValue ( const char *  name,
std::string &  val 
) const
inlineprivate

Definition at line 107 of file IOptions.h.

107 { return GetNamedValue(name,val); }
virtual bool GetNamedValue(const char *, std::string &) const
Definition: IOptions.h:87

References GetNamedValue().

Here is the call graph for this function:

◆ GetIntValue()

virtual bool ROOT::Math::IOptions::GetIntValue ( const char *  ,
int &   
) const
inlinevirtual

Reimplemented in ROOT::Math::GenAlgoOptions.

Definition at line 85 of file IOptions.h.

85 { return false; }

Referenced by DoGetValue(), and IValue().

◆ GetNamedValue()

virtual bool ROOT::Math::IOptions::GetNamedValue ( const char *  ,
std::string &   
) const
inlinevirtual

Reimplemented in ROOT::Math::GenAlgoOptions.

Definition at line 87 of file IOptions.h.

87 { return false; }

Referenced by DoGetValue(), and NamedValue().

◆ GetRealValue()

virtual bool ROOT::Math::IOptions::GetRealValue ( const char *  ,
double &   
) const
inlinevirtual

Reimplemented in ROOT::Math::GenAlgoOptions.

Definition at line 83 of file IOptions.h.

83 { return false; }

Referenced by DoGetValue(), and RValue().

◆ GetValue()

template<typename T >
bool ROOT::Math::IOptions::GetValue ( const char *  name,
T &  t 
) const
inline

Definition at line 73 of file IOptions.h.

73  {
74  bool ret = DoGetValue(name, t);
75  //if (!ret ) MATH_ERROR_MSG("IOptions::GetValue","option is not existing - returns 0");
76  return ret;
77  }
bool DoGetValue(const char *name, double &val) const
Definition: IOptions.h:103

References DoGetValue().

Here is the call graph for this function:

◆ IValue()

int ROOT::Math::IOptions::IValue ( const char *  name) const
inline

Definition at line 56 of file IOptions.h.

56  {
57  int val = 0;
58  bool ret = GetIntValue(name,val);
59  if (!ret ) MATH_ERROR_MSGVAL("IOptions::IValue"," return 0 - integer option not found",name);
60  return val;
61  }
#define MATH_ERROR_MSGVAL(loc, str, x)
Definition: Error.h:69

References GetIntValue(), and MATH_ERROR_MSGVAL.

Here is the call graph for this function:

◆ NamedValue()

std::string ROOT::Math::IOptions::NamedValue ( const char *  name) const
inline

Definition at line 63 of file IOptions.h.

63  {
64  std::string val;
65  bool ret = GetNamedValue(name,val);
66  if (!ret ) MATH_ERROR_MSGVAL("IOptions::NamedValue"," return empty string - named option not found",name);
67  return val;
68  }

References GetNamedValue(), and MATH_ERROR_MSGVAL.

Here is the call graph for this function:

◆ Print()

virtual void ROOT::Math::IOptions::Print ( std::ostream &  = std::cout) const
inlinevirtual

print options

Reimplemented in ROOT::Math::GenAlgoOptions.

Definition at line 98 of file IOptions.h.

98 {MATH_INFO_MSG("IOptions::Print","it is not implemented");}
#define MATH_INFO_MSG(loc, str)
Definition: Error.h:44

References MATH_INFO_MSG.

◆ RValue()

double ROOT::Math::IOptions::RValue ( const char *  name) const
inline

Definition at line 49 of file IOptions.h.

49  {
50  double val = 0;
51  bool ret = GetRealValue(name,val);
52  if (!ret ) MATH_ERROR_MSGVAL("IOptions::RValue"," return 0 - real option not found",name);
53  return val;
54  }

References GetRealValue(), and MATH_ERROR_MSGVAL.

Here is the call graph for this function:

◆ SetIntValue()

virtual void ROOT::Math::IOptions::SetIntValue ( const char *  ,
int   
)
inlinevirtual

Reimplemented in ROOT::Math::GenAlgoOptions.

Definition at line 92 of file IOptions.h.

92 {MATH_ERROR_MSG("IOptions::SetIntValue","Invalid setter method called"); }
#define MATH_ERROR_MSG(loc, str)
Definition: Error.h:50

References MATH_ERROR_MSG.

Referenced by SetValue().

◆ SetNamedValue()

virtual void ROOT::Math::IOptions::SetNamedValue ( const char *  ,
const char *   
)
inlinevirtual

Reimplemented in ROOT::Math::GenAlgoOptions.

Definition at line 94 of file IOptions.h.

94 {MATH_ERROR_MSG("IOptions::SetNamedValue","Invalid setter method called"); }

References MATH_ERROR_MSG.

Referenced by SetValue().

◆ SetRealValue()

virtual void ROOT::Math::IOptions::SetRealValue ( const char *  ,
double   
)
inlinevirtual

method wich need to be re-implemented by the derived classes

Reimplemented in ROOT::Math::GenAlgoOptions.

Definition at line 90 of file IOptions.h.

90 {MATH_ERROR_MSG("IOptions::SetRealValue","Invalid setter method called"); }

References MATH_ERROR_MSG.

Referenced by SetValue().

◆ SetValue() [1/3]

void ROOT::Math::IOptions::SetValue ( const char *  name,
const char *  val 
)
inline

Definition at line 46 of file IOptions.h.

46 { SetNamedValue(name,val);}
virtual void SetNamedValue(const char *, const char *)
Definition: IOptions.h:94

References SetNamedValue().

Here is the call graph for this function:

◆ SetValue() [2/3]

void ROOT::Math::IOptions::SetValue ( const char *  name,
double  val 
)
inline

set option value

generic methods for retrivieng options

Definition at line 44 of file IOptions.h.

44 { SetRealValue(name,val);}
virtual void SetRealValue(const char *, double)
method wich need to be re-implemented by the derived classes
Definition: IOptions.h:90

References SetRealValue().

Here is the call graph for this function:

◆ SetValue() [3/3]

void ROOT::Math::IOptions::SetValue ( const char *  name,
int  val 
)
inline

Definition at line 45 of file IOptions.h.

45 { SetIntValue(name,val);}
virtual void SetIntValue(const char *, int)
Definition: IOptions.h:92

References SetIntValue().

Here is the call graph for this function:

The documentation for this class was generated from the following file: