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 // $Id: Defaults.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
3 //
4 // File: hitfit/Defaults.h
5 // Purpose: Define an interface for getting parameter settings.
6 // Created: Nov, 2000, sss.
7 //
8 // This defines a very simple abstract interface for retrieving settings
9 // for named parameters. Using this ensures that the hitfit code doesn't
10 // have to depend on something like rcp. There is a lightweight concrete
11 // implementation of this interface, Defaults_Text, which can be used
12 // for standalone applications. If this code gets used with the D0 framework,
13 // a Defaults_RCP can be provided too.
14 //
15 // CMSSW File : interface/Defaults.h
16 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
17 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
18 //
19 
20 
48 #ifndef HITFIT_DEFAULTS_H
49 #define HITFIT_DEFAULTS_H
50 
51 
52 #include <string>
53 
54 
55 namespace hitfit {
56 
57 
62 class Defaults
63 //
64 // Purpose: Define an interface for getting parameter settings.
65 //
66 {
67 public:
68  // Constructor, destructor.
69 
73  Defaults () {}
74 
78  virtual ~Defaults () {}
79 
80  // Test to see if parameter NAME exists.
87  virtual bool exists (std::string name) const = 0;
88 
89  // Get the value of NAME as an integer.
96  virtual int get_int (std::string name) const = 0;
97 
98  // Get the value of NAME as a boolean.
105  virtual bool get_bool (std::string name) const = 0;
106 
107  // Get the value of NAME as a float.
115  virtual double get_float (std::string name) const = 0;
116 
117  // Get the value of NAME as a string.
124  virtual std::string get_string (std::string name) const = 0;
125 };
126 
127 
128 } // namespace hitfit
129 
130 
131 #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:78
virtual double get_float(std::string name) const =0
Define an interface for getting parameter settings.
Definition: Defaults.h:62
virtual int get_int(std::string name) const =0