31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Equal is a class that compares two items of the template parameter T by means<br />

of a method bool operator()(T,T);. <strong>The</strong>re are some classes available for this<br />

purpose: Equal, Unequal, LessThan, LessEqual, GreaterThan and<br />

GreaterEqual with obvious semantics, where T is the type of the values. Predicates<br />

of the STL can be used as well since they have the same interface.<br />

13.11 Observer Node Iterator ( ObserverNodeIt )<br />

1. Definition<br />

An instance it of class ObserverNodeIt is an observer iterator. Any method<br />

call of iterators will be “observed” by an internal object of class Obs.<br />

Class ObserverEdgeIt and ObserverAdjIt are defined analogously, i.e. can be used for<br />

edge iterators or adjacency iterators, respectively.<br />

Precondition: <strong>The</strong> template parameter Iter must be a node iterator.<br />

#include < <strong>LEDA</strong>/graph/graph iterator.h ><br />

2. Creation<br />

ObserverNodeIt it;<br />

introduces a variable it of this class, not bound to an observer or<br />

iterator.<br />

ObserverNodeIt it(Obs& obs, const Iter& base it);<br />

introduces a variable it of this class bound to the observer obs and<br />

base it.<br />

Precondition: Obs must have methods observe constructor(),<br />

observe forward(), observe update(). <strong>The</strong>se three methods<br />

may have arbitrary return types (incl. void).<br />

3. Operations<br />

void<br />

it.init(const Obs& obs, const Iter& base it)<br />

initializes it, which is bound to obs and base it afterwards.<br />

Precondition: it is not bound to an observer or iterator.<br />

Obs& it.get observer( ) returns a reference to the observer to which it is<br />

bound.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!