OpenTTD Source: GUIList< T, P, F > Class Template Reference

OpenTTD Source 15.0-RC2

Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
GUIList< T, P, F > Class Template Reference

List template of 'things' `T` to sort in a GUI. More...

`#include <sortlist_type.h>`

Inheritance diagram for GUIList< T, P, F >:

## Public Types
using | SortFunction = std::conditional_t< std::is_same_v< P, std::nullptr_t >, bool(const T &, const T &), bool(const T &, const T &, const P)>
| Signature of sort function.
using | FilterFunction = bool(const T *, F)
| Signature of filter function.

## Public Member Functions
template<typename T_ = T, typename P_ = P, typename _F = F, std::enable_if_t<!std::is_same_v< P_, std::nullptr_t > > * = nullptr>
| GUIList (const P &params)
uint8_t | SortType () const
| Get the sorttype of the list.
void | SetSortType (uint8_t n_type)
| Set the sorttype of the list.
Listing | GetListing () const
| Export current sort conditions.
void | SetListing (Listing l)
| Import sort conditions.
uint8_t | FilterType () const
| Get the filtertype of the list.
void | SetFilterType (uint8_t n_type)
| Set the filtertype of the list.
Filtering | GetFiltering () const
| Export current filter conditions.
void | SetFiltering (Filtering f)
| Import filter conditions.
bool | NeedResort ()
| Check if a resort is needed next loop If used the resort timer will decrease every call till 0.
void | ForceResort ()
| Force a resort next Sort call Reset the resort timer if used too.
bool | IsDescSortOrder () const
| Check if the sort order is descending.
void | ToggleSortOrder ()
| Toggle the sort order Since that is the worst condition for the sort function reverse the list here.
template<typename Comp >
bool | Sort (Comp compare)
| Sort the list.
void | SetSortFuncs (std::span< SortFunction *const > n_funcs)
| Hand the sort function pointers to the GUIList.
bool | Sort ()
| Overload of #Sort(SortFunction *compare) Overloaded to reduce external code.
bool | IsFilterEnabled () const
| Check if the filter is enabled.
void | SetFilterState (bool state)
| Enable or disable the filter.
bool | Filter (FilterFunction *decide, F filter_data)
| Filter the list.
void | SetFilterFuncs (std::span< FilterFunction *const > n_funcs)
| Hand the filter function pointers to the GUIList.
bool | Filter (F filter_data)
| Filter the data with the currently selected filter.
bool | NeedRebuild () const
| Check if a rebuild is needed.
void | ForceRebuild ()
| Force that a rebuild is needed.
void | RebuildDone ()
| Notify the sortlist that the rebuild is done.

## Protected Types
using | SortParameterReference = std::conditional_t< std::is_same_v< P, std::nullptr_t >, P, P & >

## Protected Member Functions
bool | IsSortable () const
| Check if the list is sortable.
void | ResetResortTimer ()
| Reset the resort timer.

## Protected Attributes
std::span< SortFunction *const > | sort_func_list
| the sort criteria functions
std::span< FilterFunction *const > | filter_func_list
| the filter criteria functions
SortListFlags | flags
| used to control sorting/resorting/etc.
uint8_t | sort_type
| what criteria to sort on
uint8_t | filter_type
| what criteria to filter on
uint16_t | resort_timer
| resort list after a given amount of ticks if set
const SortParameterReference | params

## Detailed Description

template<typename T, typename P = std::nullptr_t, typename F = std::string_view>
class GUIList< T, P, F >

List template of 'things' `T` to sort in a GUI.

Template Parameters

  T | Type of data stored in the list to represent each item.
  P | Tyoe of data passed as additional parameter to the sort function.
  F | Type of data fed as additional value to the filter function.

See also
  FilterFunction

Definition at line 43 of file sortlist_type.h.

## Member Typedef Documentation

## ◆ FilterFunction

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

using GUIList< T, P, F >::FilterFunction = bool(const T*, F)

Signature of filter function.

