00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 #ifndef MLN_TOPO_INTERNAL_COMPLEX_ITERATOR_BASE_HH
00027 # define MLN_TOPO_INTERNAL_COMPLEX_ITERATOR_BASE_HH
00028 
00057 # include <iosfwd>
00058 # include <iostream>
00059 
00060 # include <mln/core/concept/iterator.hh>
00061 # include <mln/topo/complex.hh>
00062 
00063 
00064 namespace mln
00065 {
00066 
00067   namespace topo
00068   {
00069 
00070     namespace internal
00071     {
00072 
00077       template <typename F, typename E>
00078       class complex_iterator_base : public Iterator<E>
00079       {
00080         typedef complex_iterator_base<F, E> self_;
00081 
00082       public:
00084         typedef F face;
00085 
00091         const face& subject() const;
00093         operator const F&() const;
00095 
00096       protected:
00098         face f_;
00099       };
00100 
00101 
00103       template <typename F, typename E>
00104       inline
00105       std::ostream&
00106       operator<<(std::ostream& ostr, const complex_iterator_base<F, E>& p);
00107 
00108 
00109 
00110 # ifndef MLN_INCLUDE_ONLY
00111 
00112       template <typename F, typename E>
00113       inline
00114       const F&
00115       complex_iterator_base<F, E>::subject() const
00116       {
00117         return f_;
00118       }
00119 
00120       template <typename F, typename E>
00121       inline
00122       complex_iterator_base<F, E>::operator const F& () const
00123       {
00124         return f_;
00125       }
00126 
00127 
00128       template <typename F, typename E>
00129       inline
00130       std::ostream&
00131       operator<<(std::ostream& ostr, const complex_iterator_base<F, E>& p)
00132       {
00133         return ostr << F(p);
00134       }
00135 
00136 # endif // ! MLN_INCLUDE_ONLY
00137 
00138     } 
00139 
00140   } 
00141 
00142 } 
00143 
00144 #endif // ! MLN_TOPO_INTERNAL_COMPLEX_ITERATOR_BASE_HH