00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef TOOL_ITERATOR_HH_
00023 # define TOOL_ITERATOR_HH_
00024
00025 # include <boost/optional.hpp>
00026
00027 # include <wipal/tool/static_base.hh>
00028
00029 namespace wpl
00030 {
00031
00032 namespace tool
00033 {
00034
00035 template <class B>
00036 struct iterator;
00037
00039 template <class B>
00040 struct types< iterator<B> >
00041 {
00042 typedef undefined_type value_type;
00043 };
00044
00064 template <class Bottom>
00065 struct iterator: WP_INHERIT(public static_base, iterator<Bottom>)
00066 {
00068 typedef WP_GET_EXACT(Bottom, iterator<Bottom>) exact_type;
00069
00071
00072 typedef ssize_t difference_type;
00073 typedef WP_TYPE(value_type, exact_type) value_type;
00074 typedef value_type* pointer;
00075 typedef value_type& reference;
00076 typedef std::input_iterator_tag iterator_category;
00078
00080
00081 bool operator == (const exact_type&) const;
00082 bool operator != (const exact_type&) const;
00084
00086
00087 const exact_type& operator ++ ();
00088 exact_type operator ++ (int);
00090
00092
00093 const value_type& operator * () const;
00094 const value_type* operator -> () const;
00096
00097 protected:
00099 ~iterator();
00100 };
00101
00102 }
00103
00104 }
00105
00106 # include "iterator.hxx"
00107
00108 #endif // ! TOOL_ITERATOR_HH_