OpenTTD Source: LinkRefresher::Hop Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
LinkRefresher::Hop Struct Reference

A hop the refresh algorithm might evaluate. More...

`#include <refresh.h>`

## Public Member Functions
| Hop ()
| Default constructor should not be called but has to be visible for usage in std::set.
| Hop (VehicleOrderID from, VehicleOrderID to, CargoType cargo)
| Real constructor, only use this one.
constexpr auto | operator<=> (const Hop &) const noexcept=default

## Data Fields
VehicleOrderID | from
| Last order where vehicle could interact with cargo or absolute first order.
VehicleOrderID | to
| Next order to be processed.
CargoType | cargo
| Cargo the consist is probably carrying or INVALID_CARGO if unknown.

## Detailed Description

A hop the refresh algorithm might evaluate.

If the same hop is seen again the evaluation is stopped. This of course is a fairly simple heuristic. Sequences of refit orders can produce vehicles with all kinds of different cargoes and remembering only one can lead to early termination of the algorithm. However, as the order language is Turing complete, we are facing the halting problem here. At some point we have to draw the line.

Definition at line 58 of file refresh.h.

## Constructor & Destructor Documentation

## ◆ Hop() [1/2]

LinkRefresher::Hop::Hop | ( |  | ) |
| inline

Default constructor should not be called but has to be visible for usage in std::set.

Definition at line 67 of file refresh.h.

## ◆ Hop() [2/2]

LinkRefresher::Hop::Hop | ( | VehicleOrderID | from,
|  | VehicleOrderID | to,
|  | CargoType | cargo
| ) |  |
| inline

Real constructor, only use this one.

Parameters

  from | First order of the hop.
  to | Second order of the hop.
  cargo | Cargo the consist is probably carrying when passing the hop.

Definition at line 75 of file refresh.h.

## Field Documentation

## ◆ cargo

CargoType LinkRefresher::Hop::cargo

Cargo the consist is probably carrying or INVALID_CARGO if unknown.

Definition at line 61 of file refresh.h.

## ◆ from

VehicleOrderID LinkRefresher::Hop::from

Last order where vehicle could interact with cargo or absolute first order.

Definition at line 59 of file refresh.h.

## ◆ to

VehicleOrderID LinkRefresher::Hop::to

Next order to be processed.

Definition at line 60 of file refresh.h.

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

- src/linkgraph/refresh.h