forked from chili-epfl/Carpenter-App-RoofDesigner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparameter.h
More file actions
38 lines (33 loc) · 870 Bytes
/
parameter.h
File metadata and controls
38 lines (33 loc) · 870 Bytes
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
#ifndef PARAMETER_H
#define PARAMETER_H
#include <QSharedPointer>
/**
* @brief The Parameter class
*
* It is used in the unification part of the
* constraint solver to be able to replace
* the binding of the parameter value by
* another (what QSharedPointer<double> didn't
* offered)
*/
class Parameter {
public:
Parameter(double x) {
this->_value = QSharedPointer<double>(new double);
*(this->_value) = x;
}
double value() {
return *this->_value;
}
QSharedPointer<double> address() {
return this->_value;
}
void setValue(QSharedPointer<double> value) {
this->_value = value;
}
void setValue(double value) {
*(this->_value) = value;
}
QSharedPointer<double> _value;
} ;
#endif // PARAMETER_H