OpenTTD Source: LinkGraphJob::EdgeIterator Class Reference

OpenTTD Source 13.1

Public Member Functions | Private Attributes
LinkGraphJob::EdgeIterator Class Reference

Iterator for job edges. More...

`#include <linkgraphjob.h>`

Inheritance diagram for LinkGraphJob::EdgeIterator:

## Public Member Functions
| EdgeIterator (const LinkGraph::BaseEdge *base, EdgeAnnotation *base_anno, NodeID current)
| Constructor. More...
std::pair< NodeID, Edge > | operator* () const
| Dereference. More...
FakePointer | operator-> () const
| Dereference. More...
Public Member Functions inherited from LinkGraph::BaseEdgeIterator< const LinkGraph::BaseEdge, Edge, EdgeIterator >
| BaseEdgeIterator (const LinkGraph::BaseEdge *base, NodeID current)
| Constructor. More...
EdgeIterator & | operator++ ()
| Prefix-increment. More...
EdgeIterator | operator++ (int)
| Postfix-increment. More...
bool | operator== (const Tother &other)
| Compare with some other edge iterator. More...
bool | operator!= (const Tother &other)
| Compare for inequality with some other edge iterator. More...
std::pair< NodeID, Edge > | operator* () const
| Dereference with operator*. More...
FakePointer | operator-> () const
| Dereference with operator->. More...

## Private Attributes
EdgeAnnotation * | base_anno
| Array of annotations to be (indirectly) iterated.

## Additional Inherited Members
Protected Attributes inherited from LinkGraph::BaseEdgeIterator< const LinkGraph::BaseEdge, Edge, EdgeIterator >
const LinkGraph::BaseEdge * | base
| Array of edges being iterated.
NodeID | current
| Current offset in edges array.

## Detailed Description

Iterator for job edges.

Definition at line 148 of file linkgraphjob.h.

## Constructor & Destructor Documentation

## ◆ EdgeIterator()

LinkGraphJob::EdgeIterator::EdgeIterator | ( | const LinkGraph::BaseEdge * | base,
|  | EdgeAnnotation * | base_anno,
|  | NodeID | current
| ) |  |
| inline

Constructor.

Parameters

  base | Array of edges to be iterated.
  base_anno | Array of annotations to be iterated.
  current | Start offset of iteration.

Definition at line 157 of file linkgraphjob.h.

## Member Function Documentation

## ◆ operator*()

std::pair<NodeID, Edge> LinkGraphJob::EdgeIterator::operator* | ( |  | ) | const
| inline

Dereference.

Returns
  Pair of the edge currently pointed to and the ID of its other end.

Definition at line 166 of file linkgraphjob.h.

References LinkGraph::BaseEdgeIterator< const LinkGraph::BaseEdge, Edge, EdgeIterator >::current.

## ◆ operator->()

FakePointer LinkGraphJob::EdgeIterator::operator-> | ( |  | ) | const
| inline

Dereference.

Has to be repeated here as operator* is different than in LinkGraph::EdgeWrapper.

Returns
  Fake pointer to pair of NodeID/Edge.

Definition at line 176 of file linkgraphjob.h.

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

- src/linkgraph/linkgraphjob.h