bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
|
#include <DODS_Decimal_Year.h>
Public Member Functions | |
Constructors | |
DODS_Decimal_Year () | |
DODS_Decimal_Year (DODS_Date d) | |
DODS_Decimal_Year (DODS_Date d, DODS_Time t) | |
DODS_Decimal_Year (string date_time) | |
DODS_Decimal_Year (BaseType *date_time) | |
DODS_Decimal_Year (int y, int m, int d, int hh=0, int mm=0, double ss=0.0, bool gmt=false) | |
DODS_Decimal_Year (int y, int yd, int hh=0, int mm=0, double ss=0.0, bool gmt=false) | |
Assignment | |
void | set (DODS_Date d) |
void | set (DODS_Date d, DODS_Time t) |
void | set (string date_time) |
void | set (BaseType *date_time) |
void | set (int y, int m, int d, int hh=0, int mm=0, double ss=0.0, bool gmt=false) |
void | set (int y, int yd, int hh=0, int mm=0, double ss=0.0, bool gmt=false) |
Access | |
int | days_in_year () const |
int | year () const |
double | fraction () const |
bool | gmt () const |
string | get (date_format format=ymd, bool gmt=true) const |
double | julian_day () const |
time_t | unix_time () const |
Relational operators | |
double | get_epsilon () const |
void | set_epsilon (double eps) |
bool | OK () const |
int | operator== (DODS_Decimal_Year &t1, DODS_Decimal_Year &t2) |
Equality. | |
int | operator!= (DODS_Decimal_Year &t1, DODS_Decimal_Year &t2) |
Inequality. | |
int | operator< (DODS_Decimal_Year &t1, DODS_Decimal_Year &t2) |
Less-than. | |
int | operator> (DODS_Decimal_Year &t1, DODS_Decimal_Year &t2) |
Greater-than. | |
int | operator<= (DODS_Decimal_Year &t1, DODS_Decimal_Year &t2) |
Less-than or Equal-to. | |
int | operator>= (DODS_Decimal_Year &t1, DODS_Decimal_Year &t2) |
Greater-than or Equal-to. | |
The DODS Date/Time class is used to represent and compute the new decimal_year values.
Definition at line 47 of file DODS_Decimal_Year.h.
DODS_Decimal_Year::DODS_Decimal_Year | ( | ) |
Create an empty instance. Will not pass the class invariant.
Definition at line 86 of file DODS_Decimal_Year.cc.
DODS_Decimal_Year::DODS_Decimal_Year | ( | DODS_Date | d | ) |
DODS_Decimal_Year::DODS_Decimal_Year | ( | string | date_time | ) |
Create an instance using the string representation of a DODS_Date_Time.
date_time | The date/time string. |
Definition at line 94 of file DODS_Decimal_Year.cc.
DODS_Decimal_Year::DODS_Decimal_Year | ( | BaseType * | date_time | ) |
Create an instance using the string representation of a DODS_Date_Time contained in a DODS Str.
date_time | The date/time string (in a DODS Str pointer). |
Definition at line 99 of file DODS_Decimal_Year.cc.
DODS_Decimal_Year::DODS_Decimal_Year | ( | int | y, |
int | m, | ||
int | d, | ||
int | hh = 0, | ||
int | mm = 0, | ||
double | ss = 0.0, | ||
bool | gmt = false ) |
Create an instance using numeric values for the year, ..., seconds.
y | The year number, 1 is 1 A.D. |
m | The month, 1 is January, ..., 12 is December. |
d | The day. |
hh | The hour, 0...23. |
mm | The minute, 0...59. |
ss | The seconds, 0.0, ..., 59.999... |
gmt | True if the time is a GMT time, false otherwise. |
Definition at line 104 of file DODS_Decimal_Year.cc.
DODS_Decimal_Year::DODS_Decimal_Year | ( | int | y, |
int | yd, | ||
int | hh = 0, | ||
int | mm = 0, | ||
double | ss = 0.0, | ||
bool | gmt = false ) |
Create an instance using numeric values for the year, ..., seconds.
y | The year number, 1 is 1 A.D. |
yd | The year-day, 1 is 1 January, 365/366 is 31 December. |
hh | The hour, 0...23. |
mm | The minute, 0...59. |
ss | The seconds, 0.0, ..., 59.999... |
gmt | True if the time is a GMT time, false otherwise. |
Definition at line 110 of file DODS_Decimal_Year.cc.
int DODS_Decimal_Year::days_in_year | ( | ) | const |
Definition at line 234 of file DODS_Decimal_Year.cc.
double DODS_Decimal_Year::fraction | ( | ) | const |
Definition at line 243 of file DODS_Decimal_Year.cc.
Get the string representation of the date/time. If #format# is ymd#, return the date-time using yyyy/mm/dd:hh:mm:ss notation, if it is yd#, use yyyy/ddd... notation. If gmt# is true, append GMT to times that are GMT times, if false, don't (ever) append the GMT suffix.
format | The format of the date-part. |
gmt | Append the GMT suffix to GMT times. |
Definition at line 266 of file DODS_Decimal_Year.cc.
double DODS_Decimal_Year::get_epsilon | ( | ) | const |
Get the value of epsilon used for equality tests of time.
Definition at line 300 of file DODS_Decimal_Year.cc.
bool DODS_Decimal_Year::gmt | ( | ) | const |
Definition at line 260 of file DODS_Decimal_Year.cc.
double DODS_Decimal_Year::julian_day | ( | ) | const |
Definition at line 279 of file DODS_Decimal_Year.cc.
bool DODS_Decimal_Year::OK | ( | ) | const |
Class invariant.
Definition at line 81 of file DODS_Decimal_Year.cc.
void DODS_Decimal_Year::set | ( | BaseType * | date_time | ) |
Set an instance using the string representation of a DODS_Date_Time contained in a DODS Str.
date_time | The date/time string (in a DODS Str pointer). |
Definition at line 204 of file DODS_Decimal_Year.cc.
void DODS_Decimal_Year::set | ( | DODS_Date | d | ) |
Set an instance using DODS_Date objects.
d | A DODS_Date object. |
Definition at line 117 of file DODS_Decimal_Year.cc.
void DODS_Decimal_Year::set | ( | int | y, |
int | m, | ||
int | d, | ||
int | hh = 0, | ||
int | mm = 0, | ||
double | ss = 0.0, | ||
bool | gmt = false ) |
Set an instance using numeric values for the year, ..., seconds.
y | The year number, 1 is 1 A.D. |
m | The month, 1 is January, ..., 12 is December. |
d | The day. |
hh | The hour, 0...23. |
mm | The minute, 0...59. |
ss | The seconds, 0.0, ..., 59.999... |
gmt | True if the time is a GMT time, false otherwise. |
Definition at line 210 of file DODS_Decimal_Year.cc.
void DODS_Decimal_Year::set | ( | int | y, |
int | yd, | ||
int | hh = 0, | ||
int | mm = 0, | ||
double | ss = 0.0, | ||
bool | gmt = false ) |
Set an instance using numeric values for the year, ..., seconds.
y | The year number, 1 is 1 A.D. |
yd | The year-day, 1 is 1 January, 365/366 is 31 December. |
hh | The hour, 0...23. |
mm | The minute, 0...59. |
ss | The seconds, 0.0, ..., 59.999... |
gmt | True if the time is a GMT time, false otherwise. |
Definition at line 219 of file DODS_Decimal_Year.cc.
void DODS_Decimal_Year::set | ( | string | date_time | ) |
Set an instance using the string representation of a DODS_Date_Time.
date_time | The date/time string. |
Definition at line 134 of file DODS_Decimal_Year.cc.
void DODS_Decimal_Year::set_epsilon | ( | double | eps | ) |
Set the value of epsilon used for equality tests of time. By default the value is 0.000001 (10e-6).
NB: This should rarely be changed.
Definition at line 306 of file DODS_Decimal_Year.cc.
time_t DODS_Decimal_Year::unix_time | ( | ) | const |
Return the number of seconds since 00:00:00 UTC 1 Jan 1970. If the date is before 1 Jan 1970, return DODS_UINT_MAX. If the date is too late to represent as seconds since 1 Jan 1970, return DODS_UINT_MAX. Each day starts at 00:00:00 UTC.
Definition at line 285 of file DODS_Decimal_Year.cc.
int DODS_Decimal_Year::year | ( | ) | const |
Definition at line 228 of file DODS_Decimal_Year.cc.
|
friend |
Inequality.
Definition at line 318 of file DODS_Decimal_Year.cc.
|
friend |
Less-than.
Definition at line 323 of file DODS_Decimal_Year.cc.
|
friend |
Less-than or Equal-to.
Definition at line 337 of file DODS_Decimal_Year.cc.
|
friend |
Equality.
Definition at line 312 of file DODS_Decimal_Year.cc.
|
friend |
Greater-than.
Definition at line 331 of file DODS_Decimal_Year.cc.
|
friend |
Greater-than or Equal-to.
Definition at line 344 of file DODS_Decimal_Year.cc.