12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #ifndef DATE_TIME_TIME_ITERATOR_HPP___
- #define DATE_TIME_TIME_ITERATOR_HPP___
- namespace boost {
- namespace date_time {
-
- template<class time_type>
- class time_itr {
- public:
- typedef typename time_type::time_duration_type time_duration_type;
- time_itr(time_type t, time_duration_type d) : current_(t), offset_(d) {}
- time_itr& operator++()
- {
- current_ = current_ + offset_;
- return *this;
- }
- time_itr& operator--()
- {
- current_ = current_ - offset_;
- return *this;
- }
- const time_type& operator*() const {return current_;}
- const time_type* operator->() const {return ¤t_;}
- bool operator< (const time_type& t) const {return current_ < t;}
- bool operator<= (const time_type& t) const {return current_ <= t;}
- bool operator!= (const time_type& t) const {return current_ != t;}
- bool operator== (const time_type& t) const {return current_ == t;}
- bool operator> (const time_type& t) const {return current_ > t;}
- bool operator>= (const time_type& t) const {return current_ >= t;}
- private:
- time_type current_;
- time_duration_type offset_;
- };
- } }
- #endif
|