Blame view

src/ParamGetImpl/ConstantInterface/ParamGetConstant.hh 1.86 KB
93809512   Benjamin Renard   Implements ParamG...
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
 * ParamGetConstant.hh
 *
 *  Created on: 18 sep 2018
 *      Author: AKKA
 */

#ifndef PARAMGETCONSTANT_HH_
#define PARAMGETCONSTANT_HH_

#include <set>
#include <string>

#include <boost/shared_ptr.hpp>

#include "ParamGet.hh"

#include "TimeStamp.hh"

#include "ConstantParamData.hh"

#include "Pusher.hh"

using namespace AMDA::Parameters;

namespace AMDA {

namespace ConstantInterface {

//used class
class ParamData;

/**
 * @class ParamGetConstant
 * @brief It is a DataWriter for a constant Parameter get.
 */
class ParamGetConstant: public ParamGet_CRTP<ParamGetConstant>
{
public:
	/*
	 * @brief Constructor
	 */
	ParamGetConstant(Parameter &parameter);

	ParamGetConstant(const ParamGetConstant &pParamGetConstant, Parameter &parameter);

	/*
	 * @brief Destructor
	 */
	virtual ~ParamGetConstant();

	/**
	 *  @overload DataWriter::write - Write data in dataParam and return the number of data writed.
	 */
	virtual unsigned int write();

	/*
	 * @overload DataWriter::getMinSampling
	 */
	virtual double getMinSampling();

	/*
	 * @brief Init
	 */
	TimeStamp init();

	/**
	 * @overload DataWriter::updateInfo update parameter info in relation to the ParamGet
	 */
	virtual void updateInfo(Parameter & parameter);

	void setSampling(double sampling) {
		_sampling = sampling;
	}

	void setType(ConstantParamType type) {
		_type = type;
	}

	void setValue(double value) {
		_value = value;
	}

	void setDim1(int dim1) {
		_dim1 = dim1;
	}

	void setDim2(int dim2) {
		_dim2 = dim2;
	}

protected:
	double _sampling;

	ConstantParamType _type;

	ConstantContainerType _container;

	double _value;

	int _dim1;

	int _dim2;

	TimeIntervalList::iterator _currentInterval;

	/*
	 * @brief Data pusher
	 */
	PusherBase *_pusher;
};

typedef boost::shared_ptr<ParamGetConstant> ParamGetConstantSPtr;

} /* namespace ConstantInterface */
} /* namespace AMDA */
#endif /* PARAMGETCONSTANT_HH_ */