|
World Ocean Simulation System (WOSS) library
|
a class for time date manipulation More...
#include <time-definitions.h>

Public Member Functions | |
| Time () | |
| Time (struct tm *time) | |
| Time (int day, int month, int year, int hours=0, int mins=0, int seconds=1) | |
| Time (const Time ©)=default | |
| Time (Time &&tmp)=default | |
| ~Time ()=default | |
| Time & | setMonth (int m) |
| Time & | setDay (int d) |
| Time & | setYear (int y) |
| Time & | setHours (int h) |
| Time & | setMinutes (int m) |
| Time & | setSeconds (int s) |
| bool | isValid () const |
| int | getMonth () const |
| int | getDay () const |
| int | getHours () const |
| int | getYear () const |
| int | getMinutes () const |
| int | getSeconds () const |
| operator time_t () const | |
| Time & | operator= (const Time ©)=default |
| Time & | operator= (Time &&tmp)=default |
Static Public Member Functions | |
| static void | setDebug (bool flag) |
Protected Attributes | |
| struct tm | timeinfo |
| time_t | raw_time |
Static Protected Attributes | |
| static bool | debug = false |
Friends | |
| const Time | operator+ (const Time &left, const time_t right) |
| const Time | operator- (const Time &left, const time_t right) |
| double | operator- (const Time &left, const Time &right) |
| Time & | operator+= (Time &left, time_t right) |
| Time & | operator-= (Time &left, time_t right) |
| bool | operator== (const Time &left, const Time &right) |
| bool | operator!= (const Time &left, const Time &right) |
| bool | operator> (const Time &left, const Time &right) |
| bool | operator< (const Time &left, const Time &right) |
| bool | operator<= (const Time &left, const Time &right) |
| bool | operator>= (const Time &left, const Time &right) |
| std::ostream & | operator<< (std::ostream &os, const Time &instance) |
a class for time date manipulation
Time class offers the possibility to store and manipulate date time. A time date consists of a day, month, year, hours, minutes and seconds.
| Time::Time | ( | ) |
Default Time constructor. Object is not valid
References raw_time, and timeinfo.
Referenced by operator!=, operator+, operator+=, operator-, operator-, operator-=, operator<, operator<<, operator<=, operator=(), operator=(), operator==, operator>, operator>=, setDay(), setHours(), setMinutes(), setMonth(), setSeconds(), setYear(), Time(), and Time().
| Time::Time | ( | struct tm * | time | ) |
| Time::Time | ( | int | day, |
| int | month, | ||
| int | year, | ||
| int | hours = 0, | ||
| int | mins = 0, | ||
| int | seconds = 1 ) |
Time constructor
| day | day value. Should be between 1 and 31 |
| month | month value. Should be between 1 and 12 |
| year | year value. |
| hours | hours value. Should be between 0 and 23 |
| mins | minutes value. Should be between 0 and 59 |
| seconds | seconds value. Should be between 0 and 59 |
|
default |
|
default |
|
default |
|
inline |
Returns day value
References timeinfo.
Referenced by WossUnitTest::testTime().
|
inline |
Returns hours value
References timeinfo.
Referenced by WossUnitTest::testTime().
|
inline |
|
inline |
Returns month value
References timeinfo.
Referenced by WossUnitTest::testTime().
|
inline |
|
inline |
|
inline |
Checks the validity of Time
References raw_time.
Referenced by woss::BellhopCreator::createWoss(), woss::ResPressureTxtDb::getValue(), woss::ResTimeArrTxtDb::getValue(), woss::WossManager::getWossPressure(), woss::WossManager::getWossPressure(), woss::WossManagerResDbMT::getWossPressure(), woss::WossManagerResDbMT::getWossPressure(), woss::WossManager::getWossTimeArr(), woss::WossManager::getWossTimeArr(), woss::WossManagerResDbMT::getWossTimeArr(), woss::WossManagerResDbMT::getWossTimeArr(), WossUnitTest::testTime(), woss::AltimBretschneider::timeEvolve(), woss::Altimetry::timeEvolve(), woss::BellhopWoss::timeEvolve(), and woss::Woss::Woss().
|
inline |
|
inline |
Sets day
| d | day value. Should be between 1 and 31 |
References raw_time, Time(), and timeinfo.
Referenced by WossUnitTest::testTime().

|
inlinestatic |
|
inline |
|
inline |
|
inline |
Sets month
| m | month value. Should be between 1 and 12 |
References raw_time, Time(), and timeinfo.
Referenced by WossUnitTest::testTime().

|
inline |
|
inline |
Sets year
| y | year value |
References raw_time, Time(), and timeinfo.
Referenced by WossUnitTest::testTime().

Compound assignment sum operator
| left | left operand reference |
| right | right operand const time_t representing seconds |
References Time().
Subtraction operator
| left | left operand const reference |
| right | right operand const reference |
References Time().
Compound assignment subtraction operator
| left | left operand reference |
| right | right operand const time_t representing seconds |
References Time().
|
friend |
|
staticprotected |
Debug flag
Referenced by setDebug().
|
protected |
Number of seconds corresponding to date time timeinfo
Referenced by isValid(), woss::operator+=(), woss::operator-=(), setDay(), setHours(), setMinutes(), setMonth(), setSeconds(), setYear(), Time(), Time(), and Time().
|
protected |
Struct tm from ctime library
Referenced by getDay(), getHours(), getMinutes(), getMonth(), getSeconds(), getYear(), operator time_t(), operator!=, operator+, woss::operator+=(), woss::operator-(), operator-, woss::operator-=(), operator<, operator<<, operator<=, operator==, operator>, operator>=, setDay(), setHours(), setMinutes(), setMonth(), setSeconds(), setYear(), Time(), Time(), and Time().