Blame view

src/InternLib/ParameterCreatorFromExpression.hh 1.36 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
/*
 * ParameterCreatorFromExpression.hh
 *
 *  Created on: Dec 14, 2012
 *      Author: f.casimir
 */

#ifndef PARAMETERCREATORFROMEXPRESSION_HH_
#define PARAMETERCREATORFROMEXPRESSION_HH_

#include "Parameter.hh"
#include "Parser.hh"

namespace AMDA {
namespace Parameters {
/**
 * @see ParameterManager
 */
class ParameterManager;

/**
 * @brief parse expression and get one parameter
 */
class ParameterCreatorFromExpression {
public:
	/**
	 * @brief constructor, initialize _parameterManager
	 */
	ParameterCreatorFromExpression(ParameterManager& pParameterManager);
	/**
	 * destructor
	 */
	virtual ~ParameterCreatorFromExpression();

	/**
	 * parse expression pExpression and create a  pParameter
	 * @param pParameter parent parameter
	 * @param pExpression expretion to parse
	 * @return the parameter created, this parameter must be
	 *  - if expression == parameterName ==> parameterName parameter
	 *  - if expression is a process ==> process parameter
	 *  - else hash(expression) parameter
	 *
	 */
	ParameterSPtr getOneParameterFromExpression(Parameter& pParameter, const std::string& pExpression);
private:
	/**
	 * @brief reference of parameterManager to create parameter
	 */
	ParameterManager& _parameterManager;

	/**
	 * brief parser object
	 */
	Parser _parser;
};

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