Back to home page

EIC code displayed by LXR

 
 

    


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 /* Copyright (c) 2002,2003 CrystalClear Software, Inc.
0005  * Use, modification and distribution is subject to the
0006  * Boost Software License, Version 1.0. (See accompanying
0007  * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
0008  * Author: Jeff Garland, Bart Garst
0009  * $Date$
0010  */
0011 
0012 
0013 namespace boost {
0014 namespace date_time {
0015 
0016 
0017   //! Simple time iterator skeleton class
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 &current_;}
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 } }//namespace date_time
0050 
0051 
0052 #endif