VectorSTLIterator.h

Classes

VectorSTLIterator -- AIPS++ Vector iterator (full description)

class VectorSTLIterator: public std::iterator<std::random_access_iterator_tag, T>

Interface

Public Members
explicit VectorSTLIterator(const Vector<T> &c) : start_p(c.data()), step_p(std::max(1,c.steps()(0))), iter_p(c.data())
VectorSTLIterator() : start_p(0), step_p(1), iter_p(0)
VectorSTLIterator(const typename Array<T>::IteratorSTL &c) : start_p(c.pos()), step_p(std::max(1,c.steps()(0))), iter_p(start_p)
VectorSTLIterator(const VectorSTLIterator<T>& that) : std::iterator<std::random_access_iterator_tag, T>(that), start_p(that.start_p), step_p(that.step_p), iter_p(that.iter_p)
VectorSTLIterator<T>& operator=(const VectorSTLIterator<T>& that)
~VectorSTLIterator()
reference operator[](uInt i)
const_reference operator[](uInt i) const
reference operator*()
const_reference operator*() const
pointer pos() const
const iterator &operator++()
iterator operator++(int)
iterator &operator--()
iterator operator--(int)
iterator &operator+=(difference_type i)
iterator &operator-=(difference_type i)
iterator operator+(difference_type i) const
iterator operator-(difference_type i) const
difference_type operator-(VectorSTLIterator<T> &x) const
Bool operator== (const iterator &other) const
Bool operator!= (const iterator other) const
Bool operator< (const iterator &other) const
Bool operator== (const_pointer const pos) const
Bool operator!= (const_pointer const pos) const
Bool operator< (const_pointer const pos) const

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

This class creates a random access STL iterator for an aips++ Vector. All the STL functionality is present (or if something missing can be easily added).
The following comments hold:

Member Description

VectorSTLIterator(const VectorSTLIterator<T>& that) : std::iterator<std::random_access_iterator_tag, T>(that), start_p(that.start_p), step_p(that.step_p), iter_p(that.iter_p)

Constructors. The iterator constructor from a Vector is the same as if created from Vector.begin(). Copy constructor and assignment can be the default ones.

Copy constructor.

VectorSTLIterator<T>& operator=(const VectorSTLIterator<T>& that)

Constructors. The iterator constructor from a Vector is the same as if created from Vector.begin(). Copy constructor and assignment can be the default ones.

Assignment.

explicit VectorSTLIterator(const Vector<T> &c) : start_p(c.data()), step_p(std::max(1,c.steps()(0))), iter_p(c.data())
VectorSTLIterator() : start_p(0), step_p(1), iter_p(0)
VectorSTLIterator(const typename Array<T>::IteratorSTL &c) : start_p(c.pos()), step_p(std::max(1,c.steps()(0))), iter_p(start_p)

Constructors. The iterator constructor from a Vector is the same as if created from Vector.begin(). Copy constructor and assignment can be the default ones.

~VectorSTLIterator()

Destructor

reference operator[](uInt i)
const_reference operator[](uInt i) const
reference operator*()
const_reference operator*() const
pointer pos() const

Access

const iterator &operator++()
iterator operator++(int)
iterator &operator--()
iterator operator--(int)
iterator &operator+=(difference_type i)
iterator &operator-=(difference_type i)
iterator operator+(difference_type i) const
iterator operator-(difference_type i) const

Manipulation

difference_type operator-(VectorSTLIterator<T> &x) const

Size related

Bool operator== (const iterator &other) const
Bool operator!= (const iterator other) const
Bool operator< (const iterator &other) const
Bool operator== (const_pointer const pos) const
Bool operator!= (const_pointer const pos) const
Bool operator< (const_pointer const pos) const

Comparisons