Blame view

src/Info/ParamTable.hh 3.08 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
/**
 * ParamTable.hh
 *
 *  Created on: 10 oct. 2014
 *  Author: AKKA
 */

#ifndef PARAMTABLE_HH_
#define PARAMTABLE_HH_

#include "ParameterManager.hh"

#include "log4cxx/logger.h"

namespace AMDA {
namespace Info {

	using namespace AMDA::Parameters;

	/**
	 * @brief Structure that's define a table bound
	 */
	typedef struct {
		int index;
		double min;
		double max;
	} t_TableBound;

	/**
	 * @class ParamTable
	 * @brief Abstract class used to define a Parameter table .
	 * @details
	 */
	class ParamTable
	{
	public:
		ParamTable(const char *paramId);

		virtual ~ParamTable();

		virtual int getSize(ParameterManager *parameterManager) = 0;

		virtual t_TableBound getBound(ParameterManager *parameterManager, unsigned int index) = 0;

		void setParameterLink(ParameterSPtr parameter);

		void setName(std::string name);

		std::string getName(void);

		void setUnits(std::string name);

		std::string getUnits(void);

	protected:
		/** logger of paramTable */
		static log4cxx::LoggerPtr _logger;

		std::string _paramId;

		std::string _tableName;

		std::string _tableUnits;
	};

	/**
	 * @class ParamBoundsTable
	 * @brief Implementation of a ParamTable for a table defined by a list
	 * @details
	 */
	class ParamBoundsTable : public ParamTable {
	public:
		ParamBoundsTable(const char *paramId, const char *boundsName);

		virtual int getSize(ParameterManager *parameterManager);

		virtual t_TableBound getBound(ParameterManager *parameterManager, unsigned int index);

	private:
		std::string _boundsName;
	};

	/**
	 * @class ParamCenterTable
	 * @brief Implementation of a ParamTable for a table defined by a list of center value and a size
	 * @details
	 */
	class ParamCenterTable : public ParamTable {
	public:
		ParamCenterTable(const char *paramId, const char *centerName, double size);

		virtual int getSize(ParameterManager *parameterManager);

		virtual t_TableBound getBound(ParameterManager *parameterManager, unsigned int index);

	private:
		std::string _centerName;
		double _size;
	};

	/**
f5c53312   Benjamin Renard   Get calib info in...
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
	 * @class ParamCenterWidthTable
	 * @brief Implementation of a ParamTable for a table defined by a list of center value and a list of band width
	 * @details
	 */
	class ParamCenterWidthTable : public ParamTable {
	public:
		ParamCenterWidthTable(const char *paramId, const char *centerName, const char *widthName);

		virtual int getSize(ParameterManager *parameterManager);

		virtual t_TableBound getBound(ParameterManager *parameterManager, unsigned int index);

	private:
		std::string _centerName;
		std::string _widthName;
	};

	/**
fbe3c2bb   Benjamin Renard   First commit
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
	 * @class ParamMinMaxTable
	 * @brief Implementation of a ParamTable for a table defined by two list: one for min and one for max
	 * @details
	 */
	class ParamMinMaxTable : public ParamTable {
		public:
			ParamMinMaxTable(const char *paramId, const char *minName, const char *maxName);

			virtual int getSize(ParameterManager *parameterManager);

			virtual t_TableBound getBound(ParameterManager *parameterManager, unsigned int index);

		private:
			std::string _minName;

			std::string _maxName;
	};
} /* namespace Info */
} /* namespace AMDA */

#endif /* PARAMTABLE_HH_ */