Iterator
|
 |
This is a simple-to-use
iterator for the classes List, Stack Queue and Set in ETL ToolKit. A declared
iterator can be used for all four classes in the same source.
The Iterator can be
initialized with pointer to a container, with the same effect as initializing it
with the container object itself.
Declaration
#include<ospace/advanced/Iterator.h>
template
<
class Instantiator
>
class os_Iterator
Constructor
os_Iterator(void)
This the default
constructor.
Constructor
os_Iterator(const os_List<T>&)
Constructs the iterator
and initializes it for a list.
Constructor
os_Iterator(os_List<T>* const)
Constructs the iterator
and initializes it for a list.
Constructor
os_Iterator(const os_Set<T>&)
Constructs the iterator
and initializes it for a set.
Constructor
os_Iterator(os_Set<T>* const)
Constructs the iterator
and initializes it for a set.
Constructor
os_Iterator(const os_Stack<T>&)
Constructs the iterator
and initializes it for a stack.
Constructor
os_Iterator(os_Stack<T>* const)
Constructs the iterator
and initializes it for a stack.
Constructor
os_Iterator(const os_Queue<T>&)
Constructs the iterator
and initializes it for a queue.
Constructor
os_Iterator(os_Queue<T>* const)
Constructs the iterator
and initializes it for a queue.
Destructor
~os_Iterator()
Destroys the iterator
object.
operator
=
os_Iterator<T>& operator=(const os_List<T>&)
Initializes the iterator
for a list.
operator
=
os_Iterator<T>& operator=(os_List<T>* const)
Initializes the iterator
for a list.
operator
=
os_Iterator<T>& operator=(const
os_Set<T>&)
Initializes the iterator
for a set.
operator
=
os_Iterator<T>& operator=(os_Set<T>* const)
Initializes the iterator
for a set.
operator
=
os_Iterator<T>& operator=(const
os_Stack<T>&)
Initializes the iterator
for a stack.
operator
=
os_Iterator<T>& operator=(os_Stack<T>* const)
Initializes the iterator
for a stack.
operator
=
os_Iterator<T>& operator=(const
os_Queue<T>&)
Initializes the iterator
for a queue.
operator
=
os_Iterator<T>& operator=(os_Queue<T>* const)
Initializes the iterator
for a queue.
operator
++
os_Iterator&
operator++(void)
Both, prefix and postfix
increment operators are overloaded. Moves iterator to next element in
container.
operator
void *
operator void*(void)
Returns 1 (true) so long
as interator has not traversed the container to its end. After that returns
0 (false).
Current
T&
Current(void)
Returns a reference to
object in container that iterator is currently at.
Copyright©2005-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.