MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Time_zone Class Reference

#include <tztime.h>

Inheritance diagram for Time_zone:
Collaboration diagram for Time_zone:

Public Member Functions

virtual my_time_t TIME_to_gmt_sec (const MYSQL_TIME *t, my_bool *in_dst_time_gap) const =0
virtual void gmt_sec_to_TIME (MYSQL_TIME *tmp, my_time_t t) const =0
void gmt_sec_to_TIME (MYSQL_TIME *tmp, struct timeval tv)
virtual const Stringget_name () const =0
virtual ~Time_zone ()

Static Protected Member Functions

static void adjust_leap_second (MYSQL_TIME *t)

Additional Inherited Members

- Static Public Member Functions inherited from Sql_alloc
static void * operator new (size_t size) throw ()
static void * operator new[] (size_t size) throw ()
static void * operator new[] (size_t size, MEM_ROOT *mem_root) throw ()
static void * operator new (size_t size, MEM_ROOT *mem_root) throw ()
static void operator delete (void *ptr, size_t size)
static void operator delete (void *ptr, MEM_ROOT *mem_root)
static void operator delete[] (void *ptr, MEM_ROOT *mem_root)
static void operator delete[] (void *ptr, size_t size)

Detailed Description

This class represents abstract time zone and provides basic interface for MYSQL_TIME <-> my_time_t conversion. Actual time zones which are specified by DB, or via offset or use system functions are its descendants.

Definition at line 37 of file tztime.h.

Constructor & Destructor Documentation

virtual Time_zone::~Time_zone ( )
inlinevirtual

We need this only for surpressing warnings, objects of this type are allocated on MEM_ROOT and should not require destruction.

Definition at line 74 of file tztime.h.

Member Function Documentation

void Time_zone::adjust_leap_second ( MYSQL_TIME t)
inlinestaticprotected

Convert leap seconds into non-leap

This function will convert the leap seconds added by the OS to non-leap seconds, e.g. 23:59:59, 23:59:60 -> 23:59:59, 00:00:01 ... This check is not checking for years on purpose : although it's not a complete check this way it doesn't require looking (and having installed) the leap seconds table.

Parameters
[in,out]brokendown time structure as filled in by the OS

Definition at line 2347 of file tztime.cc.

Here is the caller graph for this function:

virtual const String* Time_zone::get_name ( ) const
pure virtual

Because of constness of String returned by get_name() time zone name have to be already zeroended to be able to use String::ptr() instead of c_ptr().

Implemented in Time_zone_offset, Time_zone_db, Time_zone_utc, and Time_zone_system.

virtual void Time_zone::gmt_sec_to_TIME ( MYSQL_TIME tmp,
my_time_t  t 
) const
pure virtual

Converts time in my_time_t representation to local time in broken down MYSQL_TIME representation.

Implemented in Time_zone_offset, Time_zone_db, Time_zone_utc, and Time_zone_system.

Here is the caller graph for this function:

void Time_zone::gmt_sec_to_TIME ( MYSQL_TIME tmp,
struct timeval  tv 
)
inline

Comverts "struct timeval" to local time in broken down MYSQL_TIME represendation.

Definition at line 58 of file tztime.h.

Here is the call graph for this function:

virtual my_time_t Time_zone::TIME_to_gmt_sec ( const MYSQL_TIME t,
my_bool *  in_dst_time_gap 
) const
pure virtual

Converts local time in broken down MYSQL_TIME representation to my_time_t (UTC seconds since Epoch) represenation. Returns 0 in case of error. Sets in_dst_time_gap to true if date provided falls into spring time-gap (or lefts it untouched otherwise).

Implemented in Time_zone_offset, Time_zone_db, Time_zone_utc, and Time_zone_system.

Here is the caller graph for this function:


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