CalibrationInfoWriter.hh 1.05 KB
/*
 * 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_ */