opm-common
Toggle main menu visibility
Loading...
Searching...
No Matches
ActionAST.hpp
1
/*
2
Copyright 2018 Equinor ASA.
3
4
This file is part of the Open Porous Media project (OPM).
5
6
OPM is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
OPM is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef ActionAST_HPP
21
#define ActionAST_HPP
22
23
#include <opm/input/eclipse/Schedule/Action/ActionResult.hpp>
24
25
#include <memory>
26
#include <string>
27
#include <unordered_set>
28
#include <vector>
29
30
namespace
Opm::Action {
31
32
class
Context
;
33
class
ASTNode;
34
35
}
// namespace Opm::Action
36
37
namespace
Opm::Action {
38
44
45
class
AST
46
{
47
public
:
52
AST
();
53
61
explicit
AST
(
const
std::vector<std::string>& tokens);
62
64
~AST
();
65
69
AST
(
const
AST
& rhs);
70
75
AST
(
AST
&& rhs);
76
82
AST
&
operator=
(
const
AST
& rhs);
83
90
AST
&
operator=
(
AST
&& rhs);
91
93
static
AST
serializationTestObject
();
94
103
Result
eval
(
const
Context
& context)
const
;
104
111
bool
operator==
(
const
AST
& data)
const
;
112
118
template
<
class
Serializer>
119
void
serializeOp
(
Serializer
& serializer)
120
{
121
serializer(condition);
122
}
123
130
void
required_summary
(std::unordered_set<std::string>&
required_summary
)
const
;
131
132
private
:
134
std::unique_ptr<ASTNode> condition{};
135
};
136
137
}
// namespace Opm::Action
138
139
#endif
// ActionAST_HPP
Opm::Action::AST::AST
AST()
Default constructor.
Opm::Action::AST::serializationTestObject
static AST serializationTestObject()
Create a serialisation test object.
Definition
ActionAST.cpp:76
Opm::Action::AST::operator==
bool operator==(const AST &data) const
Equality predicate.
Definition
ActionAST.cpp:94
Opm::Action::AST::eval
Result eval(const Context &context) const
Evaluate the expression tree at current dynamic state.
Definition
ActionAST.cpp:85
Opm::Action::AST::operator=
AST & operator=(const AST &rhs)
Assignment operator.
Definition
ActionAST.cpp:52
Opm::Action::AST::serializeOp
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition
ActionAST.hpp:119
Opm::Action::AST::required_summary
void required_summary(std::unordered_set< std::string > &required_summary) const
Export all summary vectors needed to evaluate the expression tree.
Definition
ActionAST.cpp:102
Opm::Action::AST::~AST
~AST()
Destructor.
Opm::Action::Context
Manager of summary vector values.
Definition
ActionContext.hpp:42
Opm::Action::Result
Class Action::Result holds the boolean result of a ACTIONX condition like.
Definition
ActionResult.hpp:69
Opm::Serializer
Class for (de-)serializing.
Definition
Serializer.hpp:94
opm
input
eclipse
Schedule
Action
ActionAST.hpp
Generated by
1.17.0