File indexing completed on 2025-01-30 09:35:25
0001 #ifndef DATE_TIME_TIME_ITERATOR_HPP___
0002 #define DATE_TIME_TIME_ITERATOR_HPP___
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 namespace boost {
0014 namespace date_time {
0015
0016
0017
0018 template<class time_type>
0019 class time_itr {
0020 public:
0021 typedef typename time_type::time_duration_type time_duration_type;
0022 time_itr(time_type t, time_duration_type d) : current_(t), offset_(d) {}
0023 time_itr& operator++()
0024 {
0025 current_ = current_ + offset_;
0026 return *this;
0027 }
0028 time_itr& operator--()
0029 {
0030 current_ = current_ - offset_;
0031 return *this;
0032 }
0033 const time_type& operator*() const {return current_;}
0034 const time_type* operator->() const {return ¤t_;}
0035 bool operator< (const time_type& t) const {return current_ < t;}
0036 bool operator<= (const time_type& t) const {return current_ <= t;}
0037 bool operator!= (const time_type& t) const {return current_ != t;}
0038 bool operator== (const time_type& t) const {return current_ == t;}
0039 bool operator> (const time_type& t) const {return current_ > t;}
0040 bool operator>= (const time_type& t) const {return current_ >= t;}
0041
0042 private:
0043 time_type current_;
0044 time_duration_type offset_;
0045 };
0046
0047
0048
0049 } }
0050
0051
0052 #endif