Files
opm-common/opm/parser/eclipse/EclipseState/Schedule/Action/ActionValue.hpp
Arne Morten Kvarving 9c187ad0c1 changed: make ASTNode part of public API
required for serialization
2020-01-03 08:34:28 +01:00

63 lines
1.1 KiB
C++

#ifndef ACTION_VALUE_HPP
#define ACTION_VALUE_HPP
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp>
enum TokenType {
number, // 0
ecl_expr, // 1
open_paren, // 2
close_paren, // 3
op_gt, // 4
op_ge, // 5
op_lt, // 6
op_le, // 7
op_eq, // 8
op_ne, // 9
op_and, // 10
op_or, // 11
end, // 12
error // 13
};
enum class FuncType {
none,
time,
region,
field,
group,
well,
well_segment,
well_connection,
Well_lgr,
aquifer,
block
};
namespace Opm {
namespace Action {
class Value {
public:
explicit Value(double value);
Value() = default;
Result eval_cmp(TokenType op, const Value& rhs) const;
void add_well(const std::string& well, double value);
double scalar() const;
private:
Action::Result eval_cmp_wells(TokenType op, double rhs) const;
double scalar_value;
double is_scalar = false;
std::vector<std::pair<std::string, double>> well_values;
};
}
}
#endif