#line 1 "/user/cvsspst/ees1cg/RAVL/RAVL-0.7/Core/Container/SArray/SArr1Iter3.hh" // This file is part of RAVL, Recognition And Vision Library // Copyright (C) 2001, University of Surrey // This code may be redistributed under the terms of the GNU Lesser // General Public License (LGPL). See the lgpl.licence file for details or // see http://www.gnu.org/copyleft/lesser.html // file-header-ends-here #ifndef RAVLSARR1ITER3_HEADER #define RAVLSARR1ITER3_HEADER 1 /////////////////////////////////////////////////// //! docentry="Ravl.Core.Arrays.1D" //! rcsid="$Id: SArr1Iter3.hh,v 1.3 2001/10/15 14:47:41 craftit Exp $" //! file="Ravl/Core/Container/SArray/SArr1Iter3.hh" //! lib=RavlCore //! author="Charles Galambos" //! date="10/09/98" //! userlevel=Advanced #include "Ravl/SArray1d.hh" #include "Ravl/BfAccIter3.hh" namespace RavlN { //! userlevel=Advanced //: Triple SArray1d iterator. // Fast simple array iterator. template class SArray1dIter3C : public BufferAccessIter3C { public: SArray1dIter3C() {} //: Default constructor. SArray1dIter3C(const SArray1dC &arr1, const SArray1dC &arr2, const SArray1dC &arr3); //: Constructor. inline void First() { BufferAccessIter3C::First(arr1,arr2,arr3); } // Goto first element in arrays. SArray1dC &Array1() { return arr1; } //: Access array. SArray1dC &Array2() { return arr2; } //: Access array. SArray1dC &Array3() { return arr3; } //: Access array. IndexC Index() const { return (IntT) (at1 - &arr1[0]); } //: Get current index. // This is a little slow. bool IsFirst() const { return at1 == &(arr1[0]); } //: Test if this is the first element in the range. // Note,this is slower than IsElm(). private: SArray1dC arr1; SArray1dC arr2; SArray1dC arr3; }; template SArray1dIter3C::SArray1dIter3C(const SArray1dC &arr1, const SArray1dC &arr2, const SArray1dC &arr3) : BufferAccessIter3C(arr1,arr2,arr3), arr1(arr1), arr2(arr2), arr3(arr3) {} } #endif