2622: Add accessors to implementations class of complex iterators.

* mln/topo/internal/complex_set_iterator_base.hh (internal::complex_set_iterator_base<F, E>::face): Rename typedef as... (internal::complex_set_iterator_base<F, E>::face_type): ...this. Adjust. (internal::complex_set_iterator_base<F, E>::face): New iterator. (internal::complex_set_iterator_base<F, E>): Remove irrelevant static assertion. * mln/topo/internal/complex_relative_iterator_base.hh (internal::complex_relative_iterator_base<F, E>::face) (internal::forward_complex_relative_iterator_base<F, E>::face) (internal::backward_complex_relative_iterator_base<F, E>::face): Rename typedefs as... (internal::complex_relative_iterator_base<F, E>::face_type) (internal::forward_complex_relative_iterator_base<F, E>::face_type) (internal::backward_complex_relative_iterator_base<F, E>::face_type): ...these. Adjust. (internal::complex_relative_iterator_base<F, E>::face): New accessor. (internal::complex_relative_iterator_base<F, E>): Remove irrelevant static assertion. --- milena/ChangeLog | 52 ++++++++++++++++++++ .../internal/complex_relative_iterator_base.hh | 38 +++++++++------ .../mln/topo/internal/complex_set_iterator_base.hh | 30 +++++++----- 3 files changed, 93 insertions(+), 27 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 37cd5d2..faaf934 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,57 @@ 2008-10-22 Roland Levillain <roland@lrde.epita.fr> + s/milena/Milena/. + + * mln/core/concept/gpoint.hh, + * mln/core/concept/object.hh, + * mln/core/concept/point_site.hh, + * mln/core/image/fi_adaptor.hh, + * mln/core/macros.hh, + * mln/core/routine/ops.hh, + * mln/io/fits/load.hh, + * mln/io/pbm/load.hh, + * mln/io/pbm/save.hh, + * mln/io/pfm/load.hh, + * mln/io/pfm/save.hh, + * mln/io/pgm/load.hh, + * mln/io/pgm/save.hh, + * mln/io/pnm/save.hh, + * mln/io/pnm/save_header.hh, + * mln/io/ppm/load.hh, + * mln/io/ppm/save.hh, + * mln/make/all.hh: + Do it. + +2008-10-22 Roland Levillain <roland@lrde.epita.fr> + + Add accessors to implementations class of complex iterators. + + * mln/topo/internal/complex_set_iterator_base.hh + (internal::complex_set_iterator_base<F, E>::face): + Rename typedef as... + (internal::complex_set_iterator_base<F, E>::face_type): + ...this. + Adjust. + (internal::complex_set_iterator_base<F, E>::face): New iterator. + (internal::complex_set_iterator_base<F, E>): Remove irrelevant + static assertion. + * mln/topo/internal/complex_relative_iterator_base.hh + (internal::complex_relative_iterator_base<F, E>::face) + (internal::forward_complex_relative_iterator_base<F, E>::face) + (internal::backward_complex_relative_iterator_base<F, E>::face): + Rename typedefs as... + (internal::complex_relative_iterator_base<F, E>::face_type) + (internal::forward_complex_relative_iterator_base<F, E>::face_type) + (internal::backward_complex_relative_iterator_base<F, E>::face_type): + ...these. + Adjust. + (internal::complex_relative_iterator_base<F, E>::face): + New accessor. + (internal::complex_relative_iterator_base<F, E>): + Remove irrelevant static assertion. + +2008-10-22 Roland Levillain <roland@lrde.epita.fr> + Use alias mln::bin_2complex_image3df. * mln/io/off/load.hh, diff --git a/milena/mln/topo/internal/complex_relative_iterator_base.hh b/milena/mln/topo/internal/complex_relative_iterator_base.hh index 7275989..16b913b 100644 --- a/milena/mln/topo/internal/complex_relative_iterator_base.hh +++ b/milena/mln/topo/internal/complex_relative_iterator_base.hh @@ -58,7 +58,7 @@ # include <mln/topo/complex.hh> /* FIXME: Introduce a common factoring class for this class and for - complex_relative_iterator_base? */ + complex_set_iterator_base? */ /* FIXME: By moving iterator `i_' into internal::complex_relative_iterator_base, we'll be able to factor @@ -91,7 +91,7 @@ namespace mln public: /// The type of the iterated faces. - typedef F face; + typedef F face_type; /// Construction. /// \{ @@ -111,24 +111,28 @@ namespace mln void next_(); /// \} - /// Conversion. - /// \{ + /// \brief Conversion. + /// /// Return a reference to the corresponding face handle. - operator const face&() const; + /// \{ + /// Explicit conversion (accessor). + const face_type& face() const; + /// Implicit conversion (conversion operator). + operator const face_type&() const; /// \} protected: /// A pointer to the center face around which this iterator /// moves. - const face* c_; + const face_type* c_; // The type of the set of vicinity sites (adjacent face handles). - typedef std::vector<face> adj_faces_t; + typedef std::vector<face_type> adj_faces_t; /// The set of faces adjacent to the reference face. adj_faces_t adj_faces_; /// The face handle this iterator is pointing to. - face f_; + face_type f_; }; @@ -160,7 +164,7 @@ namespace mln typedef complex_relative_iterator_base<F, E> super_; public: - typedef F face; + typedef F face_type; public: /// Construction. @@ -210,7 +214,7 @@ namespace mln typedef complex_relative_iterator_base<F, E> super_; public: - typedef F face; + typedef F face_type; public: /// Construction. @@ -255,8 +259,6 @@ namespace mln complex_relative_iterator_base<F, E>::complex_relative_iterator_base() : c_(0) { - // Ensure F and E are compatible. - mlc_equal(F, typename E::face)::check(); // Check for required methods in E. void (E::*m)() = & E::update_adj_faces_; m = 0; @@ -269,8 +271,6 @@ namespace mln inline complex_relative_iterator_base<F, E>::complex_relative_iterator_base(const Fref& f_ref) { - // Ensure F and E are compatible. - mlc_equal(F, typename E::face)::check(); // Check for required methods in E. void (E::*m)() = & E::update_adj_faces_; m = 0; @@ -309,7 +309,15 @@ namespace mln template <typename F, typename E> inline - complex_relative_iterator_base<F, E>::operator const face&() const + const F& + complex_relative_iterator_base<F, E>::face() const + { + return f_; + } + + template <typename F, typename E> + inline + complex_relative_iterator_base<F, E>::operator const face_type&() const { return f_; } diff --git a/milena/mln/topo/internal/complex_set_iterator_base.hh b/milena/mln/topo/internal/complex_set_iterator_base.hh index fd09b19..6a7588d 100644 --- a/milena/mln/topo/internal/complex_set_iterator_base.hh +++ b/milena/mln/topo/internal/complex_set_iterator_base.hh @@ -62,7 +62,7 @@ namespace mln public: /// The type of the iterated faces. - typedef F face; + typedef F face_type; // FIXME: Maybe we could just get the dimension D of the face's // complex, an define complex_type as mln::complex<D>? typedef typename F::complex_type complex_type; @@ -87,15 +87,19 @@ namespace mln void invalidate(); /// \} - /// Conversion. - /// \{ + /// \brief Conversion. + /// /// Return a reference to the corresponding face handle. - operator const face&() const; + /// \{ + /// Explicit conversion (accessor). + const face_type& face() const; + /// Implicit conversion (conversion operator). + operator const face_type&() const; /// \} protected: /// The face handle this iterator is pointing to. - face f_; + face_type f_; }; @@ -113,9 +117,6 @@ namespace mln inline complex_set_iterator_base<F, E>::complex_set_iterator_base() { - // Ensure F and E are compatible. - mlc_equal(F, typename E::face)::check(); - invalidate(); } @@ -123,9 +124,6 @@ namespace mln inline 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(); - f_.set_cplx(c); // Invalidate f_. invalidate(); @@ -159,7 +157,15 @@ namespace mln template <typename F, typename E> inline - complex_set_iterator_base<F, E>::operator const face&() const + const F& + complex_set_iterator_base<F, E>::face() const + { + return f_; + } + + template <typename F, typename E> + inline + complex_set_iterator_base<F, E>::operator const face_type&() const { return f_; } -- 1.6.0.1
participants (1)
-
Roland Levillain