~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/temporal_interval.h

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems
 
4
 *  Copyright (C) 2009 Sun Microsystems, Inc.
5
5
 *
6
6
 *  Authors: 
7
7
 *
25
25
#define DRIZZLED_TEMPORAL_INTERVAL_H
26
26
 
27
27
/* @TODO Replace this include with some forward decls */
28
 
#include "drizzled/item.h"
 
28
#include <drizzled/item.h>
 
29
#include <drizzled/type/time.h>
29
30
 
30
31
namespace drizzled 
31
32
{
39
40
public:
40
41
 
41
42
  TemporalInterval(uint32_t in_year,
42
 
      uint32_t in_month,
43
 
      uint32_t in_day,
44
 
      uint32_t in_hour,
45
 
      uint64_t in_minute,
46
 
      uint64_t in_second,
47
 
      uint64_t in_second_part,
48
 
      bool in_neg)
49
 
    :
50
 
      year(in_year),
51
 
      month(in_month),
52
 
      day(in_day),
53
 
      hour(in_hour),
54
 
      minute(in_minute),
55
 
      second(in_second),
56
 
      second_part(in_second_part),
57
 
      neg(in_neg)
 
43
                   uint32_t in_month,
 
44
                   uint32_t in_day,
 
45
                   uint32_t in_hour,
 
46
                   uint64_t in_minute,
 
47
                   uint64_t in_second,
 
48
                   uint64_t in_second_part,
 
49
                   bool in_neg) :
 
50
    year(in_year),
 
51
    month(in_month),
 
52
    day(in_day),
 
53
    hour(in_hour),
 
54
    minute(in_minute),
 
55
    second(in_second),
 
56
    second_part(in_second_part),
 
57
    neg(in_neg)
58
58
  {}
59
59
 
60
 
  TemporalInterval()
61
 
    :
62
 
      year(0),
63
 
      month(0),
64
 
      day(0),
65
 
      hour(0),
66
 
      minute(0),
67
 
      second(0),
68
 
      second_part(0),
69
 
      neg(false)
 
60
  TemporalInterval() :
 
61
    year(0),
 
62
    month(0),
 
63
    day(0),
 
64
    hour(0),
 
65
    minute(0),
 
66
    second(0),
 
67
    second_part(0),
 
68
    neg(false)
70
69
  {}
71
70
 
72
71
  /**
95
94
    return neg;
96
95
  }
97
96
 
98
 
  inline uint32_t  get_year() { return year; };
99
 
  inline void set_year(uint32_t new_year) { year = new_year; };
100
 
 
101
 
  inline uint32_t  get_month(){ return month; };
102
 
  inline void set_month(uint32_t new_month) { month = new_month; };
103
 
 
104
 
  inline uint32_t  get_day(){ return day; };
105
 
  inline void set_day(uint32_t new_day) { day = new_day; };
106
 
 
107
 
  inline uint32_t  get_hour(){ return hour; };
108
 
  inline void set_hour(uint32_t new_hour) { hour = new_hour; };
109
 
 
110
 
  inline uint64_t  get_minute(){ return minute; };
111
 
  inline void set_minute(uint32_t new_minute) { minute = new_minute; };
112
 
 
113
 
  inline uint64_t  get_second(){ return second; };
114
 
  inline void set_second(uint32_t new_second) { second = new_second; };
115
 
 
116
 
  inline uint64_t  get_second_part(){ return second_part; };
117
 
  inline void set_second_part(uint32_t new_second_part) { second_part = new_second_part; };
 
97
  inline uint32_t  get_year() { return year; }
 
98
  inline void set_year(uint32_t new_year) { year = new_year; }
 
99
 
 
100
  inline uint32_t  get_month(){ return month; }
 
101
  inline void set_month(uint32_t new_month) { month = new_month; }
 
102
 
 
103
  inline uint32_t  get_day(){ return day; }
 
104
  inline void set_day(uint32_t new_day) { day = new_day; }
 
105
 
 
106
  inline uint32_t  get_hour(){ return hour; }
 
107
  inline void set_hour(uint32_t new_hour) { hour = new_hour; }
 
108
 
 
109
  inline uint64_t  get_minute(){ return minute; }
 
110
  inline void set_minute(uint32_t new_minute) { minute = new_minute; }
 
111
 
 
112
  inline uint64_t  get_second(){ return second; }
 
113
  inline void set_second(uint32_t new_second) { second = new_second; }
 
114
 
 
115
  inline uint64_t  get_second_part(){ return second_part; }
 
116
  inline void set_second_part(uint32_t new_second_part) { second_part = new_second_part; }
118
117
 
119
118
  /**
120
119
   * Populate this TemporalInterval from a string value
137
136
   * @retval true date was added and value stored properly
138
137
   * @retval false result of addition is a null value
139
138
   */
140
 
  bool addDate(DRIZZLE_TIME *ltime, interval_type int_type);
 
139
  bool addDate(type::Time *ltime, interval_type int_type);
141
140
 
142
141
private:
143
142