#include <BALL/KERNEL/iterator.h>
Public Member Functions | |
Composite::CompositeIterator & | getPosition () |
Return the current iterator position. | |
const Composite::CompositeIterator & | getPosition () const |
Return the current iterator posittion (const method). | |
void | invalidate () |
void | toBegin () throw (Exception::Precondition) |
void | toEnd () throw (Exception::Precondition) |
Composite & | getData () |
Return a reference to the current element. | |
const Composite & | getData () const |
Return a const reference to the current element. | |
void | forward () |
Increment the iterator by one element. | |
void | backward () |
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) |
Assign the current predicate associated with the iterator. | |
const UnaryPredicate< Composite > * | getPredicate () const |
Return the current predicate associated with the iterator. | |
Constructors and Destructor | |
CompositeIteratorTraits () | |
Default constructor. | |
CompositeIteratorTraits (const Composite &composite) | |
Copy constructor. | |
CompositeIteratorTraits (const CompositeIteratorTraits &traits) | |
Detailed constructor. | |
~CompositeIteratorTraits () | |
Destructor. | |
Assignment | |
CompositeIteratorTraits & | operator= (const CompositeIteratorTraits &traits) |
Assignment operator. | |
Accessors | |
Composite * | getContainer () |
Return a pointer to the container the iterator is bound to. | |
const Composite * | getContainer () const |
Return a const pointer to the container the iterator is bound to. | |
Predicates | |
bool | operator== (const CompositeIteratorTraits &traits) const |
Equality operator. | |
bool | operator!= (const CompositeIteratorTraits &traits) const |
Inequality operator. | |
bool | isValid () const |
bool | isSingular () const |
Check whether the iterator is bound to a container. | |
bool | isBegin () const |
bool | isEnd () const |
bool | isRBegin () const |
bool | isREnd () const |
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. |
Composite Iterator Traits This class is used in the implementation of the kernel iterators. It is intended for internal use only.
Definition at line 85 of file iterator.h.
BALL::CompositeIteratorTraits::CompositeIteratorTraits | ( | ) | [inline] |
Default constructor.
Definition at line 236 of file iterator.h.
BALL::CompositeIteratorTraits::CompositeIteratorTraits | ( | const Composite & | composite | ) | [inline] |
Copy constructor.
Definition at line 243 of file iterator.h.
BALL::CompositeIteratorTraits::CompositeIteratorTraits | ( | const CompositeIteratorTraits & | traits | ) | [inline] |
Detailed constructor.
Definition at line 250 of file iterator.h.
BALL::CompositeIteratorTraits::~CompositeIteratorTraits | ( | ) | [inline] |
Destructor.
Definition at line 103 of file iterator.h.
void BALL::CompositeIteratorTraits::backward | ( | ) | [inline] |
Decrement the iterator one element.
Definition at line 377 of file iterator.h.
void BALL::CompositeIteratorTraits::forward | ( | ) | [inline] |
Increment the iterator by one element.
Definition at line 329 of file iterator.h.
const Composite* BALL::CompositeIteratorTraits::getContainer | ( | ) | const [inline] |
Return a const pointer to the container the iterator is bound to.
Definition at line 122 of file iterator.h.
Composite* BALL::CompositeIteratorTraits::getContainer | ( | ) | [inline] |
Return a pointer to the container the iterator is bound to.
Definition at line 119 of file iterator.h.
const Composite & BALL::CompositeIteratorTraits::getData | ( | ) | const [inline] |
Return a const reference to the current element.
Definition at line 324 of file iterator.h.
Composite & BALL::CompositeIteratorTraits::getData | ( | ) | [inline] |
Return a reference to the current element.
Definition at line 319 of file iterator.h.
const Composite::CompositeIterator& BALL::CompositeIteratorTraits::getPosition | ( | ) | const [inline] |
Return the current iterator posittion (const method).
Definition at line 179 of file iterator.h.
Composite::CompositeIterator& BALL::CompositeIteratorTraits::getPosition | ( | ) | [inline] |
Return the current iterator position.
Definition at line 176 of file iterator.h.
const UnaryPredicate<Composite>* BALL::CompositeIteratorTraits::getPredicate | ( | ) | const [inline] |
Return the current predicate associated with the iterator.
Definition at line 221 of file iterator.h.
void BALL::CompositeIteratorTraits::invalidate | ( | ) | [inline] |
Invalidate the iterator. The iterator is separated from its container ( isSingular is true afterwards) and its SubCompositeIterator is invalidated as well.
Definition at line 275 of file iterator.h.
bool BALL::CompositeIteratorTraits::isBegin | ( | ) | const [inline] |
Return true if the iterator is at the first element of the container.
Definition at line 291 of file iterator.h.
bool BALL::CompositeIteratorTraits::isEnd | ( | ) | const [inline] |
Return true if the iterator is beyond the last element of the container.
InvalidIterator | if the iterator is singular |
Definition at line 157 of file iterator.h.
bool BALL::CompositeIteratorTraits::isRBegin | ( | ) | const [inline] |
Return true if the iterator is at the last element of the container.
InvalidIterator | if the iterator is singular |
Definition at line 348 of file iterator.h.
bool BALL::CompositeIteratorTraits::isREnd | ( | ) | const [inline] |
Return true if the iterator is beyond the first element of the container.
InvalidIterator | if the iterator is singular |
Definition at line 368 of file iterator.h.
bool BALL::CompositeIteratorTraits::isSingular | ( | ) | const [inline] |
Check whether the iterator is bound to a container.
Definition at line 146 of file iterator.h.
bool BALL::CompositeIteratorTraits::isValid | ( | ) | const [inline] |
Return the current status of the iterator. If the iterator is bound and its subcomposite iterator is valid, this predicate returns true
.
Definition at line 143 of file iterator.h.
bool BALL::CompositeIteratorTraits::operator!= | ( | const CompositeIteratorTraits & | traits | ) | const [inline] |
Inequality operator.
Definition at line 270 of file iterator.h.
CompositeIteratorTraits & BALL::CompositeIteratorTraits::operator= | ( | const CompositeIteratorTraits & | traits | ) | [inline] |
Assignment operator.
Definition at line 257 of file iterator.h.
bool BALL::CompositeIteratorTraits::operator== | ( | const CompositeIteratorTraits & | traits | ) | const [inline] |
Equality operator.
Definition at line 265 of file iterator.h.
void BALL::CompositeIteratorTraits::setPredicate | ( | const UnaryPredicate< Composite > & | predicate | ) | [inline] |
Assign the current predicate associated with the iterator.
Definition at line 218 of file iterator.h.
void BALL::CompositeIteratorTraits::toBegin | ( | ) | throw (Exception::Precondition) [inline] |
Reposition the iterator to the first element of the container.
InvalidIterator | if the iterator is singular . |
Definition at line 281 of file iterator.h.
void BALL::CompositeIteratorTraits::toEnd | ( | ) | throw (Exception::Precondition) [inline] |
Reposition the iterator after the last element of the container.
InvalidIterator | if the iterator is singular . |
Definition at line 314 of file iterator.h.
void BALL::CompositeIteratorTraits::toRBegin | ( | ) | throw (Exception::Precondition) [inline] |
Reposition the (backward) iterator to the last element of the container.
Definition at line 338 of file iterator.h.
void BALL::CompositeIteratorTraits::toREnd | ( | ) | throw (Exception::Precondition) [inline] |
Reposition the (backward) iterator beyond the first element of the container.
Definition at line 363 of file iterator.h.
Composite* BALL::CompositeIteratorTraits::bound_ [protected] |
The pointer to the container.
Definition at line 227 of file iterator.h.
The internal iterator to iterate over the current node's children.
Definition at line 230 of file iterator.h.
const UnaryPredicate<Composite>* BALL::CompositeIteratorTraits::predicate_ [protected] |
The predicate.
Definition at line 233 of file iterator.h.