Definition at line 46 of file sortlist_type.h.

## ◆ SortFunction

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

using GUIList< T, P, F >::SortFunction = std::conditional_t<std::is_same_v<P, std::nullptr_t>, bool (const T&, const T&), bool (const T&, const T&, const P)>

Signature of sort function.

Definition at line 45 of file sortlist_type.h.

## ◆ SortParameterReference

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

using GUIList< T, P, F >::SortParameterReference = std::conditional_t<std::is_same_v<P, std::nullptr_t>, P, P&>
| protected

Definition at line 58 of file sortlist_type.h.

## Constructor & Destructor Documentation

## ◆ GUIList() [1/2]

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>
template<typename T_ = T, typename P_ = P, typename _F = F, std::enable_if_t< std::is_same_v< P_, std::nullptr_t > > * = nullptr>

GUIList< T, P, F >::GUIList | ( |  | ) |
| inline

Definition at line 83 of file sortlist_type.h.

## ◆ GUIList() [2/2]

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>
template<typename T_ = T, typename P_ = P, typename _F = F, std::enable_if_t<!std::is_same_v< P_, std::nullptr_t > > * = nullptr>

GUIList< T, P, F >::GUIList | ( | const P & | params | ) |
| inline

Definition at line 95 of file sortlist_type.h.

## Member Function Documentation

## ◆ Filter() [1/2]

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

bool GUIList< T, P, F >::Filter | ( | F | filter_data | ) |
| inline

Filter the data with the currently selected filter.

Parameters

  filter_data | Additional data passed to the filter function.

Returns
  true if the list has been altered by filtering

Definition at line 376 of file sortlist_type.h.

References Filter, and GUIList< T, P, F >::filter_func_list.

## ◆ Filter() [2/2]

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

bool GUIList< T, P, F >::Filter | ( | FilterFunction * | decide,
|  | F | filter_data
| ) |  |
| inline

Filter the list.

Parameters

  decide | The function to decide about an item
  filter_data | Additional data passed to the filter function

Returns
  true if the list has been altered by filtering

Definition at line 342 of file sortlist_type.h.

References Filter, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

Referenced by NetworkGameWindow::BuildGUINetworkGameList(), PickerWindow::BuildPickerClassList(), PickerWindow::BuildPickerTypeList(), IndustryDirectoryWindow::BuildSortIndustriesList(), NetworkContentListWindow::FilterContentList(), BuildVehicleWindow::FilterEngineList(), SignList::FilterSignList(), and BaseVehicleListWindow::FilterVehicleList().

## ◆ FilterType()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

uint8_t GUIList< T, P, F >::FilterType | ( |  | ) | const
| inline

Get the filtertype of the list.

Returns
  The current filtertype

Definition at line 163 of file sortlist_type.h.

References GUIList< T, P, F >::filter_type.

## ◆ ForceRebuild()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::ForceRebuild | ( |  | ) |
| inline

Force that a rebuild is needed.

Definition at line 395 of file sortlist_type.h.

References Rebuild, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set().

Referenced by NewGRFWindow::AddGRFToActive(), NetworkContentListWindow::NetworkContentListWindow(), NewGRFConfirmationCallback(), BuildVehicleWindow::OnClick(), SelectCompanyLiveryWindow::OnClick(), VehicleGroupWindow::OnClick(), NetworkContentListWindow::OnClick(), NewGRFWindow::OnClick(), SignWindow::OnClick(), CompanyStationsWindow::OnClick(), BuildVehicleWindow::OnDropdownSelect(), NewGRFWindow::OnDropdownSelect(), CompanyStationsWindow::OnDropdownSelect(), NetworkContentListWindow::OnEditboxChanged(), NetworkGameWindow::OnEditboxChanged(), NewGRFWindow::OnEditboxChanged(), BuildVehicleWindow::OnInvalidateData(), SelectCompanyLiveryWindow::OnInvalidateData(), VehicleGroupWindow::OnInvalidateData(), IndustryDirectoryWindow::OnInvalidateData(), PerformanceLeagueWindow::OnInvalidateData(), NetworkGameWindow::OnInvalidateData(), NewGRFWindow::OnInvalidateData(), PickerWindow::OnInvalidateData(), SignListWindow::OnInvalidateData(), CompanyStationsWindow::OnInvalidateData(), StoryBookWindow::OnInvalidateData(), TownDirectoryWindow::OnInvalidateData(), VehicleListWindow::OnInvalidateData(), NetworkContentListWindow::OnKeyPress(), NewGRFWindow::OnNewGRFsScanned(), NetworkContentListWindow::OnReceiveContentInfo(), SignWindow::PrevNextSign(), StoryBookWindow::RefreshSelectedPage(), VehicleGroupWindow::SelectGroup(), IndustryDirectoryWindow::SetAcceptedCargoFilter(), BaseVehicleListWindow::SetCargoFilter(), and IndustryDirectoryWindow::SetProducedCargoFilter().

