From fcb5d3dd824700cfe78f0741e98fcc6949481d17 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 8 Jun 2021 15:20:59 +0200 Subject: [PATCH] SimulatorTimer: avoid boost includes in headers --- opm/simulators/timestepping/SimulatorTimer.cpp | 9 ++++++--- opm/simulators/timestepping/SimulatorTimer.hpp | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/opm/simulators/timestepping/SimulatorTimer.cpp b/opm/simulators/timestepping/SimulatorTimer.cpp index b2a5fdd42..273fd0805 100644 --- a/opm/simulators/timestepping/SimulatorTimer.cpp +++ b/opm/simulators/timestepping/SimulatorTimer.cpp @@ -24,6 +24,9 @@ #include #include +#include +#include + namespace Opm { @@ -31,7 +34,7 @@ namespace Opm SimulatorTimer::SimulatorTimer() : current_step_(0), current_time_(0.0), - start_date_(2012,1,1) // A really arbitrary default starting value?! + start_date_(std::make_shared(2012,1,1)) // A really arbitrary default starting value?! { } @@ -58,7 +61,7 @@ namespace Opm } setCurrentStepNum(report_step); - start_date_ = boost::posix_time::from_time_t(schedule.getStartTime()).date(); + *start_date_ = boost::posix_time::from_time_t(schedule.getStartTime()).date(); } /// Whether the current step is the first step. @@ -108,7 +111,7 @@ namespace Opm boost::posix_time::ptime SimulatorTimer::startDateTime() const { - return boost::posix_time::ptime(start_date_); + return boost::posix_time::ptime(*start_date_); } diff --git a/opm/simulators/timestepping/SimulatorTimer.hpp b/opm/simulators/timestepping/SimulatorTimer.hpp index 753041ddf..8f5b1cc72 100644 --- a/opm/simulators/timestepping/SimulatorTimer.hpp +++ b/opm/simulators/timestepping/SimulatorTimer.hpp @@ -26,6 +26,8 @@ #include #include +namespace boost { namespace gregorian { class date; } } + namespace Opm { @@ -122,7 +124,7 @@ namespace Opm int current_step_; double current_time_; double total_time_; - boost::gregorian::date start_date_; + std::shared_ptr start_date_; };