Diana Software
QOptionHandler.hh
Go to the documentation of this file.
1 /*
2 * APOLLO: A complete DAQ and Online Data Analysis Framework for Diana
3 * $Id: QOptionHandler.hh 557 2006-12-14 17:00:51Z giacher $
4 * M.P. created 16/4/4
5 *
6 * Class QOptionHandler: handling option tool
7 *
8 */
9 
10 #ifndef __OPTIONHANDLER_HH_
11 #define __OPTIONHANDLER_HH_
12 
13 #include <map>
14 #include <string>
15 #include <iostream>
16 
17 #include "QDiana.hh"
18 
20 public:
21 
22  // dtor
23  virtual ~QOptionHandler();
24 
25  static QOptionHandler* Get();
26 
27  void Parse(int,char**);
28 
29  // Get a string parameter
30  const std::string& GetStringParam(const std::string& name);
31 
32  // Get an integer parameter
33  int GetIntParam(const std::string& name);
34 
35  // Get a double parameter
36  double GetRealParam(const std::string& name);
37 
38  // Check existance
39  bool CheckParam(const std::string& name);
40 
41  // Dump
42  void Dump(std::ostream& c=std::cout);
43 
44 private:
45 
46  // ctor
48 
49  // Singleton
50  static QOptionHandler *me;
51 
52  std::map<std::string,std::string> s_options;
53  std::map<std::string,int> i_options;
54  std::map<std::string,double> d_options;
55 
56 };
57 
58 #endif
bool CheckParam(const std::string &name)
void Dump(std::ostream &c=std::cout)
static QOptionHandler * me
void Parse(int, char **)
std::map< std::string, int > i_options
int GetIntParam(const std::string &name)
std::map< std::string, std::string > s_options
double GetRealParam(const std::string &name)
virtual ~QOptionHandler()
const std::string & GetStringParam(const std::string &name)
std::map< std::string, double > d_options
static QOptionHandler * Get()