## ◆ ForceResort()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::ForceResort | ( |  | ) |
| inline

Force a resort next Sort call Reset the resort timer if used too.

Definition at line 232 of file sortlist_type.h.

References Resort, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set().

Referenced by NetworkContentListWindow::OnClick(), NetworkGameWindow::OnClick(), TownDirectoryWindow::OnClick(), NetworkContentListWindow::OnDownloadComplete(), SignListWindow::OnInit(), VehicleGroupWindow::OnInvalidateData(), IndustryDirectoryWindow::OnInvalidateData(), PerformanceLeagueWindow::OnInvalidateData(), SignListWindow::OnInvalidateData(), CompanyStationsWindow::OnInvalidateData(), TownDirectoryWindow::OnInvalidateData(), VehicleListWindow::OnInvalidateData(), and NetworkContentListWindow::OnKeyPress().

## ◆ GetFiltering()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

Filtering GUIList< T, P, F >::GetFiltering | ( |  | ) | const
| inline

Export current filter conditions.

Returns
  the current filter conditions

Definition at line 186 of file sortlist_type.h.

References Filtering::criteria, Filter, GUIList< T, P, F >::filter_type, Filtering::state, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

Referenced by NetworkContentListWindow::UpdateFilterState().

## ◆ GetListing()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

Listing GUIList< T, P, F >::GetListing | ( |  | ) | const
| inline

Export current sort conditions.

Returns
  the current sort conditions

Definition at line 134 of file sortlist_type.h.

References Listing::criteria, Desc, Listing::order, GUIList< T, P, F >::sort_type, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

Referenced by TownDirectoryWindow::OnClick(), and TownDirectoryWindow::OnDropdownSelect().

## ◆ IsDescSortOrder()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

bool GUIList< T, P, F >::IsDescSortOrder | ( |  | ) | const
| inline

Check if the sort order is descending.

Returns
  true if the sort order is descending

Definition at line 242 of file sortlist_type.h.

References Desc, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

Referenced by BuildBridgeWindow::DrawWidget(), VehicleGroupWindow::DrawWidget(), IndustryDirectoryWindow::DrawWidget(), NetworkGameWindow::DrawWidget(), CompanyStationsWindow::DrawWidget(), TownDirectoryWindow::DrawWidget(), VehicleListWindow::DrawWidget(), and NetworkContentListWindow::OnPaint().

## ◆ IsFilterEnabled()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

bool GUIList< T, P, F >::IsFilterEnabled | ( |  | ) | const
| inline

Check if the filter is enabled.

Returns
  true if the filter is enabled

Definition at line 316 of file sortlist_type.h.

References Filter, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

## ◆ IsSortable()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

bool GUIList< T, P, F >::IsSortable | ( |  | ) | const
| inlineprotected

Check if the list is sortable.

Returns
  true if we can sort the list

Definition at line 66 of file sortlist_type.h.

Referenced by GUIList< T, P, F >::Sort(), and GUIList< T, P, F >::ToggleSortOrder().

## ◆ NeedRebuild()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

