[Insight-developers] standardizing iterator api

Joshua Cates cates@cs.utah.edu
Tue, 8 May 2001 16:21:16 -0600 (MDT)


I agree that option (1) is preferable.  Especially in light of the
performance considerations.

Josh.

______________________________
 Josh Cates			
 School of Computer Science	
 University of Utah
 Email: cates@cs.utah.edu
 Phone: (801) 587-7697
 URL:   www.cs.utk.edu/~cates


On Tue, 8 May 2001, Luis Ibanez wrote:

> 
> On ImageIterators I would prefer option (1) for performance reasons.
> Having to return an iterator and compare with it is costly in N-D.
> ImageIterators contains internally enough information to rapidly
> determine if they are at the end or beggining of the image, and to
> eventually jump to those positions.
> 
> Don't know however if the (1) option is acceptable for itkContainers...
> 
> Eventually if they cannot share the same style, it could be
> an advantage to make their API different enough to reflect this
> different behaviors.
> 
> 
> Luis
> 
> ---
> 
> 
> On Tue, 8 May 2001, Joshua Cates wrote:
> > choice being to support either/or:
> >
> > 1.
> > itkIterator it;
> > for (it.Begin(); ! it.IsAtEnd(); ++it) {}
> >
> > 2.
> > itkIterator it;
> > for (it = it.Begin(); it < it.End(); ++it) {}
> >
> >
> > Josh.
> 
>