Changed calling convention for shared pointers.

Expect non-reference type shared pointers arguments instead of references
to shared pointer. This will make it clear to the caller that the called
function is making a copy of the pointer for its own use and not trying
to modify the original pointer of the caller.
This commit is contained in:
Håkon Hægland
2021-09-22 00:25:59 +02:00
parent 5ad65c70ee
commit 4c5245196b
29 changed files with 136 additions and 136 deletions

View File

@@ -40,15 +40,15 @@ PyBlackOilSimulator::PyBlackOilSimulator( const std::string &deckFilename)
}
PyBlackOilSimulator::PyBlackOilSimulator(
std::shared_ptr<Opm::Deck>& deck,
std::shared_ptr<Opm::EclipseState>& state,
std::shared_ptr<Opm::Schedule>& schedule,
std::shared_ptr<Opm::SummaryConfig>& summary_config
std::shared_ptr<Opm::Deck> deck,
std::shared_ptr<Opm::EclipseState> state,
std::shared_ptr<Opm::Schedule> schedule,
std::shared_ptr<Opm::SummaryConfig> summary_config
)
: deck_{deck}
, eclipse_state_{state}
, schedule_{schedule}
, summary_config_{summary_config}
: deck_{std::move(deck)}
, eclipse_state_{std::move(state)}
, schedule_{std::move(schedule)}
, summary_config_{std::move(summary_config)}
{
}
@@ -145,10 +145,10 @@ void export_PyBlackOilSimulator(py::module& m)
py::class_<PyBlackOilSimulator>(m, "BlackOilSimulator")
.def(py::init< const std::string& >())
.def(py::init<
std::shared_ptr<Opm::Deck>&,
std::shared_ptr<Opm::EclipseState>&,
std::shared_ptr<Opm::Schedule>&,
std::shared_ptr<Opm::SummaryConfig>& >())
std::shared_ptr<Opm::Deck>,
std::shared_ptr<Opm::EclipseState>,
std::shared_ptr<Opm::Schedule>,
std::shared_ptr<Opm::SummaryConfig> >())
.def("get_porosity", &PyBlackOilSimulator::getPorosity,
py::return_value_policy::copy)
.def("run", &PyBlackOilSimulator::run)