An non-const iterator which iterates throught the subjects of an Observer.
More...
#include <SubjectIterator.h>
List of all members.
Public Member Functions |
| ConstSubjectIterator (const T *subject, Observer *observer=0, int iterator_id=-1) |
| Default constructor.
|
| ConstSubjectIterator (const Observer *observer, ObserverIterationLevel iteration_level, const Observer *sibling_iteration_parent_observer=0, int iterator_id=-1) |
| Observer based constructor.
|
const T * | current () const |
| The current item in the context iterated through.
|
const T * | first () |
| The first item in the context iterated through.
|
const T * | last () |
| The last item in the context iterated through.
|
const T * | next () |
| The next item in the context iterated through.
|
const T * | previous () |
| The previous item in the context iterated through.
|
void | setCurrent (const T *current) |
| Sets the current item in the context iterated through.
|
virtual bool | hasNext () |
| Indicates if a next item exists.
|
virtual bool | hasPrevious () |
| Indicates if a previous item exists.
|
virtual const T * | operator++ () |
| Prefix increment.
|
virtual const T * | operator++ (int x) |
| Postfix increment.
|
virtual const T * | operator-- () |
| Prefix decrement.
|
virtual const T * | operator-- (int x) |
| Postfix decrement.
|
Detailed Description
template<class T>
class Qtilities::Core::ConstSubjectIterator< T >
An non-const iterator which iterates throught the subjects of an Observer.
- See also:
- SubjectIterator, TreeIterator
This class was added in Qtilities v1.0.
Member Enumeration Documentation
The level to use when passing only an observer in your constructor.
- Enumerator:
IterateChildren |
Iterate on the observer's children.
|
IterateSiblings |
Iterate on the observer's siblings. In this case T must be a subclass of Observer.
|
Constructor & Destructor Documentation
Default constructor.
- Parameters:
-
subject | The current subject where your iterator must start. |
observer | This is an optional parameter which is needed when your subject is observed in multiple contexts. In that case, the observer must be specified in order to know which observer parent to use. |
iterator_id | Internal iterator ID. You should never use this directly. |
Observer based constructor.
- Parameters:
-
observer | The observer that must be used in cases where multiple subjects have multiple parents. |
iteration_level | Indicates on which level the observer must be interated. |
sibling_iteration_parent_observer | When interating over siblings of an obsever (iteration_level = IterateSiblings), *it is necessary to specify the parent of the siblings you are iterating when any of the siblings has multiple parents. |
iterator_id | Internal iterator ID. You should never use this directly. |