OpenTTD Source: CargoSorter Class Reference

OpenTTD Source 15.3

Public Types | Public Member Functions | Private Member Functions | Private Attributes
CargoSorter Class Reference

## Public Types
using | is_transparent = void

## Public Member Functions
| CargoSorter (CargoSortType t=CargoSortType::StationID, SortOrder o=SO_ASCENDING)
CargoSortType | GetSortType ()
bool | operator() (const CargoDataEntry &cd1, const CargoDataEntry &cd2) const
bool | operator() (const CargoDataEntry &cd1, const std::unique_ptr< CargoDataEntry > &cd2) const
bool | operator() (const std::unique_ptr< CargoDataEntry > &cd1, const CargoDataEntry &cd2) const
bool | operator() (const std::unique_ptr< CargoDataEntry > &cd1, const std::unique_ptr< CargoDataEntry > &cd2) const

## Private Member Functions
template<class Tid >
bool | SortId (Tid st1, Tid st2) const
bool | SortCount (const CargoDataEntry &cd1, const CargoDataEntry &cd2) const
bool | SortStation (StationID st1, StationID st2) const

## Private Attributes
CargoSortType | type
SortOrder | order

## Detailed Description

Definition at line 869 of file station_gui.cpp.

## Member Typedef Documentation

## ◆ is_transparent

using CargoSorter::is_transparent = void

Definition at line 871 of file station_gui.cpp.

## Constructor & Destructor Documentation

## ◆ CargoSorter()

CargoSorter::CargoSorter | ( | CargoSortType | t = `CargoSortType::StationID`,
|  | SortOrder | o = `SO_ASCENDING`
| ) |  |
| inline

Definition at line 872 of file station_gui.cpp.

## Member Function Documentation

## ◆ GetSortType()

CargoSortType CargoSorter::GetSortType | ( |  | ) |
| inline

Definition at line 873 of file station_gui.cpp.

## ◆ operator()() [1/4]

bool CargoSorter::operator() | ( | const CargoDataEntry & | cd1,
|  | const CargoDataEntry & | cd2
| ) |  | const

Definition at line 1166 of file station_gui.cpp.

## ◆ operator()() [2/4]

bool CargoSorter::operator() | ( | const CargoDataEntry & | cd1,
|  | const std::unique_ptr< CargoDataEntry > & | cd2
| ) |  | const
| inline

Definition at line 875 of file station_gui.cpp.

## ◆ operator()() [3/4]

bool CargoSorter::operator() | ( | const std::unique_ptr< CargoDataEntry > & | cd1,
|  | const CargoDataEntry & | cd2
| ) |  | const
| inline

Definition at line 876 of file station_gui.cpp.

## ◆ operator()() [4/4]

bool CargoSorter::operator() | ( | const std::unique_ptr< CargoDataEntry > & | cd1,
|  | const std::unique_ptr< CargoDataEntry > & | cd2
| ) |  | const
| inline

Definition at line 877 of file station_gui.cpp.

## ◆ SortCount()

bool CargoSorter::SortCount | ( | const CargoDataEntry & | cd1,
|  | const CargoDataEntry & | cd2
| ) |  | const
| private

Definition at line 1188 of file station_gui.cpp.

## ◆ SortId()

template<class Tid >

bool CargoSorter::SortId | ( | Tid | st1,
|  | Tid | st2
| ) |  | const
| private

Definition at line 1183 of file station_gui.cpp.

## ◆ SortStation()

bool CargoSorter::SortStation | ( | StationID | st1,
|  | StationID | st2
| ) |  | const
| private

Definition at line 1201 of file station_gui.cpp.

## Field Documentation

## ◆ order

SortOrder CargoSorter::order
| private

Definition at line 881 of file station_gui.cpp.

## ◆ type

CargoSortType CargoSorter::type
| private

Definition at line 880 of file station_gui.cpp.

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

- src/station_gui.cpp