Loading...
Searching...
No Matches
BALL::CompositeIteratorTraits Class Reference
Kernel Classes » Iterator Classes

`#include <BALL/KERNEL/iterator.h>`

Inheritance diagram for BALL::CompositeIteratorTraits:

## Public Member Functions

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

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.
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
Composite::CompositeIterator & | getPosition ()
| Return the current iterator position.
const Composite::CompositeIterator & | getPosition () const
| Return the current iterator posittion (const method).
void | invalidate ()
void | toBegin ()
void | toEnd ()
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 ()
void | toREnd ()
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.

## Detailed Description

Composite Iterator Traits This class is used in the implementation of the kernel iterators. It is intended for internal use only.

Definition at line 83 of file iterator.h.

## Constructor & Destructor Documentation

## CompositeIteratorTraits() [1/3]

BALL::CompositeIteratorTraits::CompositeIteratorTraits | ( |  | ) |

inline

Default constructor.

Definition at line 238 of file iterator.h.

## CompositeIteratorTraits() [2/3]

BALL::CompositeIteratorTraits::CompositeIteratorTraits | ( | const Composite & | composite | ) |

inline

Copy constructor.

Definition at line 245 of file iterator.h.

## CompositeIteratorTraits() [3/3]

BALL::CompositeIteratorTraits::CompositeIteratorTraits | ( | const CompositeIteratorTraits & | traits | ) |

inline

Detailed constructor.

Definition at line 252 of file iterator.h.

## ~CompositeIteratorTraits()

BALL::CompositeIteratorTraits::~CompositeIteratorTraits | ( |  | ) |

inline

Destructor.

Definition at line 101 of file iterator.h.

## Member Function Documentation

## backward()

void BALL::CompositeIteratorTraits::backward | ( |  | ) |

inline

Decrement the iterator one element.

Definition at line 379 of file iterator.h.

## forward()

void BALL::CompositeIteratorTraits::forward | ( |  | ) |

inline

Increment the iterator by one element.

Definition at line 331 of file iterator.h.

## getContainer() [1/2]

Composite * BALL::CompositeIteratorTraits::getContainer | ( |  | ) |

inline

Return a pointer to the container the iterator is bound to.

Definition at line 117 of file iterator.h.

## getContainer() [2/2]

const Composite * BALL::CompositeIteratorTraits::getContainer | ( |  | ) | const

inline

Return a const pointer to the container the iterator is bound to.

Definition at line 120 of file iterator.h.

## getData() [1/2]

Composite & BALL::CompositeIteratorTraits::getData | ( |  | ) |

inline

Return a reference to the current element.

Definition at line 321 of file iterator.h.

## getData() [2/2]

const Composite & BALL::CompositeIteratorTraits::getData | ( |  | ) | const

inline

Return a const reference to the current element.

Definition at line 326 of file iterator.h.

## getPosition() [1/2]

Composite::CompositeIterator & BALL::CompositeIteratorTraits::getPosition | ( |  | ) |

inline

Return the current iterator position.

Definition at line 174 of file iterator.h.

## getPosition() [2/2]

const Composite::CompositeIterator & BALL::CompositeIteratorTraits::getPosition | ( |  | ) | const

inline

Return the current iterator posittion (const method).

Definition at line 177 of file iterator.h.

## getPredicate()

const UnaryPredicate< Composite > * BALL::CompositeIteratorTraits::getPredicate | ( |  | ) | const

inline

Return the current predicate associated with the iterator.

Definition at line 223 of file iterator.h.

## invalidate()

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 277 of file iterator.h.

## isBegin()

bool BALL::CompositeIteratorTraits::isBegin | ( |  | ) | const

inline

Return true if the iterator is at the first element of the container.

See also
  isSingular

Definition at line 293 of file iterator.h.

## isEnd()

bool BALL::CompositeIteratorTraits::isEnd | ( |  | ) | const

inline

Return true if the iterator is beyond the last element of the container.

Exceptions

  InvalidIterator | if the iterator is singular

See also
  isSingular

Definition at line 155 of file iterator.h.

## isRBegin()

bool BALL::CompositeIteratorTraits::isRBegin | ( |  | ) | const

inline

Return true if the iterator is at the last element of the container.

Exceptions

  InvalidIterator | if the iterator is singular

See also
  isSingular

Definition at line 350 of file iterator.h.

## isREnd()

bool BALL::CompositeIteratorTraits::isREnd | ( |  | ) | const

inline

Return true if the iterator is beyond the first element of the container.

Exceptions

  InvalidIterator | if the iterator is singular

See also
  isSingular

Definition at line 370 of file iterator.h.

## isSingular()

bool BALL::CompositeIteratorTraits::isSingular | ( |  | ) | const

inline

Check whether the iterator is bound to a container.

Definition at line 144 of file iterator.h.

## isValid()

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 141 of file iterator.h.

## operator!=()

bool BALL::CompositeIteratorTraits::operator!= | ( | const CompositeIteratorTraits & | traits | ) | const

inline

Inequality operator.

Definition at line 272 of file iterator.h.

## operator=()

CompositeIteratorTraits & BALL::CompositeIteratorTraits::operator= | ( | const CompositeIteratorTraits & | traits | ) |

inline

Assignment operator.

Definition at line 259 of file iterator.h.

## operator==()

bool BALL::CompositeIteratorTraits::operator== | ( | const CompositeIteratorTraits & | traits | ) | const

inline

Equality operator.

Definition at line 267 of file iterator.h.

## setPredicate()

void BALL::CompositeIteratorTraits::setPredicate | ( | const UnaryPredicate< Composite > & | predicate | ) |

inline

Assign the current predicate associated with the iterator.

Definition at line 220 of file iterator.h.

## toBegin()

void BALL::CompositeIteratorTraits::toBegin | ( |  | ) |

inline

Reposition the iterator to the first element of the container.

Exceptions

  Exception::Precondition | if the iterator is unbound

See also
  isSingular

Definition at line 283 of file iterator.h.

## toEnd()

void BALL::CompositeIteratorTraits::toEnd | ( |  | ) |

inline

Reposition the iterator after the last element of the container.

Exceptions

  Exception::Precondition | if the iterator is unbound

See also
  isSingular

Definition at line 316 of file iterator.h.

## toRBegin()

void BALL::CompositeIteratorTraits::toRBegin | ( |  | ) |

inline

Reposition the (backward) iterator to the last element of the container

Exceptions

  Exception::Precondition | if the iterator is unbound

Definition at line 340 of file iterator.h.

## toREnd()

void BALL::CompositeIteratorTraits::toREnd | ( |  | ) |

inline

Reposition the (backward) iterator beyond the first element of the container

Exceptions

  Exception::Precondition | if the iterator is unbound

Definition at line 365 of file iterator.h.

## Member Data Documentation

## bound_

Composite* BALL::CompositeIteratorTraits::bound_

protected

The pointer to the container.

Definition at line 229 of file iterator.h.

## composite_iterator_

Composite::CompositeIterator BALL::CompositeIteratorTraits::composite_iterator_

protected

The internal iterator to iterate over the current node's children.

Definition at line 232 of file iterator.h.

## predicate_

const UnaryPredicate<Composite>* BALL::CompositeIteratorTraits::predicate_

protected

The predicate.

Definition at line 235 of file iterator.h.