r2216: Allow iterators on complexes to change their target.

* mln/core/complex_iter.hh (mln::complex_fwd_iter_<D>::set_cplx) (mln::complex_bkd_iter_<D>::set_cplx): New. --- milena/ChangeLog | 9 +++++++++ milena/mln/core/complex_iter.hh | 28 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 957f2e9..e167fe7 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,12 @@ +2008-09-11 Roland Levillain <roland@lrde.epita.fr> + + Allow iterators on complexes to change their target. + + * mln/core/complex_iter.hh + (mln::complex_fwd_iter_<D>::set_cplx) + (mln::complex_bkd_iter_<D>::set_cplx): + New. + 2008-09-10 Roland Levillain <roland@lrde.epita.fr> * tests/core/complex_image.cc: Fix comment about complex windows. diff --git a/milena/mln/core/complex_iter.hh b/milena/mln/core/complex_iter.hh index f2701e3..07181c0 100644 --- a/milena/mln/core/complex_iter.hh +++ b/milena/mln/core/complex_iter.hh @@ -71,6 +71,10 @@ namespace mln /// Manipulation. /// \{ + /// Change the target complex. + // FIXME: Same comment as the ctor above. + void set_cplx(complex<D>& c); + /// Test if the iterator is valid. bool is_valid() const; /// Invalidate the iterator. @@ -144,6 +148,10 @@ namespace mln /// Manipulation. /// \{ + /// Change the target complex. + // FIXME: Same comment as the ctor above. + void set_cplx(complex<D>& c); + /// Test if the iterator is valid. bool is_valid() const; /// Invalidate the iterator. @@ -229,6 +237,16 @@ namespace mln template <unsigned D> inline + void + complex_fwd_iter_<D>::set_cplx(complex<D>& c) + { + face_.set_cplx(c); + // Invalidate face_. + invalidate(); + } + + template <unsigned D> + inline bool complex_fwd_iter_<D>::is_valid() const { @@ -352,6 +370,16 @@ namespace mln template <unsigned D> inline + void + complex_bkd_iter_<D>::set_cplx(complex<D>& c) + { + face_.set_cplx(c); + // Invalidate face_. + invalidate(); + } + + template <unsigned D> + inline bool complex_bkd_iter_<D>::is_valid() const { -- 1.5.6.5
participants (1)
-
Roland Levillain