Added const keyword to getters.

The access method should be marked as const so to make the compiler
aware that they should not modify the state of the object.
This commit is contained in:
Håkon Hægland
2020-06-02 09:20:54 +02:00
parent c6d49a4b44
commit f7d2631a57
2 changed files with 4 additions and 4 deletions

View File

@@ -215,9 +215,9 @@ public:
const Group& group(const std::string& gname) const;
const Well& well(const std::string& wname) const;
double gaslift_increment();
double gaslift_increment() const;
void gaslift_increment(double gaslift_increment);
double min_eco_gradient();
double min_eco_gradient() const;
void min_eco_gradient(double min_eco_gradient);
void min_wait(double min_wait);
void all_newton(double all_newton);

View File

@@ -31,7 +31,7 @@ void GasLiftOpt::gaslift_increment(double gaslift_increment) {
this->m_increment = gaslift_increment;
}
double GasLiftOpt::gaslift_increment() {
double GasLiftOpt::gaslift_increment() const {
return this->m_increment;
}
@@ -39,7 +39,7 @@ void GasLiftOpt::min_eco_gradient(double min_eco_gradient) {
this->m_min_eco_gradient = min_eco_gradient;
}
double GasLiftOpt::min_eco_gradient() {
double GasLiftOpt::min_eco_gradient() const {
return this->m_min_eco_gradient;
}