|
drizzle
C++ MySQL-protocol-compatible database server
|
#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.
| drizzled::Temporal::Temporal | ( | ) |
Definition at line 63 of file temporal.cc.
|
inlinevirtual |
Definition at line 105 of file temporal.h.
|
protected |
Returns number of seconds in time components (hour + minute + second)
Definition at line 77 of file temporal.cc.
|
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.
|
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.
|
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::Date, drizzled::DateTime, drizzled::MicroTimestamp, drizzled::NanoTimestamp, drizzled::Time, and drizzled::Timestamp.
|
pure virtual |
Returns whether the temporal value is valid as a date.
Implemented in drizzled::Date, and drizzled::Time.
|
pure virtual |
Returns whether the temporal value is valid as a datetime.
Implemented in drizzled::Date, and drizzled::Time.
|
pure virtual |
Returns whether the temporal value is valid as a time.
Implemented in drizzled::Date, and drizzled::Time.
|
pure virtual |
Returns whether the temporal value is valid as a UNIX timestamp.
Implemented in drizzled::Date, drizzled::Time, and drizzled::Timestamp.
|
inline |
Returns the minutes component.
Definition at line 134 of file temporal.h.
|
inline |
Returns the months component.
Definition at line 146 of file temporal.h.
|
inline |
Returns the nanoseconds component.
Definition at line 112 of file temporal.h.
|
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.
|
inline |
Sets the days component.
Definition at line 140 of file temporal.h.
| void drizzled::Temporal::set_epoch_seconds | ( | ) |
Sets the epoch_seconds component automatically, based on the temporal's components.
Definition at line 85 of file temporal.cc.
|
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.
|
inline |
Sets the days component.
Definition at line 132 of file temporal.h.
|
inline |
Sets the months component.
Definition at line 144 of file temporal.h.
|
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.
|
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.
|
inline |
Returns the microsseconds component.
Definition at line 116 of file temporal.h.
|
inline |
Returns the years component.
Definition at line 150 of file temporal.h.
|
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 |
Definition at line 82 of file temporal.h.
|
protected |
Definition at line 85 of file temporal.h.
|
protected |
Definition at line 89 of file temporal.h.
|
protected |
Definition at line 86 of file temporal.h.
|
protected |
Definition at line 87 of file temporal.h.
|
protected |
Definition at line 84 of file temporal.h.
|
protected |
Definition at line 91 of file temporal.h.
|
protected |
Set on some operator overloads. Indicates that an overflow occurred.
Definition at line 93 of file temporal.h.
|
protected |
Definition at line 88 of file temporal.h.
|
protected |
Definition at line 90 of file temporal.h.
|
protected |
Definition at line 83 of file temporal.h.