Blame view

src/Main/ParseMainArguments.hh 2.86 KB
fbe3c2bb   Benjamin Renard   First commit
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/**
 * ParseMainArguments.hh
 *
 *  Created on: 15 oct. 2012
 *      Author: AKKA IS
 */

#ifndef PARSEMAINARGUMENTS_HH_
#define PARSEMAINARGUMENTS_HH_

#include <string>
#include <exception>
#include "log4cxx/logger.h"


#include "AMDA_exception.hh"
#include "OutputFormatTime.hh"

namespace AMDA {
namespace Main {



/**
 * Exception specific for ParseMainArguments
 */
struct parseArg_error: virtual AMDA::AMDA_exception { };



/**
 *
 */
class ParseMainArguments {

public:
	/**
	 * @brief Equivalent typedef to ParamOutputASCIIFile::InfoNammeList.
	 */
	typedef std::vector<std::string> CalibrationInfoNameList;
    /**
    * Constructor
    * Return an exception if parse error
    */
    ParseMainArguments(int arcg, char *argv[]) ;


    /**
     * help message
     */
    static void printHelp(const char *name);

    /**
     * Getter of intervalTime
     */
	const std::string& getIntervalTime() const {
		return intervalTime;
	}

    /**
     * Getter of paramName
     */
	const std::string& getParamName() const {
		return paramName;
	}

    /**
     * Getter of startTime
     */
	const std::string& getStartTime() const {
		return startTime;
	}

    /**
     * Getter of _workPath
     */
	const std::string& getWorkPath() const {
		return _workPath;
	}

	/**
	 * if true, arg erreur we must stop process
	 */
	bool isStopProcess() const {
		return _stopProcess;
	}

	OutputFormatTime getFormatOutputTime() const {
		return _formatOutputTime;
	}

	float getSampling() const {
		return _sampling;
	}

	void setSampling(float sampling) {
		_sampling = sampling;
	}

	const std::string& getSamplingMode() const {
		return _samplingMode;
	}

	void setSamplingMode(const std::string& samplingMode) {
		_samplingMode = samplingMode;
	}

	float getGapThreshold() const {
		return _gapThreshold;
	}

	const CalibrationInfoNameList& getCalibrationInfoNameList() const {
		return _calibrationInfoNameList;
	}

    /*************************************/
private:

	static log4cxx::LoggerPtr logger;

    /**
     *
     */
    int parse(int argc,  char *argv[]);

    /**
     * paramName in arguments list
     */
    std::string paramName;

    /**
     * start time in arguments list
     */
    std::string startTime;

    /**
     * interval of time in arguments list
     */
    std::string intervalTime;
    
    /**
     * if true stopProcess
     */
    bool _stopProcess;
    /**
     * type of output time fomat
     */
    OutputFormatTime _formatOutputTime;

    float _sampling;
    
    std::string _samplingMode;

    /**
     * gap Threshold
     */
    float _gapThreshold;

    /**
     * work path in arguments list
     */
    std::string _workPath;

    /**
     * @brief Calibration Information name to set ParamOutputASCIIFile::InfoNammeList.
     */
    CalibrationInfoNameList _calibrationInfoNameList;
};
} /* namespace Main */
} /* namespace AMDA */


#endif /* PARSEMAINARGUMENTS_HH_ */