Flow123d
release_3.0.0-967-g1590fa8
|
Iterator that keeps also reference to its container. Safer and provides indexes. More...
#include <sys_vector.hh>
Public Member Functions | |
FullIterator (Cont &cont_par) | |
Constructor to make uninitialized FullIterator for a container. More... | |
FullIterator (const Cont &cont_par, const typename Cont::iterator it) | |
FullIterator (Cont &cont_par, const typename Cont::Iter it) | |
Constructor to make FullIterator from container and Iter i.e. T*. More... | |
bool | is_valid () |
Check validity of FullIterator. More... | |
int | index () const |
Cont & | container () |
Get reference to the container of the FullIterator. More... | |
FullIterator & | operator= (const FullIterator &orig) |
Assign operator. In debugging version check that containers of both FullIterator match. More... | |
operator typename Cont::Iter () const | |
Type cast to Iter i.e. standard pointer. More... | |
Cont::ElementType & | operator* () const |
Cont::ElementType * | operator-> () const |
-> dereference operator More... | |
FullIterator & | operator+= (const int shift) |
FullIterator & | operator-= (const int shift) |
bool | operator== (const FullIterator &it) const |
Comparison of two FullIterator. More... | |
bool | operator!= (const FullIterator &it) const |
FullIterator & | operator++ () |
Prefix. Advance operator. More... | |
FullIterator | operator++ (int) |
Postfix. Should not be used since involves iterator copy. More... | |
FullIterator & | operator-- () |
Prefix. Advance to previous operator. More... | |
FullIterator | operator-- (int) |
Postfix. Should not be used since involves iterator copy. More... | |
Protected Attributes | |
const Cont & | cont |
We have here reference to the container of the iterator. So, an instance of this class can not change the container. More... | |
Cont::iterator | iter |
Iterator that keeps also reference to its container. Safer and provides indexes.
Full iterator into a Vector<T> container. It makes an envelop around std:vector<T>::iterator, but stores also reference of the container it points into. Consequently FullIter can return index. The container has to be provided when FullIterator is created and this container can not be changed during the life of the variable. This is intentional since more safe.
This class is larger then normal pointer i.e. Iter type and therefore is questionable to use it in the large arrays. To this and you can use Iter and later convert it to FullIter providing the container It points into.
Definition at line 48 of file sys_vector.hh.
|
inline |
Constructor to make uninitialized FullIterator for a container.
Definition at line 52 of file sys_vector.hh.
|
inline |
Constructor to make FullIterator from container and its std::vector iterator. Mainly for internal use.
Definition at line 58 of file sys_vector.hh.
|
inline |
Constructor to make FullIterator from container and Iter i.e. T*.
Definition at line 63 of file sys_vector.hh.
|
inline |
Get reference to the container of the FullIterator.
Definition at line 84 of file sys_vector.hh.
|
inline |
Get index of FullIterator in its container. Return invalid index -1 for undefined iterator.
Definition at line 78 of file sys_vector.hh.
|
inline |
Check validity of FullIterator.
Definition at line 71 of file sys_vector.hh.
|
inline |
Type cast to Iter i.e. standard pointer.
Definition at line 97 of file sys_vector.hh.
|
inline |
Definition at line 118 of file sys_vector.hh.
|
inline |
Definition at line 101 of file sys_vector.hh.
|
inline |
Prefix. Advance operator.
Definition at line 122 of file sys_vector.hh.
|
inline |
Postfix. Should not be used since involves iterator copy.
|
inline |
Definition at line 108 of file sys_vector.hh.
|
inline |
Prefix. Advance to previous operator.
Definition at line 132 of file sys_vector.hh.
|
inline |
Postfix. Should not be used since involves iterator copy.
|
inline |
Definition at line 111 of file sys_vector.hh.
|
inline |
-> dereference operator
Definition at line 105 of file sys_vector.hh.
|
inline |
Assign operator. In debugging version check that containers of both FullIterator match.
Definition at line 88 of file sys_vector.hh.
|
inline |
Comparison of two FullIterator.
Definition at line 115 of file sys_vector.hh.
|
protected |
We have here reference to the container of the iterator. So, an instance of this class can not change the container.
Definition at line 144 of file sys_vector.hh.
|
protected |
Definition at line 146 of file sys_vector.hh.