Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef ParserBase_HH
#define ParserBase_HH
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <utility>
// Boost headers go here
#include <boost/version.hpp>
#if BOOST_VERSION < 103600
#error "Error: Boost should at least have version 1.36 !"
#endif /* BOOST_VERSION */
#include <boost/program_options.hpp>
#include <boost/filesystem.hpp>
// For Microsoft-compatible compilers
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
// GenEvA headers go here
//#include <common/GCommonEnums.hpp>
//#include <common/GSerializationHelperFunctionsT.hpp>
//#include <geneva/GOptimizationEnums.hpp>
namespace po = boost::program_options;
//using namespace Gem::Geneva;
class ParserBase
{
public:
typedef enum tagerrLogMode {debug,trace,routine,warning,error,alert} enErrLogMode;
public:
ParserBase(int argc,char **argv);
virtual ~ParserBase(){;}
const std::string& getConfigFile() const { return _configFile;}
const enErrLogMode& getErrLogMode() const { return _errLogMode; }
const std::string dataFile() const {return _dataFile;}
const std::string mcFile() const {return _mcFile;}
const std::string fitParamFile() const {return _paramFile;}
const std::vector<std::string>& enabledHyps() const { return _enabledHyps; }
const std::string startHypo() const {return _startHypo;}
const std::string mode() const {return _mode;}
const std::vector<std::string>& fixedParams() const { return _mnParFixs; }
protected:
virtual bool parseCommandLine(int argc,char **argv);
protected:
std::string _configFile;
enErrLogMode _errLogMode;
std::string _dataFile;
std::string _mcFile;
std::string _paramFile;
std::string _startHypo;
std::string _mode;
std::vector<std::string> _enabledHyps;
std::vector<std::string> _mnParFixs;
bool _verbose;
std::string _strErrLogMode;
po::options_description* _desc;
po::options_description* _common;
po::options_description* _config;
};
#endif /* ParserBase_HH */