make TimeStampUTC constructible from variables
also add accessor
This commit is contained in:
parent
df5baad233
commit
6986436073
@ -45,6 +45,11 @@ namespace Opm {
|
|||||||
|
|
||||||
explicit TimeStampUTC(const std::time_t tp);
|
explicit TimeStampUTC(const std::time_t tp);
|
||||||
explicit TimeStampUTC(const YMD& ymd);
|
explicit TimeStampUTC(const YMD& ymd);
|
||||||
|
TimeStampUTC(const YMD& ymd,
|
||||||
|
int hour,
|
||||||
|
int minutes,
|
||||||
|
int seconds,
|
||||||
|
int usec);
|
||||||
|
|
||||||
TimeStampUTC& operator=(const std::time_t tp);
|
TimeStampUTC& operator=(const std::time_t tp);
|
||||||
bool operator==(const TimeStampUTC& data) const;
|
bool operator==(const TimeStampUTC& data) const;
|
||||||
@ -54,6 +59,7 @@ namespace Opm {
|
|||||||
TimeStampUTC& seconds(const int s);
|
TimeStampUTC& seconds(const int s);
|
||||||
TimeStampUTC& microseconds(const int us);
|
TimeStampUTC& microseconds(const int us);
|
||||||
|
|
||||||
|
const YMD& ymd() const { return ymd_; }
|
||||||
int year() const { return this->ymd_.year; }
|
int year() const { return this->ymd_.year; }
|
||||||
int month() const { return this->ymd_.month; }
|
int month() const { return this->ymd_.month; }
|
||||||
int day() const { return this->ymd_.day; }
|
int day() const { return this->ymd_.day; }
|
||||||
|
@ -63,6 +63,15 @@ Opm::TimeStampUTC::TimeStampUTC(const std::time_t tp)
|
|||||||
this->hour(tm.tm_hour).minutes(tm.tm_min).seconds(tm.tm_sec);
|
this->hour(tm.tm_hour).minutes(tm.tm_min).seconds(tm.tm_sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Opm::TimeStampUTC::TimeStampUTC(const Opm::TimeStampUTC::YMD& ymd,
|
||||||
|
int hour, int minutes, int seconds, int usec)
|
||||||
|
: ymd_(ymd)
|
||||||
|
, hour_(hour)
|
||||||
|
, minutes_(minutes)
|
||||||
|
, seconds_(seconds)
|
||||||
|
, usec_(usec)
|
||||||
|
{}
|
||||||
|
|
||||||
Opm::TimeStampUTC& Opm::TimeStampUTC::operator=(const std::time_t tp)
|
Opm::TimeStampUTC& Opm::TimeStampUTC::operator=(const std::time_t tp)
|
||||||
{
|
{
|
||||||
auto t = tp;
|
auto t = tp;
|
||||||
|
Loading…
Reference in New Issue
Block a user