ParseMainArguments.hh 2.86 KB
/**
 * 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_ */