Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

CompositeIteratorTraits Class Reference
[Iterator Classes]

Composite Iterator Traits This class is used in the implementation of the kernel iterators. More...

#include <iterator.h>

Inheritance diagram for CompositeIteratorTraits:

AtomContainerIteratorTraits AtomIteratorTraits ChainIteratorTraits FragmentIteratorTraits MoleculeIteratorTraits NucleicAcidIteratorTraits NucleotideIteratorTraits PDBAtomIteratorTraits ProteinIteratorTraits ResidueIteratorTraits SecondaryStructureIteratorTraits List of all members.

Public Member Functions

Composite::CompositeIteratorgetPosition () throw ()
 Return the current iterator position.
const Composite::CompositeIteratorgetPosition () 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.
CompositegetData () throw ()
 Return a reference to the current element.
const CompositegetData () 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
CompositeIteratorTraitsoperator= (const CompositeIteratorTraits &traits) throw ()
 Assignment operator.
Accessors
CompositegetContainer () throw ()
 Return a pointer to the container the iterator is bound to.
const CompositegetContainer () 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

Compositebound_
 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.

Detailed Description

Composite Iterator Traits This class is used in the implementation of the kernel iterators.

It is intended for internal use only.


Member Function Documentation

void CompositeIteratorTraits::invalidate  )  throw ()
 

Invalidate the iterator.

The iterator is separated from its container ( isSingular is true afterwards) and its SubCompositeIterator is invalidated as well.

bool CompositeIteratorTraits::isBegin  )  const throw ()
 

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

See also:
isSingular

bool CompositeIteratorTraits::isEnd  )  const throw ()
 

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

Exceptions:
InvalidIterator if the iterator is singular
See also:
isSingular

bool CompositeIteratorTraits::isRBegin  )  const throw ()
 

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

Exceptions:
InvalidIterator if the iterator is singular
See also:
isSingular

bool CompositeIteratorTraits::isREnd  )  const throw ()
 

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

Exceptions:
InvalidIterator if the iterator is singular
See also:
isSingular

bool CompositeIteratorTraits::isValid  )  const throw ()
 

Return the current status of the iterator.

If the iterator is bound and its subcomposite iterator is valid, this predicate returns true.

void CompositeIteratorTraits::toBegin  )  throw (Exception::Precondition)
 

Reposition the iterator to the first element of the container.

Exceptions:
InvalidIterator if the iterator is singular .
See also:
isSingular

void CompositeIteratorTraits::toEnd  )  throw (Exception::Precondition)
 

Reposition the iterator after the last element of the container.

Exceptions:
InvalidIterator if the iterator is singular .
See also:
isSingular