bool GUIList< T, P, F >::NeedRebuild | ( |  | ) | const
| inline

Check if a rebuild is needed.

Returns
  true if a rebuild is needed

Definition at line 387 of file sortlist_type.h.

References Rebuild, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

Referenced by PerformanceLeagueWindow::BuildCompanyList(), NetworkContentListWindow::BuildContentList(), VehicleGroupWindow::BuildGroupList(), NetworkGameWindow::BuildGUINetworkGameList(), PickerWindow::BuildPickerClassList(), PickerWindow::BuildPickerTypeList(), IndustryDirectoryWindow::BuildSortIndustriesList(), CompanyStationsWindow::BuildStationsList(), StoryBookWindow::BuildStoryPageElementList(), StoryBookWindow::BuildStoryPageList(), NetworkContentListWindow::OnInvalidateData(), IndustryDirectoryWindow::OnPaint(), NetworkContentListWindow::OnPaint(), NetworkGameWindow::OnPaint(), SignListWindow::OnPaint(), and TownDirectoryWindow::OnPaint().

## ◆ NeedResort()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

bool GUIList< T, P, F >::NeedResort | ( |  | ) |
| inline

Check if a resort is needed next loop If used the resort timer will decrease every call till 0.

If 0 reached the resort bit will be set and the timer will be reset.

Returns
  true if resort bit is set for next loop

Definition at line 218 of file sortlist_type.h.

References GUIList< T, P, F >::ResetResortTimer(), Resort, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set().

Referenced by SignWindow::OnClick(), VehicleGroupWindow::OnGameTick(), PerformanceLeagueWindow::OnGameTick(), CompanyStationsWindow::OnGameTick(), VehicleListWindow::OnGameTick(), NetworkGameWindow::OnPaint(), and SignWindow::PrevNextSign().

## ◆ RebuildDone()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::RebuildDone | ( |  | ) |
| inline

Notify the sortlist that the rebuild is done.

Note
  This forces a resort

Definition at line 405 of file sortlist_type.h.

References Rebuild, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), Resort, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set().

Referenced by PerformanceLeagueWindow::BuildCompanyList(), NetworkContentListWindow::BuildContentList(), VehicleGroupWindow::BuildGroupList(), NetworkGameWindow::BuildGUINetworkGameList(), PickerWindow::BuildPickerClassList(), PickerWindow::BuildPickerTypeList(), IndustryDirectoryWindow::BuildSortIndustriesList(), CompanyStationsWindow::BuildStationsList(), StoryBookWindow::BuildStoryPageElementList(), and StoryBookWindow::BuildStoryPageList().

## ◆ ResetResortTimer()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::ResetResortTimer | ( |  | ) |
| inlineprotected

Reset the resort timer.

Definition at line 74 of file sortlist_type.h.

References Ticks::DAY_TICKS.

Referenced by GUIList< T, P, F >::NeedResort(), and GUIList< T, P, F >::Sort().

## ◆ SetFilterFuncs()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::SetFilterFuncs | ( | std::span< FilterFunction *const > | n_funcs | ) |
| inline

Hand the filter function pointers to the GUIList.

Parameters

  n_funcs | Span covering the filter function pointers.

Definition at line 365 of file sortlist_type.h.

Referenced by NetworkContentListWindow::NetworkContentListWindow(), BuildVehicleWindow::SetCargoFilterArray(), IndustryDirectoryWindow::SetCargoFilterArray(), and BaseVehicleListWindow::SetCargoFilterArray().

## ◆ SetFiltering()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::SetFiltering | ( | Filtering | f | ) |
| inline

Import filter conditions.

Parameters

  f | The filter conditions we want to use

Definition at line 200 of file sortlist_type.h.

References Filtering::criteria, Filter, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), and Filtering::state.

Referenced by NetworkContentListWindow::NetworkContentListWindow().

## ◆ SetFilterState()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::SetFilterState | ( | bool | state | ) |
| inline

Enable or disable the filter.

Parameters

  state | If filtering should be enabled or disabled

