2.0.0b10
catchment modelling framework
Loading...
Searching...
No Matches
ReachIterator Class Reference

An iterator over every upstream reach from a start reach. More...

Detailed Description

An iterator over every upstream reach from a start reach.

Implements both the Python and the C++ iterator interface Usage C++:

ptr r;
for (ReachIterator it(r);it.valid();++it) { ... }
An iterator over every upstream reach from a start reach.
Definition Reach.h:132
bool valid() const
Returns true, if reaches are left to iterate over.

Usage Python:

for reach in ReachIterator(r):
pass
ReachIterator(Reach::ptr first)
Creates a ReachIterator from a first reach.
Reach::ptr reach() const
Returns the current reach.

Public Member Functions

 ReachIterator (Reach::ptr first)
 Creates a ReachIterator from a first reach.
 
Reach::ptr next ()
 Returns the next reach in the upstream queue.
 
double position () const
 Returns the distance to the root reach.
 
Reach::ptr reach () const
 Returns the current reach.
 
bool valid () const
 Returns true, if reaches are left to iterate over.