QOptionHandler.hh

00001 /*
00002 * APOLLO: A complete DAQ and Online Data Analysis Framework for Cuore 
00003 * $Id: QOptionHandler.hh 557 2006-12-14 17:00:51Z giacher $
00004 * M.P. created 16/4/4
00005 * 
00006 * Class QOptionHandler: handling option tool 
00007 *
00008 */
00009 
00010 #ifndef __OPTIONHANDLER_HH_
00011 #define __OPTIONHANDLER_HH_
00012 
00013 #include <map>
00014 #include <string>
00015 #include <iostream>
00016 
00017 #include "QCuore.hh"
00018 
00019 class QOptionHandler {
00020 public:
00021 
00022   // dtor
00023   virtual ~QOptionHandler();
00024   
00025   static QOptionHandler* Get();
00026   
00027   void Parse(int,char**);
00028 
00029   // Get a string parameter
00030   const std::string& GetStringParam(const std::string& name);
00031                 
00032   // Get an integer parameter
00033   int GetIntParam(const std::string& name);
00034   
00035   // Get a double parameter
00036   double GetRealParam(const std::string& name);
00037   
00038   // Check existance
00039   bool CheckParam(const std::string& name);
00040   
00041   // Dump
00042   void Dump(std::ostream& c=std::cout);
00043   
00044 private:
00045   
00046   // ctor
00047   QOptionHandler();
00048   
00049   // Singleton
00050   static QOptionHandler *me;
00051   
00052   std::map<std::string,std::string> s_options;
00053   std::map<std::string,int> i_options;
00054   std::map<std::string,double> d_options;
00055   
00056 };
00057 
00058 #endif

Generated on Tue Nov 16 10:49:55 2010 for CUORE Software by  doxygen 1.5.6