/** \file Declarataion of Iterators to TabulatedFunctionComplexLgAmpPhase \author Tim Huege \version $Id: TabulatedFunctionComplexLgAmpPhaseIterators.h 19812 2011-11-22 12:41:29Z mabl $ \date 09 Oct 2003 */ #ifndef _utl_TabulatedFunctionComplexLgAmpPhaseIterators_h_ #define _utl_TabulatedFunctionComplexLgAmpPhaseIterators_h_ #include #include #include #include namespace utl { class TabulatedFunctionComplexLgAmpPhaseIterator : public std::iterator { private: typedef std::vector::iterator InternalIterator; typedef std::vector::iterator InternalIteratorComplex; public: TabulatedFunctionComplexLgAmpPhaseIterator() { } TabulatedFunctionComplexLgAmpPhaseIterator(const InternalIterator xIt, const InternalIteratorComplex yIt) : fXIterator(xIt), fYIterator(yIt) { } PairComplexLgAmpPhase operator*() const { return PairComplexLgAmpPhase(*fXIterator, *fYIterator); } const PairComplexLgAmpPhase* operator->() const { fPair = PairComplexLgAmpPhase(*fXIterator, *fYIterator); return &fPair; } TabulatedFunctionComplexLgAmpPhaseIterator& operator++() { ++fXIterator; ++fYIterator; return *this; } TabulatedFunctionComplexLgAmpPhaseIterator operator++(int) { const TabulatedFunctionComplexLgAmpPhaseIterator tmp = *this; ++fXIterator; ++fYIterator; return tmp; } bool operator==(const TabulatedFunctionComplexLgAmpPhaseIterator& it) const { return fXIterator == it.fXIterator && fYIterator == it.fYIterator; } bool operator!=(const TabulatedFunctionComplexLgAmpPhaseIterator& it) const { return fXIterator != it.fXIterator || fYIterator != it.fYIterator; } private: mutable PairComplexLgAmpPhase fPair; InternalIterator fXIterator; InternalIteratorComplex fYIterator; }; class ConstTabulatedFunctionComplexLgAmpPhaseIterator : public std::iterator { private: typedef std::vector::const_iterator InternalIterator; typedef std::vector::const_iterator InternalIteratorComplex; public: ConstTabulatedFunctionComplexLgAmpPhaseIterator() { } ConstTabulatedFunctionComplexLgAmpPhaseIterator(const InternalIterator xIt, const InternalIteratorComplex yIt) : fXIterator(xIt), fYIterator(yIt) { } PairComplexLgAmpPhase operator*() const { return PairComplexLgAmpPhase(*fXIterator, *fYIterator); } const PairComplexLgAmpPhase* operator->() const { fPair = PairComplexLgAmpPhase(*fXIterator, *fYIterator); return &fPair; } ConstTabulatedFunctionComplexLgAmpPhaseIterator& operator++() { ++fXIterator; ++fYIterator; return *this; } ConstTabulatedFunctionComplexLgAmpPhaseIterator operator++(int) { const ConstTabulatedFunctionComplexLgAmpPhaseIterator tmp = *this; ++fXIterator; ++fYIterator; return tmp; } bool operator==(const ConstTabulatedFunctionComplexLgAmpPhaseIterator& it) const { return fXIterator == it.fXIterator && fYIterator == it.fYIterator; } bool operator!=(const ConstTabulatedFunctionComplexLgAmpPhaseIterator& it) const { return fXIterator != it.fXIterator || fYIterator != it.fYIterator; } private: mutable PairComplexLgAmpPhase fPair; InternalIterator fXIterator; InternalIteratorComplex fYIterator; }; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // compile-command: "make -C .. -k" // End: