Introduce an interface for SimulatorTimer and AdaptiveSimulatorTimer.

currentDateTime and currentPosixTime are default implementations.
This commit is contained in:
Robert K
2015-01-08 12:06:37 +01:00
parent aa9fe2a631
commit be69c4c10e
5 changed files with 147 additions and 30 deletions

View File

@@ -100,19 +100,11 @@ namespace Opm
return current_time_;
}
/// time elapsed since the start of the POSIX epoch (Jan 1st, 1970) [s].
time_t SimulatorTimer::currentPosixTime() const
boost::gregorian::date SimulatorTimer::startDate() const
{
tm t = boost::posix_time::to_tm(currentDateTime());
return std::mktime(&t);
return start_date_;
}
boost::posix_time::ptime SimulatorTimer::currentDateTime() const
{
return boost::posix_time::ptime(start_date_) + boost::posix_time::seconds( (int) current_time_ );
}
/// Total time.
double SimulatorTimer::totalTime() const