|
Evo C++ Library v0.5.1
|
#include <evo/impl/iter.h>

Bidirectional iterator.
Used to iterate through container items.
| T | Container type (must not be const) |
Iterators work like normal pointers.
Containers normally define iterator types via member typedefs with const and mutable (non-const) variations, normally named Iter (const) and IterM (mutable). The iterator key type is stored by the iterator as a handle and is used to implement the iterator.
Example:
Iterators interact with containers using an expected interface implemented by the container – this is used internally:
Public Types | |
| typedef IteratorBi< const T > | Const |
| Bidirectional const iterator type. More... | |
| typedef IteratorBase< T >::Item | Item |
| Iterator item type. More... | |
| typedef IteratorBase< T > | IterBaseType |
| Iterator base type for parameter passing. More... | |
| typedef IteratorBi< T > | IterType |
| Iterator type. More... | |
| typedef IteratorBase< T >::Key | Key |
| Iterator key type. More... | |
| typedef IteratorBi< typename RemoveConst< T >::Type > | Mutable |
| Bidirectional mutable iterator type. More... | |
| typedef IteratorBase< T >::Size | Size |
| Size type to use. More... | |
| typedef T | Target |
| Iterator target type. More... | |
| typedef StaticIf< IsConst< T >::value, Mutable, Const >::Type | ToggleConst |
| Used for converting between Const/Mutable iterators. More... | |
Public Member Functions | |
| IteratorBi () | |
| Constructor. More... | |
| IteratorBi (T &obj) | |
| Constructor. More... | |
| IteratorBi (T &obj, IteratorPos pos) | |
| Constructor setting position. More... | |
| IteratorBi (T &obj, const Key &key, Item *data) | |
| Constructor. More... | |
| IteratorBi (const IterType &src) | |
| Copy constructor. More... | |
| IteratorBi (const IterBaseType &src) | |
| Copy constructor. More... | |
| operator SafeBoolType () const | |
| Safe (explicit) evaluation as bool type. More... | |
| bool | operator! () const |
| Check whether iterator is at end (not valid). More... | |
| bool | operator!= (const IterBaseType &iter) const |
| Inequality operator. More... | |
| template<typename T_ > | |
| bool | operator!= (const IteratorBase< T_ > &oth) const |
| Check inequality with another iterator. More... | |
| Item & | operator* () |
| Dereference iterator to get item data reference. More... | |
| IterType & | operator++ () |
| Pre increment operator. More... | |
| IterType | operator++ (int) |
| Post increment operator. More... | |
| IterType & | operator-- () |
| Pre decrement operator. More... | |
| IterType | operator-- (int) |
| Post decrement operator. More... | |
| Item * | operator-> () |
| Dereference iterator to access data member. More... | |
| IterType & | operator= (const IterType &src) |
| Copy/Assignment operator to copy from source iterator. More... | |
| IterType & | operator= (const IterBaseType &src) |
| Copy/Assignment operator to copy from source iterator. More... | |
| IterType & | operator= (const ToggleConst &src) |
| Assignment operator to copy from source iterator. More... | |
| IterType & | operator= (const typename IterBaseType::ToggleConst &src) |
| Assignment operator to copy from source iterator. More... | |
| IterType & | operator= (T &obj) |
| Assignment operator. More... | |
| IterType & | operator= (IteratorPos pos) |
| Assignment operator to set position. More... | |
| bool | operator== (const IterBaseType &iter) const |
| Equality operator. More... | |
| template<typename T_ > | |
| bool | operator== (const IteratorBase< T_ > &oth) const |
| Check equality with another iterator. More... | |
Static Public Member Functions | |
| static const IterBaseType & | end () |
| Get iterator at end position. More... | |
Protected Member Functions | |
| IteratorBi (T *obj) | |
| Constructor (used internally). More... | |
| bool | first () |
| Go to first item (used internally). More... | |
| bool | last () |
| Go to last item. More... | |
| bool | next () |
| Go to next item (used internally). More... | |
| bool | prev () |
| Go to previous item. More... | |
Protected Attributes | |
| Item * | data_ |
| Item pointer. More... | |
| bool | end_ |
| End flag. More... | |
| Key | key_ |
| Iterator key. More... | |
| T * | obj_ |
| Container object pointer. More... | |
| typedef IteratorBi<const T> Const |
Bidirectional const iterator type.
| typedef IteratorBase<T>::Item Item |
Iterator item type.
| typedef IteratorBase<T> IterBaseType |
Iterator base type for parameter passing.
| typedef IteratorBi<T> IterType |
Iterator type.
| typedef IteratorBase<T>::Key Key |
Iterator key type.
| typedef IteratorBi<typename RemoveConst<T>::Type> Mutable |
Bidirectional mutable iterator type.
| typedef IteratorBase<T>::Size Size |
Size type to use.
|
inherited |
Iterator target type.
| typedef StaticIf<IsConst<T>::value,Mutable,Const>::Type ToggleConst |
Used for converting between Const/Mutable iterators.
|
inline |
Constructor.
This sets empty iterator at end.
|
inlineexplicit |
Constructor.
This sets iterator to first item (or end if empty).
| obj | Container object for iterator |
|
inlineexplicit |
Constructor setting position.
This sets iterator to given position (or end if empty).
| obj | Container object for iterator |
| pos | Position to set, either iterFIRST, iterLAST, or iterEND |
|
inline |
Constructor.
This initializes iterator with given position data (used internally).
| obj | Container object to iterate through |
| key | Iterator key to set |
| data | Iterator data pointer to set |
|
inline |
Copy constructor.
| src | Source iterator to copy. |
|
inline |
Copy constructor.
| src | Source iterator to copy. |
|
inlineexplicitprotected |
Constructor (used internally).
Only initializes object pointer.
| obj | Pointer to container objct. |
|
inlinestaticinherited |
Get iterator at end position.
|
inlineprotectedinherited |
Go to first item (used internally).
|
inlineprotected |
Go to last item.
|
inlineprotectedinherited |
Go to next item (used internally).
|
inlineinherited |
Safe (explicit) evaluation as bool type.
|
inlineinherited |
Check whether iterator is at end (not valid).
|
inlineinherited |
Inequality operator.
| iter | Iterator to compare |
|
inlineinherited |
Check inequality with another iterator.
| oth | Other iterator to check against. |
|
inlineinherited |
Dereference iterator to get item data reference.
|
inlineinherited |
Post increment operator.
Same as next(), but returns iterator copy before increment.
|
inline |
Post decrement operator.
Same as prev(), but returns iterator copy before decrement.
|
inlineinherited |
Dereference iterator to access data member.
Copy/Assignment operator to copy from source iterator.
| src | Source iterator to copy |
|
inline |
Copy/Assignment operator to copy from source iterator.
| src | Source iterator to copy |
|
inline |
Assignment operator to copy from source iterator.
| src | Source iterator to copy. |
|
inline |
Assignment operator to copy from source iterator.
| src | Source iterator to copy. |
|
inline |
Assignment operator.
This sets iterator to first item (or end if empty).
| obj | Container object to iterate through |
|
inline |
Assignment operator to set position.
| pos | Position to set, either iterFIRST, iterLAST, or iterEND |
|
inlineinherited |
Equality operator.
| iter | Iterator to compare |
|
inlineinherited |
Check equality with another iterator.
| oth | Other iterator to check against. |
|
inlineprotected |
Go to previous item.
|
protectedinherited |
Item pointer.
|
protectedinherited |
End flag.
|
protectedinherited |
Iterator key.
|
protectedinherited |
Container object pointer.
1.8.13