Chris@16: #ifndef DATE_TIME_TIME_ITERATOR_HPP___ Chris@16: #define DATE_TIME_TIME_ITERATOR_HPP___ Chris@16: Chris@16: /* Copyright (c) 2002,2003 CrystalClear Software, Inc. Chris@16: * Use, modification and distribution is subject to the Chris@16: * Boost Software License, Version 1.0. (See accompanying Chris@16: * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) Chris@16: * Author: Jeff Garland, Bart Garst Chris@101: * $Date$ Chris@16: */ Chris@16: Chris@16: Chris@16: namespace boost { Chris@16: namespace date_time { Chris@16: Chris@16: Chris@16: //! Simple time iterator skeleton class Chris@16: template Chris@16: class time_itr { Chris@16: public: Chris@16: typedef typename time_type::time_duration_type time_duration_type; Chris@16: time_itr(time_type t, time_duration_type d) : current_(t), offset_(d) {} Chris@16: time_itr& operator++() Chris@16: { Chris@16: current_ = current_ + offset_; Chris@16: return *this; Chris@16: } Chris@16: time_itr& operator--() Chris@16: { Chris@16: current_ = current_ - offset_; Chris@16: return *this; Chris@16: } Chris@16: time_type operator*() {return current_;} Chris@16: time_type* operator->() {return ¤t_;} Chris@16: bool operator< (const time_type& t) {return current_ < t;} Chris@16: bool operator<= (const time_type& t) {return current_ <= t;} Chris@16: bool operator!= (const time_type& t) {return current_ != t;} Chris@16: bool operator== (const time_type& t) {return current_ == t;} Chris@16: bool operator> (const time_type& t) {return current_ > t;} Chris@16: bool operator>= (const time_type& t) {return current_ >= t;} Chris@16: Chris@16: private: Chris@16: time_type current_; Chris@16: time_duration_type offset_; Chris@16: }; Chris@16: Chris@16: Chris@16: Chris@16: } }//namespace date_time Chris@16: Chris@16: Chris@16: #endif