mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
SimulatorTimers: added method clone to allow for copying of the objects.
This commit is contained in:
parent
8cd08728f7
commit
f9f13143a2
@ -153,4 +153,13 @@ namespace Opm
|
|||||||
return start_date_time_;
|
return start_date_time_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// return copy of object
|
||||||
|
std::unique_ptr< SimulatorTimerInterface >
|
||||||
|
AdaptiveSimulatorTimer::clone() const
|
||||||
|
{
|
||||||
|
return std::unique_ptr< SimulatorTimerInterface > (new AdaptiveSimulatorTimer( *this ));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -93,6 +93,9 @@ namespace Opm
|
|||||||
/// \brief start date time of simulation
|
/// \brief start date time of simulation
|
||||||
boost::posix_time::ptime startDateTime() const;
|
boost::posix_time::ptime startDateTime() const;
|
||||||
|
|
||||||
|
/// return copy of object
|
||||||
|
virtual std::unique_ptr< SimulatorTimerInterface > clone() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const boost::posix_time::ptime start_date_time_;
|
const boost::posix_time::ptime start_date_time_;
|
||||||
const double start_time_;
|
const double start_time_;
|
||||||
|
@ -148,5 +148,13 @@ namespace Opm
|
|||||||
return int(timesteps_.size()) == current_step_;
|
return int(timesteps_.size()) == current_step_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// return copy of object
|
||||||
|
std::unique_ptr< SimulatorTimerInterface >
|
||||||
|
SimulatorTimer::clone() const
|
||||||
|
{
|
||||||
|
return std::unique_ptr< SimulatorTimerInterface > (new SimulatorTimer( *this ));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -104,6 +104,9 @@ namespace Opm
|
|||||||
/// Return true if op++() has been called numSteps() times.
|
/// Return true if op++() has been called numSteps() times.
|
||||||
bool done() const;
|
bool done() const;
|
||||||
|
|
||||||
|
/// return copy of object
|
||||||
|
virtual std::unique_ptr< SimulatorTimerInterface > clone() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<double> timesteps_;
|
std::vector<double> timesteps_;
|
||||||
int current_step_;
|
int current_step_;
|
||||||
|
@ -98,6 +98,9 @@ namespace Opm
|
|||||||
tm t = boost::posix_time::to_tm(currentDateTime());
|
tm t = boost::posix_time::to_tm(currentDateTime());
|
||||||
return std::mktime(&t);
|
return std::mktime(&t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// return copy of current timer instance
|
||||||
|
virtual std::unique_ptr< SimulatorTimerInterface > clone () const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user