drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::Temporal Class Referenceabstract

#include <temporal.h>

Inheritance diagram for drizzled::Temporal:
[legend]

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

Detailed Description

Base class for all temporal data classes.

Definition at line 79 of file temporal.h.

Constructor & Destructor Documentation

◆ Temporal()

drizzled::Temporal::Temporal ( )

Definition at line 63 of file temporal.cc.

◆ ~Temporal()

virtual drizzled::Temporal::~Temporal ( )
inlinevirtual

Definition at line 105 of file temporal.h.

Member Function Documentation

◆ _cumulative_seconds_in_time()

uint64_t drizzled::Temporal::_cumulative_seconds_in_time ( ) const
protected

Returns number of seconds in time components (hour + minute + second)

Definition at line 77 of file temporal.cc.

◆ _reset()

void drizzled::Temporal::_reset ( )
inlineprotected

Resets all temporal components to zero

Definition at line 97 of file temporal.h.

◆ calendar()

enum calendar drizzled::Temporal::calendar ( ) const
inline

Returns the calendar component.

Definition at line 108 of file temporal.h.

◆ days()

uint32_t drizzled::Temporal::days ( ) const
inline

Returns the days component.

Definition at line 142 of file temporal.h.

◆ epoch_seconds()

time_t drizzled::Temporal::epoch_seconds ( ) const
inline

Returns the UNIX epoch seconds component.

Definition at line 126 of file temporal.h.

◆ hours()

uint32_t drizzled::Temporal::hours ( ) const
inline

Returns the hours component.

Definition at line 138 of file temporal.h.

◆ is_valid()

virtual bool drizzled::Temporal::is_valid ( ) const
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.

◆ is_valid_date()

virtual bool drizzled::Temporal::is_valid_date ( ) const
pure virtual

Returns whether the temporal value is valid as a date.

Implemented in drizzled::Date, and drizzled::Time.

◆ is_valid_datetime()

virtual bool drizzled::Temporal::is_valid_datetime ( ) const
pure virtual

Returns whether the temporal value is valid as a datetime.

Implemented in drizzled::Date, and drizzled::Time.

◆ is_valid_time()

virtual bool drizzled::Temporal::is_valid_time ( ) const
pure virtual

Returns whether the temporal value is valid as a time.

Implemented in drizzled::Date, and drizzled::Time.

◆ is_valid_timestamp()

virtual bool drizzled::Temporal::is_valid_timestamp ( ) const
pure virtual

Returns whether the temporal value is valid as a UNIX timestamp.

Implemented in drizzled::Date, drizzled::Time, and drizzled::Timestamp.

◆ minutes()

uint32_t drizzled::Temporal::minutes ( ) const
inline

Returns the minutes component.

Definition at line 134 of file temporal.h.

◆ months()

uint32_t drizzled::Temporal::months ( ) const
inline

Returns the months component.

Definition at line 146 of file temporal.h.

◆ nseconds()

uint32_t drizzled::Temporal::nseconds ( ) const
inline

Returns the nanoseconds component.

Definition at line 112 of file temporal.h.

◆ overflow()

bool drizzled::Temporal::overflow ( ) const
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.

◆ seconds()

uint32_t drizzled::Temporal::seconds ( ) const
inline

Returns the seconds component.

Definition at line 130 of file temporal.h.

◆ set_days()

void drizzled::Temporal::set_days ( const uint32_t day)
inline

Sets the days component.

Definition at line 140 of file temporal.h.

◆ set_epoch_seconds() [1/2]

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.

◆ set_epoch_seconds() [2/2]

void drizzled::Temporal::set_epoch_seconds ( const uint32_t epoch_second)
inline

Sets the epch_seconds component manually.

Definition at line 123 of file temporal.h.

◆ set_hours()

void drizzled::Temporal::set_hours ( const uint32_t hour)
inline

Sets the hours component.

Definition at line 136 of file temporal.h.

◆ set_minutes()

void drizzled::Temporal::set_minutes ( const uint32_t minute)
inline

Sets the days component.

Definition at line 132 of file temporal.h.

◆ set_months()

void drizzled::Temporal::set_months ( const uint32_t month)
inline

Sets the months component.

Definition at line 144 of file temporal.h.

◆ set_nseconds()

void drizzled::Temporal::set_nseconds ( const uint32_t nsecond)
inline

Sets the nseconds component.

Definition at line 110 of file temporal.h.

◆ set_seconds()

void drizzled::Temporal::set_seconds ( const uint32_t second)
inline

Sets the seconds component.

Definition at line 128 of file temporal.h.

◆ set_useconds()

void drizzled::Temporal::set_useconds ( const uint32_t usecond)
inline

Sets the useconds component.

Definition at line 114 of file temporal.h.

◆ set_years()

void drizzled::Temporal::set_years ( const uint32_t year)
inline

Sets the years component.

Definition at line 148 of file temporal.h.

◆ useconds()

uint32_t drizzled::Temporal::useconds ( ) const
inline

Returns the microsseconds component.

Definition at line 116 of file temporal.h.

◆ years()

uint32_t drizzled::Temporal::years ( ) const
inline

Returns the years component.

Definition at line 150 of file temporal.h.

◆ TemporalFormat

friend class TemporalFormat
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.

Member Data Documentation

◆ _calendar

enum calendar drizzled::Temporal::_calendar
protected

Definition at line 82 of file temporal.h.

◆ _days

uint32_t drizzled::Temporal::_days
protected

Definition at line 85 of file temporal.h.

◆ _epoch_seconds

time_t drizzled::Temporal::_epoch_seconds
protected

Definition at line 89 of file temporal.h.

◆ _hours

uint32_t drizzled::Temporal::_hours
protected

Definition at line 86 of file temporal.h.

◆ _minutes

uint32_t drizzled::Temporal::_minutes
protected

Definition at line 87 of file temporal.h.

◆ _months

uint32_t drizzled::Temporal::_months
protected

Definition at line 84 of file temporal.h.

◆ _nseconds

uint32_t drizzled::Temporal::_nseconds
protected

Definition at line 91 of file temporal.h.

◆ _overflow

bool drizzled::Temporal::_overflow
protected

Set on some operator overloads. Indicates that an overflow occurred.

Definition at line 93 of file temporal.h.

◆ _seconds

uint32_t drizzled::Temporal::_seconds
protected

Definition at line 88 of file temporal.h.

◆ _useconds

uint32_t drizzled::Temporal::_useconds
protected

Definition at line 90 of file temporal.h.

◆ _years

uint32_t drizzled::Temporal::_years
protected

Definition at line 83 of file temporal.h.


The documentation for this class was generated from the following files: