~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/temporal.h

  • Committer: Patrick Crews
  • Date: 2010-09-14 20:21:03 UTC
  • mto: (1771.1.1 pcrews)
  • mto: This revision was merged to the branch mainline in revision 1772.
  • Revision ID: gleebix@gmail.com-20100914202103-1db2n0bshzafep19
Moved transaction_log tests into updated non-publisher-based tree

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) 2008-2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008-2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
72
72
#include <ostream>
73
73
 
74
74
/* Outside forward declarations */
75
 
namespace type {
76
 
class Decimal;
77
 
}
 
75
class my_decimal;
78
76
 
79
77
namespace drizzled
80
78
{
421
419
   *
422
420
   * @param Pointer to a time_t to convert to
423
421
   */
424
 
  virtual void to_time_t(time_t &to) const;
 
422
  virtual void to_time_t(time_t *to) const;
425
423
 
426
424
  /**
427
425
   * Attempts to populate the Date instance based
435
433
  virtual bool from_time_t(const time_t from);
436
434
 
437
435
  /**
438
 
   * Fills a supplied type::Decimal with a representation of
 
436
   * Fills a supplied my_decimal with a representation of
439
437
   * the Date value.
440
438
   *
441
 
   * @param Pointer to the type::Decimal to fill
 
439
   * @param Pointer to the my_decimal to fill
442
440
   */
443
 
  virtual void to_decimal(type::Decimal *to) const;
 
441
  virtual void to_decimal(my_decimal *to) const;
444
442
 
445
443
  friend class TemporalInterval;
446
444
  friend class Timestamp;
487
485
  bool is_valid_datetime() const {return false;}
488
486
  bool is_valid_time() const {return is_valid();}
489
487
  bool is_valid_timestamp() const {return false;}
490
 
 
491
488
  /** Returns whether the temporal value is valid date. */
492
489
  bool is_valid() const;
493
 
  bool is_fuzzy_valid() const;
494
490
 
495
491
  /**
496
492
   * Fills a supplied char string with a
534
530
  void to_int32_t(int32_t *to) const;
535
531
 
536
532
  /**
537
 
   * Fills a supplied 8-byte integer pointer with an
538
 
   * integer representation of the Time
539
 
   * value. It is assume seconds past unix epoch
540
 
   *
541
 
   * @param Integer to fill.
542
 
   */
543
 
  void to_uint64_t(uint64_t &to) const;
544
 
 
545
 
  /**
546
533
   * Attempts to populate the Time instance based
547
534
   * on the contents of a supplied 4-byte integer.
548
535
   *
570
557
  bool from_time_t(const time_t from);
571
558
 
572
559
  /**
573
 
   * Fills a supplied type::Decimal with a representation of
 
560
   * Fills a supplied my_decimal with a representation of
574
561
   * the Time value.
575
562
   *
576
 
   * @param Pointer to the type::Decimal to fill
 
563
   * @param Pointer to the my_decimal to fill
577
564
   */
578
 
  void to_decimal(type::Decimal *to) const;
 
565
  void to_decimal(my_decimal *to) const;
579
566
 
580
567
  friend class Date;
581
568
  friend class DateTime;
656
643
   * @param time_t to convert from
657
644
   */
658
645
  bool from_time_t(const time_t from);
659
 
  bool from_timeval(struct timeval &_timeval);
660
646
 
661
647
  /**
662
648
   * Attempts to populate the DateTime instance based
685
671
  void to_tm(struct tm *to) const;
686
672
 
687
673
  /**
688
 
   * Fills a supplied type::Decimal with a representation of
 
674
   * Fills a supplied my_decimal with a representation of
689
675
   * the DateTime value.
690
676
   *
691
 
   * @param Pointer to the type::Decimal to fill
 
677
   * @param Pointer to the my_decimal to fill
692
678
   */
693
 
  void to_decimal(type::Decimal *to) const;
 
679
  void to_decimal(my_decimal *to) const;
694
680
 
695
681
  friend class Timestamp;
696
682
};
752
738
   *
753
739
   * @param Pointer to a time_t to convert to
754
740
   */
755
 
  void to_time_t(time_t &to) const;
 
741
  void to_time_t(time_t *to) const;
756
742
};
757
743
 
758
744
/**
800
786
   *
801
787
   * @param timeval to fill.
802
788
   */
803
 
  void to_timeval(struct timeval &to) const;
 
789
  void to_timeval(struct timeval *to) const;
804
790
};
805
791
 
806
792
/**