Definition at line 326 of file sortlist_type.h.

References Filter, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set().

Referenced by NetworkGameWindow::BuildGUINetworkGameList(), BuildVehicleWindow::OnDropdownSelect(), PickerWindow::OnEditboxChanged(), NewGRFWindow::OnEditboxChanged(), PickerWindow::OnInvalidateData(), IndustryDirectoryWindow::SetAcceptedCargoFilter(), BaseVehicleListWindow::SetCargoFilter(), BuildVehicleWindow::SetCargoFilterArray(), IndustryDirectoryWindow::SetCargoFilterArray(), BaseVehicleListWindow::SetCargoFilterArray(), IndustryDirectoryWindow::SetProducedCargoFilter(), and NetworkContentListWindow::UpdateFilterState().

## ◆ SetFilterType()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::SetFilterType | ( | uint8_t | n_type | ) |
| inline

Set the filtertype of the list.

Parameters

  n_type | the new filter type

Definition at line 173 of file sortlist_type.h.

Referenced by NetworkContentListWindow::FilterContentList(), IndustryDirectoryWindow::SetAcceptedCargoFilter(), BaseVehicleListWindow::SetCargoFilter(), and IndustryDirectoryWindow::SetProducedCargoFilter().

## ◆ SetListing()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::SetListing | ( | Listing | l | ) |
| inline

Import sort conditions.

Parameters

  l | The sort conditions we want to use

Definition at line 148 of file sortlist_type.h.

References Listing::criteria, Desc, Listing::order, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set().

Referenced by NetworkContentListWindow::NetworkContentListWindow(), and TownDirectoryWindow::OnClick().

## ◆ SetSortFuncs()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::SetSortFuncs | ( | std::span< SortFunction *const > | n_funcs | ) |
| inline

Hand the sort function pointers to the GUIList.

Parameters

  n_funcs | Span covering the sort function pointers.

Definition at line 293 of file sortlist_type.h.

Referenced by NetworkContentListWindow::NetworkContentListWindow().

## ◆ SetSortType()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::SetSortType | ( | uint8_t | n_type | ) |
| inline

Set the sorttype of the list.

Parameters

  n_type | the new sort type

Definition at line 120 of file sortlist_type.h.

References Resort, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set().

Referenced by NetworkContentListWindow::OnClick(), NetworkGameWindow::OnClick(), BuildBridgeWindow::OnDropdownSelect(), VehicleGroupWindow::OnDropdownSelect(), IndustryDirectoryWindow::OnDropdownSelect(), CompanyStationsWindow::OnDropdownSelect(), TownDirectoryWindow::OnDropdownSelect(), and VehicleListWindow::OnDropdownSelect().

## ◆ Sort() [1/2]

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

bool GUIList< T, P, F >::Sort | ( |  | ) |
| inline

Overload of #Sort(SortFunction *compare) Overloaded to reduce external code.

Returns
  true if the list sequence has been altered

Definition at line 304 of file sortlist_type.h.

References GUIList< T, P, F >::Sort(), and GUIList< T, P, F >::sort_func_list.

Referenced by GUIList< T, P, F >::Sort().

## ◆ Sort() [2/2]

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>
template<typename Comp >

bool GUIList< T, P, F >::Sort | ( | Comp | compare | ) |
| inline

Sort the list.

Parameters

  compare | The function to compare two list items

Returns
  true if the list sequence has been altered

Definition at line 266 of file sortlist_type.h.

References Desc, GUIList< T, P, F >::IsSortable(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), GUIList< T, P, F >::ResetResortTimer(), Resort, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

Referenced by NetworkGameWindow::BuildGUINetworkGameList(), PickerWindow::BuildPickerClassList(), PickerWindow::BuildPickerTypeList(), IndustryDirectoryWindow::BuildSortIndustriesList(), StoryBookWindow::BuildStoryPageElementList(), StoryBookWindow::BuildStoryPageList(), TownDirectoryWindow::OnClick(), PerformanceLeagueWindow::OnPaint(), BuildBridgeWindow::SortBridgeList(), NetworkContentListWindow::SortContentList(), NetworkGameWindow::SortNetworkGameList(), and CompanyStationsWindow::SortStationsList().

