diff --git a/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp b/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp index 5b03ff181..029f8e144 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp @@ -39,7 +39,7 @@ namespace Action { class Actions { public: Actions() = default; - Actions(const std::vector& action); + Actions(const std::vector& action, const std::vector& pyactions); size_t size() const; int max_input_lines() const; bool empty() const; @@ -59,6 +59,7 @@ public: void serializeOp(Serializer& serializer) { serializer.vector(actions); + serializer.vector(pyactions); } private: diff --git a/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.hpp b/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.hpp index 5f462c341..9edfa359b 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.hpp @@ -39,9 +39,11 @@ public: static RunCount from_string(std::string run_count); static std::string load(const std::string& input_path, const std::string& fname); + PyAction() = default; PyAction(const std::string& name, RunCount run_count, const std::string& code); const std::string& code() const; const std::string& name() const; + bool operator==(const PyAction& other) const; PyAction::RunCount run_count() const; ~PyAction(); @@ -56,11 +58,20 @@ public: between invocations. */ void * storage() const; + + template + void serializeOp(Serializer& serializer) + { + serializer(m_name); + serializer(m_run_count); + serializer(input_code); + } + private: std::string m_name; RunCount m_run_count; std::string input_code; - void * m_storage; + void * m_storage = nullptr; }; } diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.cpp index 526a243d1..3725ddd82 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.cpp @@ -25,8 +25,9 @@ namespace Opm { namespace Action { -Actions::Actions(const std::vector& action) - : actions(action) +Actions::Actions(const std::vector& action, const std::vector& pyactions) + : actions(action), + pyactions(pyactions) {} @@ -106,7 +107,8 @@ std::vector::const_iterator Actions::end() const { bool Actions::operator==(const Actions& data) const { - return actions == data.actions; + return this->actions == data.actions && + this->pyactions == data.pyactions; } } diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp index 840da095d..ecdf8460e 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp @@ -103,6 +103,12 @@ PyAction::~PyAction() { #endif } +bool PyAction::operator==(const PyAction& other) const { + return this->m_name == other.m_name && + this->m_run_count == other.m_run_count && + this->input_code == other.input_code; +} + void * PyAction::storage() const {