#include <iterator.h>
Inheritance diagram for CompositeIteratorTraits:
Public Member Functions | |
Composite::CompositeIterator & | getPosition () throw () |
Return the current iterator position. | |
const Composite::CompositeIterator & | getPosition () const throw () |
Return the current iterator posittion (const method). | |
void | invalidate () throw () |
Invalidate the iterator. | |
void | toBegin () throw (Exception::Precondition) |
Reposition the iterator to the first element of the container. | |
void | toEnd () throw (Exception::Precondition) |
Reposition the iterator after the last element of the container. | |
Composite & | getData () throw () |
Return a reference to the current element. | |
const Composite & | getData () const throw () |
Return a const reference to the current element. | |
void | forward () throw () |
Increment the iterator by one element. | |
void | backward () throw () |
Decrement the iterator one element. | |
void | toRBegin () throw (Exception::Precondition) |
Reposition the (backward) iterator to the last element of the container. | |
void | toREnd () throw (Exception::Precondition) |
Reposition the (backward) iterator beyond the first element of the container. | |
void | setPredicate (const UnaryPredicate< Composite > &predicate) throw () |
Assign the current predicate associated with the iterator. | |
const UnaryPredicate< Composite > * | getPredicate () const throw () |
Return the current predicate associated with the iterator. | |
Constructors and Destructor | |
CompositeIteratorTraits () throw () | |
Default constructor. | |
CompositeIteratorTraits (const Composite &composite) throw () | |
Copy constructor. | |
CompositeIteratorTraits (const CompositeIteratorTraits &traits) throw () | |
Detailed constructor. | |
~CompositeIteratorTraits () throw () | |
Destructor. | |
Assignment | |
CompositeIteratorTraits & | operator= (const CompositeIteratorTraits &traits) throw () |
Assignment operator. | |
Accessors | |
Composite * | getContainer () throw () |
Return a pointer to the container the iterator is bound to. | |
const Composite * | getContainer () const throw () |
Return a const pointer to the container the iterator is bound to. | |
Predicates | |
bool | operator== (const CompositeIteratorTraits &traits) const throw () |
Equality operator. | |
bool | operator!= (const CompositeIteratorTraits &traits) const throw () |
Inequality operator. | |
Predicates | |
bool | isValid () const throw () |
Return the current status of the iterator. | |
bool | isSingular () const throw () |
Check whether the iterator is bound to a container. | |
bool | isBegin () const throw () |
Return true if the iterator is at the first element of the container. | |
bool | isEnd () const throw () |
Return true if the iterator is beyond the last element of the container. | |
bool | isRBegin () const throw () |
Return true if the iterator is at the last element of the container. | |
bool | isREnd () const throw () |
Return true if the iterator is beyond the first element of the container. | |
Protected Attributes | |
Composite * | bound_ |
The pointer to the container. | |
Composite::CompositeIterator | composite_iterator_ |
The internal iterator to iterate over the current node's children. | |
const UnaryPredicate< Composite > * | predicate_ |
The predicate. |
It is intended for internal use only.
|
Invalidate the iterator. The iterator is separated from its container ( isSingular is true afterwards) and its SubCompositeIterator is invalidated as well. |
|
Return true if the iterator is at the first element of the container.
|
|
Return true if the iterator is beyond the last element of the container.
|
|
Return true if the iterator is at the last element of the container.
|
|
Return true if the iterator is beyond the first element of the container.
|
|
Return the current status of the iterator.
If the iterator is bound and its subcomposite iterator is valid, this predicate returns |
|
Reposition the iterator to the first element of the container.
|
|
Reposition the iterator after the last element of the container.
|