~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/temporal.h

mergeĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
#include "drizzled/calendar.h"
74
74
 
 
75
#include <ostream>
 
76
 
75
77
/* Outside forward declarations */
76
78
class my_decimal;
77
79
 
215
217
   *
216
218
   * @param Date to compare against.
217
219
   */
218
 
  bool operator==(const Date &rhs);
219
 
  bool operator!=(const Date &rhs);
220
 
  bool operator>(const Date &rhs);
221
 
  bool operator>=(const Date &rhs);
222
 
  bool operator<(const Date &rhs);
223
 
  bool operator<=(const Date &rhs);
 
220
  virtual bool operator==(const Date &rhs);
 
221
  virtual bool operator!=(const Date &rhs);
 
222
  virtual bool operator>(const Date &rhs);
 
223
  virtual bool operator>=(const Date &rhs);
 
224
  virtual bool operator<(const Date &rhs);
 
225
  virtual bool operator<=(const Date &rhs);
224
226
 
225
227
  /**
226
228
   * Comparison operator overloads to compare a Date against
228
230
   *
229
231
   * @param DateTime to compare against.
230
232
   */
231
 
  bool operator==(const DateTime &rhs);
232
 
  bool operator!=(const DateTime &rhs);
233
 
  bool operator>(const DateTime &rhs);
234
 
  bool operator>=(const DateTime &rhs);
235
 
  bool operator<(const DateTime &rhs);
236
 
  bool operator<=(const DateTime &rhs);
 
233
  virtual bool operator==(const DateTime &rhs);
 
234
  virtual bool operator!=(const DateTime &rhs);
 
235
  virtual bool operator>(const DateTime &rhs);
 
236
  virtual bool operator>=(const DateTime &rhs);
 
237
  virtual bool operator<(const DateTime &rhs);
 
238
  virtual bool operator<=(const DateTime &rhs);
237
239
 
238
240
  /**
239
 
   * Comparison operator overloads to compare a Date against
 
241
   * Comparison operator overloads to compare this against
240
242
   * a Timestamp value.
241
243
   *
242
244
   * @param Timestamp to compare against.
243
245
   */
244
 
  bool operator==(const Timestamp &rhs);
245
 
  bool operator!=(const Timestamp &rhs);
246
 
  bool operator>(const Timestamp &rhs);
247
 
  bool operator>=(const Timestamp &rhs);
248
 
  bool operator<(const Timestamp &rhs);
249
 
  bool operator<=(const Timestamp &rhs);
 
246
  virtual bool operator==(const Timestamp &rhs);
 
247
  virtual bool operator!=(const Timestamp &rhs);
 
248
  virtual bool operator>(const Timestamp &rhs);
 
249
  virtual bool operator>=(const Timestamp &rhs);
 
250
  virtual bool operator<(const Timestamp &rhs);
 
251
  virtual bool operator<=(const Timestamp &rhs);
250
252
 
251
253
  /**
252
254
   * Operator overload for adding/subtracting another Date
449
451
  virtual void to_decimal(my_decimal *to) const;
450
452
 
451
453
  friend class TemporalInterval;
 
454
  friend class Timestamp;
452
455
};
453
456
 
454
457
/* Forward declare needed for friendship */
659
662
   * @param Pointer to the my_decimal to fill
660
663
   */
661
664
  void to_decimal(my_decimal *to) const;
 
665
 
 
666
  friend class Timestamp;
662
667
};
663
668
 
664
669
/**
669
674
public:
670
675
  Timestamp() :DateTime() {}
671
676
 
 
677
  /**
 
678
   * Comparison operator overloads to compare this against
 
679
   * a Date value.
 
680
   *
 
681
   * @param Timestamp to compare against.
 
682
   */
 
683
  bool operator==(const Date &rhs);
 
684
  bool operator!=(const Date &rhs);
 
685
  bool operator>(const Date &rhs);
 
686
  bool operator>=(const Date &rhs);
 
687
  bool operator<(const Date &rhs);
 
688
  bool operator<=(const Date &rhs);
 
689
 
 
690
  /**
 
691
   * Comparison operator overloads to compare this against
 
692
   * a DateTime value.
 
693
   *
 
694
   * @param DateTime to compare against.
 
695
   */
 
696
  bool operator==(const DateTime &rhs);
 
697
  bool operator!=(const DateTime &rhs);
 
698
  bool operator>(const DateTime &rhs);
 
699
  bool operator>=(const DateTime &rhs);
 
700
  bool operator<(const DateTime &rhs);
 
701
  bool operator<=(const DateTime &rhs);
 
702
 
 
703
  /**
 
704
   * Comparison operator overloads to compare this against
 
705
   * another Timestamp value.
 
706
   *
 
707
   * @param Timestamp to compare against.
 
708
   */
 
709
  bool operator==(const Timestamp &rhs);
 
710
  bool operator!=(const Timestamp &rhs);
 
711
  bool operator>(const Timestamp &rhs);
 
712
  bool operator>=(const Timestamp &rhs);
 
713
  bool operator<(const Timestamp &rhs);
 
714
  bool operator<=(const Timestamp &rhs);
 
715
 
672
716
  bool is_valid_timestamp() const {return is_valid();}
673
717
  /** Returns whether the temporal value is valid timestamp. */
674
718
  virtual bool is_valid() const;
683
727
};
684
728
 
685
729
/**
 
730
 * Operator overload to an output stream for a Timestamp.
 
731
 */
 
732
std::ostream& operator<<(std::ostream& os, const Timestamp& subject);
 
733
 
 
734
/**
686
735
 * Class representing temporal components in the UNIX epoch
687
736
 * with an additional microsecond component.
688
737
 */