A generic iterator on points of windows and of neighborhoods. More...
#include <site_relative_iterator_base.hh>
Public Types | |
typedef Site_Proxy< void > | category |
typedef E | exact_t |
typedef S::site | site |
The associated site type (as a Site_Proxy). | |
typedef S | target |
The associated target type. | |
Public Member Functions | |
const S::psite & | center () const |
The psite around which this iterator moves. | |
template<typename P > | |
void | center_at (const P &c) |
void | change_target (const S &s) |
Change the site set targeted by this iterator. | |
void | invalidate () |
bool | is_valid () const |
void | next () |
Go to the next element. | |
void | next_ () |
Go to the next point. | |
const S::psite & | p_hook_ () const |
Hook to the current location. | |
site_relative_iterator_base () | |
Constructor witout argument. | |
const S & | site_set () const |
Give the site set (neighborhood or window) that this iterator browses. | |
void | start () |
void | start_ () |
Start an iteration. | |
const S::psite & | subj_ () |
This overriding is very useful: it adds a test to prevent getting an invalid iterator when its center has moved. | |
const S *& | target_ () |
Give the target address. It might be 0. | |
const S::site & | to_site () const |
Return the site it points to (as a Site_Proxy). | |
E & | update () |
Warning: this method is an advanced tool provided for very special occasions; if you are a regular user, you should never use it! Calling this method forces this relative iterator to synchronize with its center when it has just moved and when the relative iterator still makes sense. | |
Protected Attributes | |
const S::psite * | c_ |
A pointer to the center psite around which this iterator moves. | |
const S * | s_ |
The target. | |
Private Member Functions | |
template<typename P > | |
void | center_at_ (const P &c) |
Private Attributes | |
S::psite | p_ |
The psite designated by this iterator. |
A generic iterator on points of windows and of neighborhoods.
Parameter S
is the targeted "site set definition" type. It can be either a Window, or a Neighborhood.
IMPORTANT: Sub-classes have to define center_at_, do_start_, do_next_, is_valid_, invalidate_ and compute_p_. They shall define NEITHER start_ NOR next_.
typedef Site_Proxy<void> mln::Site_Proxy< E >::category [inherited] |
Reimplemented from mln::Proxy< E >.
Reimplemented in mln::Pseudo_Site< E >, mln::Pseudo_Site< complex_psite< D, G > >, mln::Pseudo_Site< p_edges_psite< G, F > >, mln::Pseudo_Site< p_indexed_psite< S > >, mln::Pseudo_Site< p_double_psite< S, Sp > >, mln::Pseudo_Site< faces_psite< N, D, P > >, mln::Pseudo_Site< p_run_psite< P > >, and mln::Pseudo_Site< p_vertices_psite< G, F > >.
typedef E mln::Object< E >::exact_t [inherited] |
typedef S ::site mln::internal::site_iterator_base< S, E >::site [inherited] |
The associated site type (as a Site_Proxy).
typedef S mln::internal::site_iterator_base< S, E >::target [inherited] |
The associated target type.
mln::internal::site_relative_iterator_base< S, E >::site_relative_iterator_base | ( | ) | [inline] |
Constructor witout argument.
const S::psite & mln::internal::site_relative_iterator_base< S, E >::center | ( | ) | const [inline] |
The psite around which this iterator moves.
References mln::internal::site_relative_iterator_base< S, E >::c_.
void mln::internal::site_relative_iterator_base< S, E >::center_at | ( | const P & | c | ) | [inline] |
void mln::internal::site_relative_iterator_base< S, E >::center_at_ | ( | const P & | c | ) | [inline, private] |
void mln::internal::site_relative_iterator_base< S, E >::change_target | ( | const S & | s | ) | [inline] |
Change the site set targeted by this iterator.
References mln::Site_Iterator< E >::invalidate(), and mln::internal::site_iterator_base< S, E >::s_.
Referenced by mln::win::multiple_qiter< W, F >::change_target().
void mln::Site_Iterator< E >::invalidate | ( | ) | [inline, inherited] |
References mln::exact(), and mln::Site_Iterator< E >::is_valid().
Referenced by mln::internal::site_relative_iterator_base< S, E >::center_at(), mln::internal::site_set_iterator_base< S, E >::change_target(), mln::internal::site_relative_iterator_base< S, E >::change_target(), mln::internal::piter_adaptor_< Pi, S, E >::change_target(), and mln::p_transformed_piter< Pi, S, F >::change_target().
bool mln::Site_Iterator< E >::is_valid | ( | ) | const [inline, inherited] |
References mln::exact().
Referenced by mln::Site_Iterator< E >::invalidate(), mln::Site_Iterator< E >::next(), mln::internal::site_relative_iterator_base< S, E >::next_(), mln::internal::p_complex_piter_base_< I, S, P, E >::next_(), mln::internal::p_complex_piter_base_< I, S, P, E >::p_complex_piter_base_(), mln::internal::site_relative_iterator_base< S, E >::start_(), mln::internal::p_complex_piter_base_< I, S, P, E >::start_(), mln::internal::site_relative_iterator_base< S, E >::update(), and mln::internal::p_complex_piter_base_< I, S, P, E >::update_().
void mln::Site_Iterator< E >::next | ( | ) | [inline, inherited] |
Go to the next element.
References mln::exact(), and mln::Site_Iterator< E >::is_valid().
void mln::internal::site_relative_iterator_base< S, E >::next_ | ( | ) | [inline] |
Go to the next point.
References mln::exact(), and mln::Site_Iterator< E >::is_valid().
const S::psite & mln::internal::site_relative_iterator_base< S, E >::p_hook_ | ( | ) | const [inline] |
Hook to the current location.
const S & mln::internal::site_relative_iterator_base< S, E >::site_set | ( | ) | const [inline] |
Give the site set (neighborhood or window) that this iterator browses.
References mln::internal::site_iterator_base< S, E >::s_.
void mln::Site_Iterator< E >::start | ( | ) | [inline, inherited] |
References mln::exact().
void mln::internal::site_relative_iterator_base< S, E >::start_ | ( | ) | [inline] |
Start an iteration.
References mln::exact(), and mln::Site_Iterator< E >::is_valid().
const S::psite & mln::internal::site_relative_iterator_base< S, E >::subj_ | ( | ) | [inline] |
This overriding is very useful: it adds a test to prevent getting an invalid iterator when its center has moved.
Some sub-classes provide an update() method for the client to say that she really want to read the iterator just after the center has changed.
Reimplemented from mln::internal::site_iterator_base< S, E >.
References mln::exact().
const S *& mln::internal::site_iterator_base< S, E >::target_ | ( | ) | [inline, inherited] |
Give the target address. It might be 0.
const S::site & mln::internal::site_iterator_base< S, E >::to_site | ( | ) | const [inline, inherited] |
Return the site it points to (as a Site_Proxy).
References mln::exact().
E & mln::internal::site_relative_iterator_base< S, E >::update | ( | ) | [inline] |
Warning: this method is an advanced tool provided for very special occasions; if you are a regular user, you should never use it! Calling this method forces this relative iterator to synchronize with its center when it has just moved and when the relative iterator still makes sense.
References mln::internal::site_relative_iterator_base< S, E >::c_, mln::exact(), mln::Site_Iterator< E >::is_valid(), and mln::internal::site_iterator_base< S, E >::s_.
const S ::psite* mln::internal::site_relative_iterator_base< S, E >::c_ [protected] |
A pointer to the center psite around which this iterator moves.
Referenced by mln::internal::site_relative_iterator_base< S, E >::center(), mln::internal::site_relative_iterator_base< S, E >::center_at(), and mln::internal::site_relative_iterator_base< S, E >::update().
S ::psite mln::internal::site_relative_iterator_base< S, E >::p_ [private] |
The psite designated by this iterator.
const S* mln::internal::site_iterator_base< S, E >::s_ [protected, inherited] |
The target.
Referenced by mln::internal::site_set_iterator_base< S, E >::change_target(), mln::internal::site_relative_iterator_base< S, E >::change_target(), mln::internal::piter_adaptor_< Pi, S, E >::change_target(), mln::p_transformed_piter< Pi, S, F >::change_target(), mln::p_transformed_piter< Pi, S, F >::next_(), mln::p_if_piter_< Pi, S, F >::next_(), mln::internal::site_set_iterator_base< S, E >::site_set(), mln::internal::site_relative_iterator_base< S, E >::site_set(), mln::p_transformed_piter< Pi, S, F >::start_(), mln::p_if_piter_< Pi, S, F >::start_(), and mln::internal::site_relative_iterator_base< S, E >::update().