~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/temporal_interval.h

Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22
22
 */
23
23
 
24
 
#ifndef DRIZZLED_TEMPORAL_INTERVAL_H
25
 
#define DRIZZLED_TEMPORAL_INTERVAL_H
 
24
#pragma once
26
25
 
27
26
/* @TODO Replace this include with some forward decls */
28
 
#include "drizzled/item.h"
 
27
#include <drizzled/item.h>
 
28
#include <drizzled/type/time.h>
29
29
 
30
30
namespace drizzled 
31
31
{
39
39
public:
40
40
 
41
41
  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)
 
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
    year(in_year),
 
50
    month(in_month),
 
51
    day(in_day),
 
52
    hour(in_hour),
 
53
    minute(in_minute),
 
54
    second(in_second),
 
55
    second_part(in_second_part),
 
56
    neg(in_neg)
58
57
  {}
59
58
 
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)
 
59
  TemporalInterval() :
 
60
    year(0),
 
61
    month(0),
 
62
    day(0),
 
63
    hour(0),
 
64
    minute(0),
 
65
    second(0),
 
66
    second_part(0),
 
67
    neg(false)
70
68
  {}
71
69
 
72
70
  /**
137
135
   * @retval true date was added and value stored properly
138
136
   * @retval false result of addition is a null value
139
137
   */
140
 
  bool addDate(DRIZZLE_TIME *ltime, interval_type int_type);
 
138
  bool addDate(type::Time *ltime, interval_type int_type);
141
139
 
142
140
private:
143
141
 
199
197
 
200
198
} /* namespace drizzled */
201
199
 
202
 
#endif /* DRIZZLED_TEMPORAL_INTERVAL_H */