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 tool
00030 {
00031
00032 template <class B>
00033 struct iterator;
00034
00036 template <class B>
00037 struct types< iterator<B> >
00038 {
00039 typedef undefined_type value_type;
00040 };
00041
00061 template <class Bottom>
00062 struct iterator: WP_INHERIT(public static_base, iterator<Bottom>)
00063 {
00065 typedef WP_GET_EXACT(Bottom, iterator<Bottom>) exact_type;
00066
00068
00069 typedef ssize_t difference_type;
00070 typedef WP_TYPE(value_type, exact_type) value_type;
00071 typedef value_type* pointer;
00072 typedef value_type& reference;
00073 typedef std::input_iterator_tag iterator_category;
00075
00077
00078 bool operator == (const exact_type&) const;
00079 bool operator != (const exact_type&) const;
00081
00083
00084 const exact_type& operator ++ ();
00085 exact_type operator ++ (int);
00087
00089
00090 const value_type& operator * () const;
00091 const value_type* operator -> () const;
00093
00094 protected:
00096 ~iterator();
00097 };
00098
00099 }
00100
00101 # include "iterator.hxx"
00102
00103 #endif // ! TOOL_ITERATOR_HH_