
* mln/topo/internal/complex_iter_base.hh: Rename as... * mln/topo/internal/complex_set_iterator_base.hh: ...this. (mln::internal::complex_iter_base<F, E>): Rename as... (mln::internal::complex_set_iternal_base<F, E>): ...this. * mln/topo/face_iter.hh, * mln/topo/n_face_iter.hh, * mln/topo/static_n_face_iter.hh, * mln/topo/attic/faces_iter.hh: Adjust derived classes. --- milena/ChangeLog | 14 +++++++ milena/mln/topo/attic/faces_iter.hh | 20 +++++---- milena/mln/topo/face_iter.hh | 18 +++++---- .../internal/complex_relative_iterator_base.hh | 3 + ...x_iter_base.hh => complex_set_iterator_base.hh} | 42 +++++++++---------- milena/mln/topo/n_face_iter.hh | 20 ++++++---- milena/mln/topo/static_n_face_iter.hh | 20 +++++---- 7 files changed, 81 insertions(+), 56 deletions(-) rename milena/mln/topo/internal/{complex_iter_base.hh => complex_set_iterator_base.hh} (76%) diff --git a/milena/ChangeLog b/milena/ChangeLog index 6c59174..226bbf5 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,17 @@ +2008-10-02 Roland Levillain <roland@lrde.epita.fr> + + Rename complex_iter_base as complex_set_iterator_base. + + * mln/topo/internal/complex_iter_base.hh: Rename as... + * mln/topo/internal/complex_set_iterator_base.hh: ...this. + (mln::internal::complex_iter_base<F, E>): Rename as... + (mln::internal::complex_set_iternal_base<F, E>): ...this. + * mln/topo/face_iter.hh, + * mln/topo/n_face_iter.hh, + * mln/topo/static_n_face_iter.hh, + * mln/topo/attic/faces_iter.hh: + Adjust derived classes. + 2008-10-01 Nicolas Ballas <ballas@lrde.epita.fr> Update documentation, add an operator to the sign value class. diff --git a/milena/mln/topo/attic/faces_iter.hh b/milena/mln/topo/attic/faces_iter.hh index 9497a14..5306835 100644 --- a/milena/mln/topo/attic/faces_iter.hh +++ b/milena/mln/topo/attic/faces_iter.hh @@ -32,7 +32,7 @@ /// \brief Definition of forward and backward iterators on the n-faces /// of a complex. -# include <mln/topo/internal/complex_iter_base.hh> +# include <mln/topo/internal/complex_set_iterator_base.hh> # include <mln/topo/n_face.hh> namespace mln @@ -51,8 +51,8 @@ namespace mln /// \arg \p D The dimension of the complex this iterator belongs to. template <unsigned N, unsigned D> class faces_fwd_iter_ - : public internal::complex_iter_base< n_face<N, D>, - faces_fwd_iter_<N, D> > + : public internal::complex_set_iterator_base< n_face<N, D>, + faces_fwd_iter_<N, D> > { public: /// Type of associated face. @@ -60,7 +60,7 @@ namespace mln private: typedef faces_fwd_iter_<N, D> self_; - typedef internal::complex_iter_base< face, self_ > super_; + typedef internal::complex_set_iterator_base< face, self_ > super_; public: using super_::is_valid; @@ -70,7 +70,8 @@ namespace mln /// Construction and assignment. /// \{ faces_fwd_iter_(); - // FIXME: See comment in internal::complex_iter_base's default ctor + // FIXME: See comment in internal::complex_set_iterator_base's + // default ctor. faces_fwd_iter_(complex<D>& c); /// \} @@ -97,8 +98,8 @@ namespace mln /// \arg \p D The dimension of the complex this iterator belongs to. template <unsigned N, unsigned D> class faces_bkd_iter_ - : public internal::complex_iter_base< n_face<N, D>, - faces_bkd_iter_<N, D> > + : public internal::complex_set_iterator_base< n_face<N, D>, + faces_bkd_iter_<N, D> > { public: /// Type of associated face. @@ -106,7 +107,7 @@ namespace mln private: typedef faces_bkd_iter_<N, D> self_; - typedef internal::complex_iter_base< face, self_ > super_; + typedef internal::complex_set_iterator_base< face, self_ > super_; public: using super_::is_valid; @@ -116,7 +117,8 @@ namespace mln /// Construction and assignment. /// \{ faces_bkd_iter_(); - // FIXME: See comment in internal::complex_iter_base's default ctor + // FIXME: See comment in internal::complex_set_iterator_base's + // default ctor. faces_bkd_iter_(complex<D>& c); /// \} diff --git a/milena/mln/topo/face_iter.hh b/milena/mln/topo/face_iter.hh index a564831..b34bfbd 100644 --- a/milena/mln/topo/face_iter.hh +++ b/milena/mln/topo/face_iter.hh @@ -32,10 +32,10 @@ /// \brief Definition of forward and backward iterators on all the /// faces of a complex. -# include <mln/topo/internal/complex_iter_base.hh> +# include <mln/topo/internal/complex_set_iterator_base.hh> # include <mln/topo/face.hh> -// FIXME: Factor a bit more? (Using complex_iter_base.) +// FIXME: Factor a bit more? (Using complex_set_iterator_base.) namespace mln @@ -57,11 +57,11 @@ namespace mln /// \arg \p D The dimension of the complex this iterator belongs to. template <unsigned D> class face_fwd_iter - : public internal::complex_iter_base< face<D>, face_fwd_iter<D> > + : public internal::complex_set_iterator_base< face<D>, face_fwd_iter<D> > { private: typedef face_fwd_iter<D> self_; - typedef internal::complex_iter_base< face<D>, self_ > super_; + typedef internal::complex_set_iterator_base< face<D>, self_ > super_; public: using super_::is_valid; @@ -71,7 +71,8 @@ namespace mln /// Construction and assignment. /// \{ face_fwd_iter(); - // FIXME: See comment in internal::complex_iter_base's default ctor + // FIXME: See comment in internal::complex_set_iterator_base's + // default ctor. face_fwd_iter(complex<D>& c); /// \} @@ -97,11 +98,11 @@ namespace mln /// \arg \p D The dimension of the complex this iterator belongs to. template <unsigned D> class face_bkd_iter - : public internal::complex_iter_base< face<D>, face_bkd_iter<D> > + : public internal::complex_set_iterator_base< face<D>, face_bkd_iter<D> > { private: typedef face_bkd_iter<D> self_; - typedef internal::complex_iter_base< face<D>, self_ > super_; + typedef internal::complex_set_iterator_base< face<D>, self_ > super_; public: using super_::is_valid; @@ -111,7 +112,8 @@ namespace mln /// Construction and assignment. /// \{ face_bkd_iter(); - // FIXME: See comment in internal::complex_iter_base's default ctor + // FIXME: See comment in internal::complex_set_iterator_base's + // default ctor. face_bkd_iter(complex<D>& c); /// \} diff --git a/milena/mln/topo/internal/complex_relative_iterator_base.hh b/milena/mln/topo/internal/complex_relative_iterator_base.hh index 43a38ae..8fe8c2e 100644 --- a/milena/mln/topo/internal/complex_relative_iterator_base.hh +++ b/milena/mln/topo/internal/complex_relative_iterator_base.hh @@ -55,6 +55,9 @@ # include <mln/core/concept/iterator.hh> # include <mln/topo/complex.hh> +/* FIXME: Introduce a common factoring class for this class and for + complex_relative_iterator_base? */ + /* FIXME: By moving iterator `i_' into internal::complex_relative_iterator_base, we'll be able to factor more methods (do_next_, update_f); this requires the type of this diff --git a/milena/mln/topo/internal/complex_iter_base.hh b/milena/mln/topo/internal/complex_set_iterator_base.hh similarity index 76% rename from milena/mln/topo/internal/complex_iter_base.hh rename to milena/mln/topo/internal/complex_set_iterator_base.hh index 06ffca2..7e76b76 100644 --- a/milena/mln/topo/internal/complex_iter_base.hh +++ b/milena/mln/topo/internal/complex_set_iterator_base.hh @@ -25,12 +25,12 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef MLN_TOPO_INTERNAL_COMPLEX_ITER_BASE_HH -# define MLN_TOPO_INTERNAL_COMPLEX_ITER_BASE_HH +#ifndef MLN_TOPO_INTERNAL_COMPLEX_SET_ITERATOR_BASE_HH +# define MLN_TOPO_INTERNAL_COMPLEX_SET_ITERATOR_BASE_HH -/// \file mln/topo/internal/complex_iter_base.hh +/// \file mln/topo/internal/complex_set_iterator_base.hh /// \brief Definition of an implementation (factoring) class for -/// iterators on mln::complex. +/// iterators on faces of a complex. # include <limits> @@ -39,10 +39,8 @@ # include <mln/core/concept/iterator.hh> # include <mln/topo/complex.hh> -// FIXME: Rename as something else? -// - complex_iterator_base? -// - complex_set_iterator_base? -// - faces_set_iterator_base? +/* FIXME: Introduce a common factoring class for this class and for + complex_relative_iterator_base? */ namespace mln @@ -58,9 +56,9 @@ namespace mln /// \arg \p F The type of the face handle. /// \arg \p E The type exact type of the iterator. template <typename F, typename E> - class complex_iter_base : public Iterator<E> + class complex_set_iterator_base : public Iterator<E> { - typedef complex_iter_base<F, E> self_; + typedef complex_set_iterator_base<F, E> self_; public: typedef F face; @@ -72,8 +70,8 @@ namespace mln /// \{ /* FIXME: Keep this non-const? See a (big) comment about this in milena/tests/complex_image.cc. */ - complex_iter_base(); - complex_iter_base(complex_type& c); + complex_set_iterator_base(); + complex_set_iterator_base(complex_type& c); /// \} /// Manipulation. @@ -100,11 +98,11 @@ namespace mln }; - /// Print an mln::topo::internal::complex_iter_base. + /// Print an mln::topo::internal::complex_set_iterator_base. template <typename F, typename E> inline std::ostream& - operator<<(std::ostream& ostr, const complex_iter_base<F, E>& p); + operator<<(std::ostream& ostr, const complex_set_iterator_base<F, E>& p); @@ -112,7 +110,7 @@ namespace mln template <typename F, typename E> inline - complex_iter_base<F, E>::complex_iter_base() + complex_set_iterator_base<F, E>::complex_set_iterator_base() { // Ensure F and E are compatible. mlc_equal(F, typename E::face)::check(); @@ -122,7 +120,7 @@ namespace mln template <typename F, typename E> inline - complex_iter_base<F, E>::complex_iter_base(complex_type& c) + complex_set_iterator_base<F, E>::complex_set_iterator_base(complex_type& c) { // Ensure F and E are compatible. mlc_equal(F, typename E::face)::check(); @@ -135,7 +133,7 @@ namespace mln template <typename F, typename E> inline void - complex_iter_base<F, E>::set_cplx(complex_type& c) + complex_set_iterator_base<F, E>::set_cplx(complex_type& c) { f_.set_cplx(c); // Invalidate f_. @@ -145,7 +143,7 @@ namespace mln template <typename F, typename E> inline bool - complex_iter_base<F, E>::is_valid() const + complex_set_iterator_base<F, E>::is_valid() const { return f_.is_valid(); } @@ -153,14 +151,14 @@ namespace mln template <typename F, typename E> inline void - complex_iter_base<F, E>::invalidate() + complex_set_iterator_base<F, E>::invalidate() { f_.invalidate(); } template <typename F, typename E> inline - complex_iter_base<F, E>::operator const F&() const + complex_set_iterator_base<F, E>::operator const F&() const { return f_; } @@ -169,7 +167,7 @@ namespace mln template <typename F, typename E> inline std::ostream& - operator<<(std::ostream& ostr, const complex_iter_base<F, E>& p) + operator<<(std::ostream& ostr, const complex_set_iterator_base<F, E>& p) { return ostr << F(p); } @@ -182,4 +180,4 @@ namespace mln } // end of namespace mln -#endif // ! MLN_TOPO_INTERNAL_COMPLEX_ITER_BASE_HH +#endif // ! MLN_TOPO_INTERNAL_COMPLEX_SET_ITERATOR_BASE_HH diff --git a/milena/mln/topo/n_face_iter.hh b/milena/mln/topo/n_face_iter.hh index 2a499c2..eaf9ef9 100644 --- a/milena/mln/topo/n_face_iter.hh +++ b/milena/mln/topo/n_face_iter.hh @@ -32,10 +32,10 @@ /// \brief Definition of forward and backward iterators on all the /// \a n-faces of a complex, \a n being a dynamic value. -# include <mln/topo/internal/complex_iter_base.hh> +# include <mln/topo/internal/complex_set_iterator_base.hh> # include <mln/topo/face.hh> -// FIXME: Factor a bit more? (Using complex_iter_base.) +// FIXME: Factor a bit more? (Using complex_set_iterator_base.) // FIXME: Rename the old commplex_faces_{fwd,bkd}_iter as // static_n_face_{fwd,bkd}_iter. @@ -60,11 +60,12 @@ namespace mln /// \arg \p D The dimension of the complex this iterator belongs to. template <unsigned D> class n_face_fwd_iter - : public internal::complex_iter_base< face<D>, n_face_fwd_iter<D> > + : public internal::complex_set_iterator_base< face<D>, + n_face_fwd_iter<D> > { private: typedef n_face_fwd_iter<D> self_; - typedef internal::complex_iter_base< face<D>, self_ > super_; + typedef internal::complex_set_iterator_base< face<D>, self_ > super_; public: using super_::is_valid; @@ -74,7 +75,8 @@ namespace mln /// Construction and assignment. /// \{ n_face_fwd_iter(); - // FIXME: See comment in internal::complex_iter_base's default ctor + // FIXME: See comment in internal::complex_set_iterator_base's + // default ctor. n_face_fwd_iter(complex<D>& c, unsigned n); /// \} @@ -108,11 +110,12 @@ namespace mln /// \arg \p D The dimension of the complex this iterator belongs to. template <unsigned D> class n_face_bkd_iter - : public internal::complex_iter_base< face<D>, n_face_bkd_iter<D> > + : public internal::complex_set_iterator_base< face<D>, + n_face_bkd_iter<D> > { private: typedef n_face_bkd_iter<D> self_; - typedef internal::complex_iter_base< face<D>, self_ > super_; + typedef internal::complex_set_iterator_base< face<D>, self_ > super_; public: using super_::is_valid; @@ -122,7 +125,8 @@ namespace mln /// Construction and assignment. /// \{ n_face_bkd_iter(); - // FIXME: See comment in internal::complex_iter_base's default ctor + // FIXME: See comment in internal::complex_set_iterator_base's + // default ctor. n_face_bkd_iter(complex<D>& c, unsigned n); /// \} diff --git a/milena/mln/topo/static_n_face_iter.hh b/milena/mln/topo/static_n_face_iter.hh index f29c4e4..3868e01 100644 --- a/milena/mln/topo/static_n_face_iter.hh +++ b/milena/mln/topo/static_n_face_iter.hh @@ -32,7 +32,7 @@ /// \brief Definition of forward and backward iterators on all the /// \p N-faces of a complex, \p N being a static value. -# include <mln/topo/internal/complex_iter_base.hh> +# include <mln/topo/internal/complex_set_iterator_base.hh> # include <mln/topo/face.hh> @@ -53,12 +53,12 @@ namespace mln /// \arg \p D The dimension of the complex this iterator belongs to. template <unsigned N, unsigned D> class static_n_face_fwd_iter - : public internal::complex_iter_base< face<D>, - static_n_face_fwd_iter<N, D> > + : public internal::complex_set_iterator_base< face<D>, + static_n_face_fwd_iter<N, D> > { private: typedef static_n_face_fwd_iter<N, D> self_; - typedef internal::complex_iter_base< face<D>, self_ > super_; + typedef internal::complex_set_iterator_base< face<D>, self_ > super_; public: using super_::is_valid; @@ -68,7 +68,8 @@ namespace mln /// Construction and assignment. /// \{ static_n_face_fwd_iter(); - // FIXME: See comment in internal::complex_iter_base's default ctor + // FIXME: See comment in internal::complex_set_iterator_base's + // default ctor. static_n_face_fwd_iter(complex<D>& c); /// \} @@ -96,12 +97,12 @@ namespace mln /// \arg \p D The dimension of the complex this iterator belongs to. template <unsigned N, unsigned D> class static_n_face_bkd_iter - : public internal::complex_iter_base< face<D>, - static_n_face_bkd_iter<N, D> > + : public internal::complex_set_iterator_base< face<D>, + static_n_face_bkd_iter<N, D> > { private: typedef static_n_face_bkd_iter<N, D> self_; - typedef internal::complex_iter_base< face<D>, self_ > super_; + typedef internal::complex_set_iterator_base< face<D>, self_ > super_; public: using super_::is_valid; @@ -111,7 +112,8 @@ namespace mln /// Construction and assignment. /// \{ static_n_face_bkd_iter(); - // FIXME: See comment in internal::complex_iter_base's default ctor + // FIXME: See comment in internal::complex_set_iterator_base's + // default ctor. static_n_face_bkd_iter(complex<D>& c); /// \} -- 1.6.0.1