OpenTTD Source: LinkGraph::BaseEdgeIterator< Tedge, Tedge_wrapper, Titer >::FakePointer Class Reference

OpenTTD Source 12.0-beta1

Public Member Functions
LinkGraph::BaseEdgeIterator< Tedge, Tedge_wrapper, Titer >::FakePointer Class Reference

A "fake" pointer to enable operator-> on temporaries. More...

`#include <linkgraph.h>`

Inheritance diagram for LinkGraph::BaseEdgeIterator< Tedge, Tedge_wrapper, Titer >::FakePointer:

## Public Member Functions
| FakePointer (const std::pair< NodeID, Tedge_wrapper > &pair)
| Construct a fake pointer from a pair of NodeID and edge. More...
std::pair< NodeID, Tedge_wrapper > * | operator-> ()
| Retrieve the pair by operator->. More...

## Detailed Description

### template<class Tedge, class Tedge_wrapper, class Titer>
class LinkGraph::BaseEdgeIterator< Tedge, Tedge_wrapper, Titer >::FakePointer

A "fake" pointer to enable operator-> on temporaries.

As the objects returned from operator* aren't references but real objects, we have to return something that implements operator->, but isn't a pointer from operator->. A fake pointer.

Definition at line 192 of file linkgraph.h.

## Constructor & Destructor Documentation

## ◆ FakePointer()

template<class Tedge , class Tedge_wrapper , class Titer >

LinkGraph::BaseEdgeIterator< Tedge, Tedge_wrapper, Titer >::FakePointer::FakePointer | ( | const std::pair< NodeID, Tedge_wrapper > & | pair | ) |
| inline

Construct a fake pointer from a pair of NodeID and edge.

Parameters

  pair | Pair to be "pointed" to (in fact shallow-copied).

Definition at line 199 of file linkgraph.h.

## Member Function Documentation

## ◆ operator->()

template<class Tedge , class Tedge_wrapper , class Titer >

std::pair<NodeID, Tedge_wrapper>* LinkGraph::BaseEdgeIterator< Tedge, Tedge_wrapper, Titer >::FakePointer::operator-> | ( |  | ) |
| inline

Retrieve the pair by operator->.

Returns
  Pair being "pointed" to.

Definition at line 205 of file linkgraph.h.

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

- src/linkgraph/linkgraph.h