#include <temporal.h>
Public Member Functions | |
enum calendar | calendar () const |
void | set_nseconds (const uint32_t nsecond) |
uint32_t | nseconds () const |
void | set_useconds (const uint32_t usecond) |
uint32_t | useconds () const |
void | set_epoch_seconds () |
void | set_epoch_seconds (const uint32_t epoch_second) |
time_t | epoch_seconds () const |
void | set_seconds (const uint32_t second) |
uint32_t | seconds () const |
void | set_minutes (const uint32_t minute) |
uint32_t | minutes () const |
void | set_hours (const uint32_t hour) |
uint32_t | hours () const |
void | set_days (const uint32_t day) |
uint32_t | days () const |
void | set_months (const uint32_t month) |
uint32_t | months () const |
void | set_years (const uint32_t year) |
uint32_t | years () const |
bool | overflow () const |
virtual bool | is_valid_date () const =0 |
virtual bool | is_valid_datetime () const =0 |
virtual bool | is_valid_time () const =0 |
virtual bool | is_valid_timestamp () const =0 |
virtual bool | is_valid () const =0 |
Protected Member Functions | |
uint64_t | _cumulative_seconds_in_time () const |
void | _reset () |
Protected Attributes | |
enum calendar | _calendar |
uint32_t | _years |
uint32_t | _months |
uint32_t | _days |
uint32_t | _hours |
uint32_t | _minutes |
uint32_t | _seconds |
time_t | _epoch_seconds |
uint32_t | _useconds |
uint32_t | _nseconds |
bool | _overflow |
Friends | |
class | TemporalFormat |
Base class for all temporal data classes.
Definition at line 79 of file temporal.h.
|
protected |
Returns number of seconds in time components (hour + minute + second)
Definition at line 78 of file temporal.cc.
Referenced by drizzled::Date::operator+(), drizzled::Time::operator+(), drizzled::Date::operator+=(), drizzled::Time::operator+=(), drizzled::Date::operator-(), drizzled::Time::operator-(), drizzled::Date::operator-=(), and drizzled::Time::operator-=().
|
inlineprotected |
Resets all temporal components to zero
Definition at line 97 of file temporal.h.
|
inline |
Returns the calendar component.
Definition at line 108 of file temporal.h.
|
inline |
Returns the days component.
Definition at line 142 of file temporal.h.
Referenced by drizzled::operator<<(), drizzled::Item_func_curdate_local::store_now_in_TIME(), drizzled::Item_func_curdate_utc::store_now_in_TIME(), drizzled::Item_func_dayofyear::val_int(), drizzled::Item_func_dayofmonth::val_int(), drizzled::Item_func_weekday::val_int(), drizzled::Item_extract::val_int(), and drizzled::Item_func_year::val_int_endpoint().
|
inline |
Returns the UNIX epoch seconds component.
Definition at line 126 of file temporal.h.
|
inline |
Returns the hours component.
Definition at line 138 of file temporal.h.
Referenced by drizzled::operator<<(), drizzled::Item_func_hour::val_int(), drizzled::Item_extract::val_int(), drizzled::Item_func_year::val_int_endpoint(), and drizzled::Item_func_to_days::val_int_endpoint().
|
pure virtual |
Returns whether the temporal value is valid. Each subclass defines what is valid for the range of temporal data it contains.
Implemented in drizzled::NanoTimestamp, drizzled::MicroTimestamp, drizzled::Timestamp, drizzled::DateTime, drizzled::Time, and drizzled::Date.
|
pure virtual |
Returns whether the temporal value is valid as a date.
Implemented in drizzled::Time, and drizzled::Date.
|
pure virtual |
Returns whether the temporal value is valid as a datetime.
Implemented in drizzled::Time, and drizzled::Date.
|
pure virtual |
Returns whether the temporal value is valid as a time.
Implemented in drizzled::Time, and drizzled::Date.
|
pure virtual |
Returns whether the temporal value is valid as a UNIX timestamp.
Implemented in drizzled::Timestamp, drizzled::Time, and drizzled::Date.
|
inline |
Returns the minutes component.
Definition at line 134 of file temporal.h.
Referenced by drizzled::operator<<(), drizzled::Item_func_minute::val_int(), drizzled::Item_extract::val_int(), drizzled::Item_func_year::val_int_endpoint(), and drizzled::Item_func_to_days::val_int_endpoint().
|
inline |
Returns the months component.
Definition at line 146 of file temporal.h.
Referenced by drizzled::Item_func_last_day::get_temporal(), drizzled::operator<<(), drizzled::Item_func_curdate_local::store_now_in_TIME(), drizzled::Item_func_curdate_utc::store_now_in_TIME(), drizzled::Item_func_dayofyear::val_int(), drizzled::Item_func_quarter::val_int(), drizzled::Item_func_month::val_int(), drizzled::Item_func_weekday::val_int(), drizzled::Item_extract::val_int(), and drizzled::Item_func_year::val_int_endpoint().
|
inline |
Returns the nanoseconds component.
Definition at line 112 of file temporal.h.
Referenced by drizzled::Item_func_to_days::val_int_endpoint().
|
inline |
Returns whether the overflow flag was set (which can occur during an overloaded operator's execution)
Definition at line 153 of file temporal.h.
|
inline |
Returns the seconds component.
Definition at line 130 of file temporal.h.
Referenced by drizzled::operator<<(), drizzled::Item_func_second::val_int(), drizzled::Item_extract::val_int(), drizzled::Item_func_year::val_int_endpoint(), and drizzled::Item_func_to_days::val_int_endpoint().
|
inline |
Sets the days component.
Definition at line 140 of file temporal.h.
Referenced by drizzled::Item_func_curdate::fix_length_and_dec(), drizzled::Item_func_last_day::get_temporal(), drizzled::Field_datetime::store_time(), drizzled::Item_func_unix_timestamp::val_int(), and drizzle_plugin::js::JsFunction::val_str().
void drizzled::Temporal::set_epoch_seconds | ( | ) |
Sets the epoch_seconds component automatically, based on the temporal's components.
Definition at line 123 of file temporal.cc.
References drizzled::in_unix_epoch_range().
Referenced by drizzled::DateTime::from_int64_t(), drizzled::Date::from_string(), drizzled::DateTime::from_string(), drizzled::Date::from_tm(), drizzled::Item_func_unix_timestamp::val_int(), and drizzle_plugin::js::JsFunction::val_str().
|
inline |
Sets the epch_seconds component manually.
Definition at line 123 of file temporal.h.
|
inline |
Sets the hours component.
Definition at line 136 of file temporal.h.
Referenced by drizzled::Field_datetime::store_time(), drizzled::Item_func_unix_timestamp::val_int(), and drizzle_plugin::js::JsFunction::val_str().
|
inline |
Sets the days component.
Definition at line 132 of file temporal.h.
Referenced by drizzled::Field_datetime::store_time(), drizzled::Item_func_unix_timestamp::val_int(), and drizzle_plugin::js::JsFunction::val_str().
|
inline |
Sets the months component.
Definition at line 144 of file temporal.h.
Referenced by drizzled::Item_func_curdate::fix_length_and_dec(), drizzled::Field_datetime::store_time(), drizzled::Item_func_unix_timestamp::val_int(), and drizzle_plugin::js::JsFunction::val_str().
|
inline |
Sets the nseconds component.
Definition at line 110 of file temporal.h.
|
inline |
Sets the seconds component.
Definition at line 128 of file temporal.h.
Referenced by drizzled::Field_datetime::store_time(), drizzled::Item_func_unix_timestamp::val_int(), and drizzle_plugin::js::JsFunction::val_str().
|
inline |
Sets the useconds component.
Definition at line 114 of file temporal.h.
|
inline |
Sets the years component.
Definition at line 148 of file temporal.h.
Referenced by drizzled::Item_func_curdate::fix_length_and_dec(), drizzled::Field_datetime::store_time(), drizzled::Item_func_unix_timestamp::val_int(), and drizzle_plugin::js::JsFunction::val_str().
|
inline |
Returns the microsseconds component.
Definition at line 116 of file temporal.h.
Referenced by drizzled::Item_func_microsecond::val_int(), drizzled::Item_extract::val_int(), drizzled::Item_func_year::val_int_endpoint(), and drizzled::Item_func_to_days::val_int_endpoint().
|
inline |
Returns the years component.
Definition at line 150 of file temporal.h.
Referenced by drizzled::Item_func_last_day::get_temporal(), drizzled::operator<<(), drizzled::Item_func_curdate_local::store_now_in_TIME(), drizzled::Item_func_curdate_utc::store_now_in_TIME(), drizzled::Item_func_year::val_int(), drizzled::Item_func_dayofyear::val_int(), drizzled::Item_func_weekday::val_int(), drizzled::Item_extract::val_int(), and drizzled::Item_func_year::val_int_endpoint().
|
friend |
All Temporal derived classes must implement conversion routines for converting to and from a string. Subclasses implement other conversion routines, but should always follow these notes:
1) Ensure that ALL from_xxx methods call is_valid() 2) Ensure that ALL to_xxx methods are void returns and do not call is_valid()
This minimizes the repeated bounds-checking to just the conversion from_xxx routines.
Definition at line 184 of file temporal.h.
|
protected |
Set on some operator overloads. Indicates that an overflow occurred.
Definition at line 93 of file temporal.h.