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_BASE_HH_
00023 # define TOOL_ITERATOR_BASE_HH_
00024
00025 # include <boost/optional.hpp>
00026
00027 # include <trace-tools/tool/iterator.hh>
00028
00029 namespace tool
00030 {
00031
00032 template <class B>
00033 struct iterator_base;
00034
00036 template <class B>
00037 struct types< iterator_base<B> >
00038 {
00040 typedef undefined_type value_type;
00041
00043 typedef undefined_type iterable_type;
00044 };
00045
00060 template <class Bottom>
00061 struct iterator_base: tt_inherit(public iterator, iterator_base<Bottom>)
00062 {
00064 typedef tt_get_exact(Bottom, iterator_base<Bottom>) exact_type;
00065
00067 typedef tt_type(value_type, exact_type) value_type;
00068
00070 typedef tt_type(iterable_type, exact_type) iterable_type;
00071
00073 iterator_base(iterable_type& i, bool end);
00074
00076 bool equal(const iterator_base&) const;
00077
00079 const value_type& get() const;
00080
00082 const value_type* get_ptr() const;
00083
00084 protected:
00086 ~iterator_base();
00087
00088 protected:
00090 typedef typename boost::optional<value_type> optional_value;
00091
00093 iterable_type* i_;
00094
00096 optional_value v_;
00097 };
00098
00099 }
00100
00101 # include "iterator_base.hxx"
00102
00103 #endif // ! TOOL_ITERATOR_BASE_HH_