Blame view

src/Parameters/CalibrationInfoWriter.hh 1.05 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
/*
 * CalibrationInfo.hh
 *
 *  Created on: Dec 24, 2012
 *      Author: f.casimir
 */

#ifndef CALIBRATIONINFO_HH_
#define CALIBRATIONINFO_HH_

#include <string>
#include <boost/function.hpp>

#include "Parameter.hh"

namespace AMDA {
namespace Parameters {

class CalibrationInfoWriter {
public:
	 typedef std::vector<std::string > AttributeList;
    typedef void (*CalibrationInfoProcess)(Parameter& , AttributeList&);

	CalibrationInfoWriter();
	virtual ~CalibrationInfoWriter();

	const std::string& getExpression() const {
		return _expression;
	}

	void setExpression(const std::string& expression) {
		_expression = expression;
	}

	void operator()(Parameter& );

protected:
	struct Parser {
		enum state { funcName = 0, attributeVal, end, undefined };
		Parser( std::string pExpression);
		bool isAuthorisedSymbol(int c) { return (isalnum(c) || c == '_'); }
		AttributeList _attributeList;
		std::string _functionName;
		state _state;
	};

private:
	std::string _expression;
};

} /* namespace Parameters */
} /* namespace AMDA */
#endif /* CALIBRATIONINFO_HH_ */