CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Defaults.h
Go to the documentation of this file.
1 //
2 //
3 // File: hitfit/Defaults.h
4 // Purpose: Define an interface for getting parameter settings.
5 // Created: Nov, 2000, sss.
6 //
7 // This defines a very simple abstract interface for retrieving settings
8 // for named parameters. Using this ensures that the hitfit code doesn't
9 // have to depend on something like rcp. There is a lightweight concrete
10 // implementation of this interface, Defaults_Text, which can be used
11 // for standalone applications. If this code gets used with the D0 framework,
12 // a Defaults_RCP can be provided too.
13 //
14 // CMSSW File : interface/Defaults.h
15 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
16 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
17 //
18 
19 
47 #ifndef HITFIT_DEFAULTS_H
48 #define HITFIT_DEFAULTS_H
49 
50 
51 #include <string>
52 
53 
54 namespace hitfit {
55 
56 
61 class Defaults
62 //
63 // Purpose: Define an interface for getting parameter settings.
64 //
65 {
66 public:
67  // Constructor, destructor.
68 
72  Defaults () {}
73 
77  virtual ~Defaults () {}
78 
79  // Test to see if parameter NAME exists.
86  virtual bool exists (std::string name) const = 0;
87 
88  // Get the value of NAME as an integer.
95  virtual int get_int (std::string name) const = 0;
96 
97  // Get the value of NAME as a boolean.
104  virtual bool get_bool (std::string name) const = 0;
105 
106  // Get the value of NAME as a float.
114  virtual double get_float (std::string name) const = 0;
115 
116  // Get the value of NAME as a string.
123  virtual std::string get_string (std::string name) const = 0;
124 };
125 
126 
127 } // namespace hitfit
128 
129 
130 #endif // not HITFIT_DEFAULTS_H
virtual std::string get_string(std::string name) const =0
virtual bool get_bool(std::string name) const =0
virtual bool exists(std::string name) const =0
virtual ~Defaults()
Definition: Defaults.h:77
virtual double get_float(std::string name) const =0
Define an interface for getting parameter settings.
Definition: Defaults.h:61
virtual int get_int(std::string name) const =0