## ◆ SortType()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

uint8_t GUIList< T, P, F >::SortType | ( |  | ) | const
| inline

Get the sorttype of the list.

Returns
  The current sorttype

Definition at line 110 of file sortlist_type.h.

References GUIList< T, P, F >::sort_type.

Referenced by NetworkGameWindow::DrawWidget(), IndustryDirectoryWindow::GetIndustryString(), IndustryDirectoryWindow::GetWidgetString(), TownDirectoryWindow::GetWidgetString(), VehicleListWindow::GetWidgetString(), BuildBridgeWindow::OnClick(), VehicleGroupWindow::OnClick(), IndustryDirectoryWindow::OnClick(), NetworkContentListWindow::OnClick(), NetworkGameWindow::OnClick(), CompanyStationsWindow::OnClick(), TownDirectoryWindow::OnClick(), VehicleListWindow::OnClick(), BuildBridgeWindow::OnDropdownSelect(), IndustryDirectoryWindow::OnDropdownSelect(), CompanyStationsWindow::OnDropdownSelect(), TownDirectoryWindow::OnDropdownSelect(), IndustryDirectoryWindow::OnInvalidateData(), TownDirectoryWindow::OnInvalidateData(), VehicleGroupWindow::OnPaint(), NetworkContentListWindow::OnPaint(), and BuildBridgeWindow::SortBridgeList().

## ◆ ToggleSortOrder()

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

void GUIList< T, P, F >::ToggleSortOrder | ( |  | ) |
| inline

Toggle the sort order Since that is the worst condition for the sort function reverse the list here.

Definition at line 252 of file sortlist_type.h.

References Desc, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Flip(), and GUIList< T, P, F >::IsSortable().

Referenced by BuildBridgeWindow::OnClick(), VehicleGroupWindow::OnClick(), IndustryDirectoryWindow::OnClick(), NetworkContentListWindow::OnClick(), NetworkGameWindow::OnClick(), CompanyStationsWindow::OnClick(), TownDirectoryWindow::OnClick(), and VehicleListWindow::OnClick().

## Field Documentation

## ◆ filter_func_list

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

std::span<FilterFunction * const> GUIList< T, P, F >::filter_func_list
| protected

the filter criteria functions

Definition at line 50 of file sortlist_type.h.

Referenced by GUIList< T, P, F >::Filter().

## ◆ filter_type

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

uint8_t GUIList< T, P, F >::filter_type
| protected

what criteria to filter on

Definition at line 53 of file sortlist_type.h.

Referenced by GUIList< T, P, F >::FilterType(), and GUIList< T, P, F >::GetFiltering().

## ◆ flags

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

SortListFlags GUIList< T, P, F >::flags
| protected

used to control sorting/resorting/etc.

Definition at line 51 of file sortlist_type.h.

## ◆ params

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

const SortParameterReference GUIList< T, P, F >::params
| protected

Definition at line 59 of file sortlist_type.h.

## ◆ resort_timer

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

uint16_t GUIList< T, P, F >::resort_timer
| protected

resort list after a given amount of ticks if set

Definition at line 54 of file sortlist_type.h.

## ◆ sort_func_list

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

std::span<SortFunction * const> GUIList< T, P, F >::sort_func_list
| protected

the sort criteria functions

Definition at line 49 of file sortlist_type.h.

Referenced by GUIList< T, P, F >::Sort().

## ◆ sort_type

template<typename T , typename P = std::nullptr_t, typename F = std::string_view>

uint8_t GUIList< T, P, F >::sort_type
| protected

what criteria to sort on

Definition at line 52 of file sortlist_type.h.

Referenced by GUIList< T, P, F >::GetListing(), and GUIList< T, P, F >::SortType().

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

- src/sortlist_type.h