~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/tztime.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-09-13 01:03:01 UTC
  • mto: (1126.9.2 captain-20090915-01)
  • mto: This revision was merged to the branch mainline in revision 1133.
  • Revision ID: osullivan.padraig@gmail.com-20090913010301-tcvvezipx1124acy
Added calls to the dtrace delete begin/end probes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_TZTIME_H
22
 
#define DRIZZLED_TZTIME_H
23
 
 
24
 
#if TIME_WITH_SYS_TIME
25
 
# include <sys/time.h>
26
 
# include <time.h>
27
 
#else
28
 
# if HAVE_SYS_TIME_H
29
 
#  include <sys/time.h>
30
 
# else
31
 
#  include <time.h>
32
 
# endif
33
 
#endif
34
 
 
35
 
#include "drizzled/memory/sql_alloc.h"
36
 
 
37
 
namespace drizzled
38
 
{
39
 
 
40
 
class String;
41
 
typedef struct st_drizzle_time DRIZZLE_TIME;
42
21
 
43
22
/**
44
23
  This class represents abstract time zone and provides
46
25
  Actual time zones which are specified by DB, or via offset
47
26
  or use system functions are its descendants.
48
27
*/
49
 
class Time_zone: public memory::SqlAlloc
 
28
class Time_zone: public Sql_alloc
50
29
{
51
30
public:
52
31
  Time_zone() {}                              /* Remove gcc warning */
57
36
    falls into spring time-gap (or lefts it untouched otherwise).
58
37
  */
59
38
  virtual time_t TIME_to_gmt_sec(const DRIZZLE_TIME *t,
60
 
                                 bool *in_dst_time_gap) const = 0;
 
39
                                    bool *in_dst_time_gap) const = 0;
61
40
  /**
62
41
    Converts time in time_t representation to local time in
63
42
    broken down DRIZZLE_TIME representation.
72
51
 
73
52
  /**
74
53
    We need this only for surpressing warnings, objects of this type are
75
 
    allocated on memory::Root and should not require destruction.
 
54
    allocated on MEM_ROOT and should not require destruction.
76
55
  */
77
56
  virtual ~Time_zone() {};
78
57
};
79
58
 
 
59
extern Time_zone * my_tz_UTC;
80
60
extern Time_zone * my_tz_SYSTEM;
 
61
extern Time_zone * my_tz_OFFSET0;
81
62
extern Time_zone * my_tz_find(Session *session, const String *name);
82
63
extern bool     my_tz_init(Session *org_session, const char *default_tzname);
 
64
extern void        my_tz_free();
83
65
extern time_t   sec_since_epoch_TIME(DRIZZLE_TIME *t);
84
 
 
85
 
} /* namespace drizzled */
86
 
 
87
 
#endif /* DRIZZLED_TZTIME_H */