EdgeIterator Class Reference

allows an iteration trough all edges of a vertex More...

`#include <EdgeIterator.h>`

## Public Types

enum | ITERATIONMODE { SAMPLEOCCURENCE, SAMPLEVALUE }

## Public Member Functions

| EdgeIterator (void)
| EdgeIterator (Vertex *v, ITERATIONMODE m=SAMPLEOCCURENCE)
| EdgeIterator (const EdgeIterator &eit)
| ~EdgeIterator (void)
const Edge * | operator* (void) const
void | operator++ (void)
void | reset (Vertex *v, ITERATIONMODE m=SAMPLEOCCURENCE)
void | reset (ITERATIONMODE m=SAMPLEOCCURENCE)
bool | isFinished (void) const
VertexLabel | getPartnerVertexLabel (void) const
void | print (unsigned short spc=0) const

## Static Public Member Functions

static UWORD32 | getMaxNumEdges (void)
static void | setMaxNumEdges (UWORD32 mne)

## Private Member Functions

void | findNextEdge (void)
bool | isDestSampleValueOK (const SampleValue *sv)

## Private Attributes

Edge | CurrentEdge
| the current edge (is returned by operator*) More...
ITERATIONMODE | Mode
| mode of iteration More...
unsigned long * | SVALIndices
| contains (for every sample value) an index to the current opposite neighbour More...
UWORD32 | EdgeIndex
| the index/number of the edge that is currently returned by operator* More...
bool | Finished
| is true iff there are no more edges for this source vertex More...
std::list< SampleOccurence >::const_iterator | SampleOccurenceIt

## Static Private Attributes

static UWORD32 | MaxNumEdges = UWORD32_MAX
| the maximum number of edges the EdgeIterator should iterate through More...

## Detailed Description

The Vertex that is the source for all edges is called "source vertex". The order of the iteration through the edges is from the shortest to the longest edge. If two edges have the same length they are ordered the same way as the corresponding entries in the sample value adjacency lists (for different sample values) respectivly the destination sample occurences in the SampleOccurences data structure (for the same sample value).

EdgeIterator uses an SampleOccurence::const_iterator to store information about the current edge. Graph::(un)markDeletedSampleOccurence can invalidate such iterators. It is therefore not a good idea to use EdgeIterators at the same time as the Graph::(un)markDeletedSampleOccurence functionality.

NOTE: EdgeIterator relies on the Globals object pointed to by the Globs pointer. This means that it must be set correctly before using any method of an EdgeIterator object.

## Member Enumeration Documentation

## ITERATIONMODE

enum EdgeIterator::ITERATIONMODE

Enumerator
SAMPLEOCCURENCE |
SAMPLEVALUE |

## Constructor & Destructor Documentation

## EdgeIterator() [1/3]

EdgeIterator::EdgeIterator | ( | void |  | ) |

the default contructor - does not create a valid object

## EdgeIterator() [2/3]

EdgeIterator::EdgeIterator | ( | Vertex * | v,
|  | ITERATIONMODE | m = `SAMPLEOCCURENCE`
| ) |  |

Parameters

  v | the source vertex

## EdgeIterator() [3/3]

EdgeIterator::EdgeIterator | ( | const EdgeIterator & | eit | ) |

the copy constructor

## ~EdgeIterator()

EdgeIterator::~EdgeIterator | ( | void |  | ) |

## Member Function Documentation

## findNextEdge()

void EdgeIterator::findNextEdge | ( | void |  | ) |

private

find the shortest edge, starting the search at SVOppNeighsIndices[0...k] set the private variables accordingly is only called to find a new destination sample value, i.e. if one of the SVOppNeighsIndices[i] is changed

## getMaxNumEdges()

static UWORD32 EdgeIterator::getMaxNumEdges | ( | void |  | ) |

inline static

## getPartnerVertexLabel()

VertexLabel EdgeIterator::getPartnerVertexLabel | ( | void |  | ) | const

inline

get the label of the partner vertex

Returns
  the label of the vertex that builds the edge returned by operator* together with SrcVertex

## isDestSampleValueOK()

bool EdgeIterator::isDestSampleValueOK | ( | const SampleValue * | sv | ) |

private

Returns
  true iff there is a sample with value sv that is part of an edge starting at SrcVertex

## isFinished()

bool EdgeIterator::isFinished | ( | void |  | ) | const

inline

Returns
  true iff this EdgeIterator points to the end of the list of edges of SrcVertex

## operator*()

const Edge* EdgeIterator::operator* | ( | void |  | ) | const

inline

get the current edge

Returns
  the edge that is described by the current status of this EdgeIterator

## operator++()

void EdgeIterator::operator++ | ( | void |  | ) |

set this iterator to next edge

## print()

void EdgeIterator::print | ( | unsigned short | spc = `0` | ) | const

## reset() [1/2]

void EdgeIterator::reset | ( | Vertex * | v,
|  | ITERATIONMODE | m = `SAMPLEOCCURENCE`
| ) |  |

set this iterator to first (shortest) edge of vertex v

Parameters

  v | new vertex (don't change if it is NULL)

## reset() [2/2]

void EdgeIterator::reset | ( | ITERATIONMODE | m = `SAMPLEOCCURENCE` | ) |

reset this iterator to first (shortest) edge

## setMaxNumEdges()

static void EdgeIterator::setMaxNumEdges | ( | UWORD32 | mne | ) |

inline static

## Member Data Documentation

## CurrentEdge

Edge EdgeIterator::CurrentEdge

private

## EdgeIndex

UWORD32 EdgeIterator::EdgeIndex

private

## Finished

bool EdgeIterator::Finished

private

## MaxNumEdges

UWORD32 EdgeIterator::MaxNumEdges = UWORD32_MAX

static private

## Mode

ITERATIONMODE EdgeIterator::Mode

private

## SampleOccurenceIt

std::list<SampleOccurence>::const_iterator EdgeIterator::SampleOccurenceIt

private

contains the iterator pointing to the sample occurence that constitutes the edge together with SourceVertex/SourceSamleValueIndex

## SVALIndices

unsigned long* EdgeIterator::SVALIndices

private

The documentation for this class was generated from the following files:

- EdgeIterator.h
- EdgeIterator.cc