2628: Add accessors to complex piters on neighborhoods.

* mln/core/image/complex_neighborhood_piter.hh (mln::complex_neighborhood_fwd_piter<I, G, N>::iter) (mln::complex_neighborhood_bkd_piter<I, G, N>::iter): Rename typedefs as... (mln::complex_neighborhood_fwd_piter<I, G, N>::iter_type) (mln::complex_neighborhood_bkd_piter<I, G, N>::iter_type): ...these. Adjust. (mln::complex_neighborhood_fwd_piter<I, G, N>::iter) (mln::complex_neighborhood_bkd_piter<I, G, N>::iter): New accessors. --- milena/ChangeLog | 16 ++++++ .../mln/core/image/complex_neighborhood_piter.hh | 58 +++++++++++++++++--- 2 files changed, 67 insertions(+), 7 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 6c52239..db0dde3 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -24,6 +24,22 @@ 2008-10-22 Roland Levillain <roland@lrde.epita.fr> + Add accessors to complex piters on neighborhoods. + + * mln/core/image/complex_neighborhood_piter.hh + (mln::complex_neighborhood_fwd_piter<I, G, N>::iter) + (mln::complex_neighborhood_bkd_piter<I, G, N>::iter): + Rename typedefs as... + (mln::complex_neighborhood_fwd_piter<I, G, N>::iter_type) + (mln::complex_neighborhood_bkd_piter<I, G, N>::iter_type): + ...these. + Adjust. + (mln::complex_neighborhood_fwd_piter<I, G, N>::iter) + (mln::complex_neighborhood_bkd_piter<I, G, N>::iter): + New accessors. + +2008-10-22 Roland Levillain <roland@lrde.epita.fr> + Simplify mln::geom::complex_geometry. * mln/geom/complex_geometry.hh diff --git a/milena/mln/core/image/complex_neighborhood_piter.hh b/milena/mln/core/image/complex_neighborhood_piter.hh index f155794..4cbf7ab 100644 --- a/milena/mln/core/image/complex_neighborhood_piter.hh +++ b/milena/mln/core/image/complex_neighborhood_piter.hh @@ -33,7 +33,7 @@ # include <mln/core/internal/site_relative_iterator_base.hh> -// FIXME: These might be factor-able. +// FIXME: These might be factor-able, both between fwd/bkd and nbh/win. /* FIXME: Do we really want to inherit from internal::site_relative_iterator_base? I might duplicate things, @@ -63,6 +63,8 @@ namespace mln public: /// The Pseudo_Site type. typedef mln_psite(N) psite; + /// The type of the underlying complex iterator. + typedef typename N::complex_fwd_iter iter_type; public: /// Construction. @@ -95,11 +97,15 @@ namespace mln psite compute_p_() const; /// \} + /// \brief Accessors. + /// \{ + const iter_type& iter() const; + iter_type& iter(); + /// \} + private: - /// The type of the underlying complex iterator. - typedef typename N::complex_fwd_iter iter; /// The underlying complex iterator. - iter iter_; + iter_type iter_; }; @@ -126,6 +132,8 @@ namespace mln public: /// The Pseudo_Site type. typedef mln_psite(N) psite; + /// The type of the underlying complex iterator. + typedef typename N::complex_bkd_iter iter_type; public: /// Construction. @@ -158,11 +166,15 @@ namespace mln psite compute_p_() const; /// \} + /// \brief Accessors. + /// \{ + const iter_type& iter() const; + iter_type& iter(); + /// \} + private: - /// The type of the underlying complex iterator. - typedef typename N::complex_bkd_iter iter; /// The underlying complex iterator. - iter iter_; + iter_type iter_; }; @@ -247,6 +259,22 @@ namespace mln return psite(this->center().site_set(), iter_); } + template <typename I, typename G, typename N> + inline + const typename N::complex_fwd_iter& + complex_neighborhood_fwd_piter<I, G, N>::iter() const + { + return iter_; + } + + template <typename I, typename G, typename N> + inline + typename N::complex_fwd_iter& + complex_neighborhood_fwd_piter<I, G, N>::iter() + { + return iter_; + } + template <typename I, typename G, typename N> inline @@ -329,6 +357,22 @@ namespace mln return psite(this->center().site_set(), iter_); } + template <typename I, typename G, typename N> + inline + const typename N::complex_bkd_iter& + complex_neighborhood_bkd_piter<I, G, N>::iter() const + { + return iter_; + } + + template <typename I, typename G, typename N> + inline + typename N::complex_bkd_iter& + complex_neighborhood_bkd_piter<I, G, N>::iter() + { + return iter_; + } + template <typename I, typename G, typename N> inline -- 1.6.0.1
participants (1)
-
Roland Levillain