OpenTTD Source: BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask > Class Template Reference

OpenTTD Source 15.3

Public Types | Public Member Functions | Static Public Attributes | Private Attributes
BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask > Class Template Reference

Base for bit set wrapper. More...

`#include <base_bitset_type.hpp>`

Inheritance diagram for BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >:

## Public Types
using | ValueType = Tvalue_type
| Value type of this BaseBitSet.
using | BaseType = Tstorage
| Storage type of this BaseBitSet, be ConvertibleThroughBase.

## Public Member Functions
constexpr | BaseBitSet (Tstorage data)
constexpr auto | operator<=> (const BaseBitSet &) const noexcept=default
constexpr Timpl & | Set ()
| Set all bits.
constexpr Timpl & | Set (Tvalue_type value)
| Set the value-th bit.
constexpr Timpl & | Set (const Timpl &other)
| Set values from another bitset.
constexpr Timpl & | Set (Tvalue_type value, bool set)
| Assign the value-th bit.
constexpr Timpl & | Reset ()
| Reset all bits.
constexpr Timpl & | Reset (Tvalue_type value)
| Reset the value-th bit.
constexpr Timpl & | Reset (const Timpl &other)
| Reset values from another bitset.
constexpr Timpl & | Flip (Tvalue_type value)
| Flip the value-th bit.
constexpr Timpl & | Flip (const Timpl &other)
| Flip values from another bitset.
constexpr bool | Test (Tvalue_type value) const
| Test if the value-th bit is set.
constexpr bool | All (const Timpl &other) const
| Test if all of the values are set.
constexpr bool | All () const
| Test if all of the values are set.
constexpr bool | Any (const Timpl &other) const
| Test if any of the given values are set.
constexpr bool | Any () const
| Test if any of the values are set.
constexpr bool | None () const
| Test if none of the values are set.
constexpr Timpl & | operator|= (const Timpl &other)
constexpr Timpl | operator| (const Timpl &other) const
constexpr Timpl & | operator&= (const Timpl &other)
constexpr Timpl | operator& (const Timpl &other) const
constexpr Tstorage | base () const noexcept
| Retrieve the raw value behind this bit set.
constexpr bool | IsValid () const
| Test that the raw value of this bit set is valid.
uint | Count () const
| Count the number of set bits.
std::optional< Tvalue_type > | GetNthSetBit (uint n) const
| Get the value of the Nth set bit.
auto | begin () const
auto | end () const

## Static Public Attributes
static constexpr Tstorage | MASK = Tmask
| Mask of valid values.

## Private Attributes
Tstorage | data
| Bitmask of values.

## Detailed Description

template<typename Timpl, typename Tvalue_type, typename Tstorage, Tstorage Tmask = std::numeric_limits<Tstorage>::max()>
class BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >

Base for bit set wrapper.

Allows wrapping strong type values as a bit set. Methods are loosely modelled on std::bitset.

Template Parameters

  Tvalue_type | Type of values to wrap.
  Tstorage | Storage type required to hold values.

Definition at line 25 of file base_bitset_type.hpp.

## Member Typedef Documentation

## ◆ BaseType

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

using BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::BaseType = Tstorage

Storage type of this BaseBitSet, be ConvertibleThroughBase.

Definition at line 28 of file base_bitset_type.hpp.

## ◆ ValueType

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

using BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::ValueType = Tvalue_type

Value type of this BaseBitSet.

Definition at line 27 of file base_bitset_type.hpp.

## Constructor & Destructor Documentation

## ◆ BaseBitSet() [1/2]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::BaseBitSet | ( |  | ) |
| inlineconstexpr

Definition at line 31 of file base_bitset_type.hpp.

## ◆ BaseBitSet() [2/2]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::BaseBitSet | ( | Tstorage | data | ) |
| inlineexplicitconstexpr

Definition at line 32 of file base_bitset_type.hpp.

## Member Function Documentation

## ◆ All() [1/2]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr bool BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::All | ( |  | ) | const
| inlineconstexpr

Test if all of the values are set.

Returns
  true iff all of the values are set.

Definition at line 160 of file base_bitset_type.hpp.

## ◆ All() [2/2]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr bool BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::All | ( | const Timpl & | other | ) | const
| inlineconstexpr

Test if all of the values are set.

Parameters

  other | BitSet of values to test.

Returns
  true iff all of the values are set.

Definition at line 151 of file base_bitset_type.hpp.

Referenced by AddDateIntroducedRailTypes(), AddDateIntroducedRoadTypes(), AircraftController(), CmdAlterGroup(), HandleBankruptcyTakeover(), MakeCzechTownName(), and TryBuildTownHouse().

## ◆ Any() [1/2]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr bool BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Any | ( |  | ) | const
| inlineconstexpr

Test if any of the values are set.

Returns
  true iff any of the values are set.

Definition at line 179 of file base_bitset_type.hpp.

## ◆ Any() [2/2]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr bool BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Any | ( | const Timpl & | other | ) | const
| inlineconstexpr

Test if any of the given values are set.

Parameters

  other | BitSet of values to test.

Returns
  true iff any of the given values are set.

Definition at line 170 of file base_bitset_type.hpp.

Referenced by AdvanceHouseConstruction(), AgeVehicle(), AircraftController(), AirportFindFreeTerminal(), AirportHasBlock(), AirportSetBlocks(), CompanyStationsWindow::BuildStationsList(), BuildTownHouse(), CalcEngineReliability(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanEnterNewTile(), CanVehicleUseStation(), ChangeIndustryProduction(), CheckAutoreplaceValidity(), CheckClickOnVehicle(), CheckIfIndustryTilesAreFree(), ClearTownHouse(), CmdBuildObject(), CmdClearArea(), CmdInsertOrder(), CmdLandscapeClear(), CmdModifyOrder(), CmdTurnRoadVeh(), CMSAMine(), DistributeQueue(), NWidgetViewport::Draw(), NWidgetScrollbar::Draw(), IndustryViewWindow::DrawInfo(), StatusBarWindow::DrawWidget(), NetworkContentListWindow::FilterContentList(), FreeTerminal(), Train::GetAccelerationStatus(), GetCompanyRailTypes(), GetEngineCategoryName(), GetEngineLivery(), GetOrderCmdFromTile(), GetRailTypes(), HousePickerCallbacks::GetTypeName(), IndustriesScopeResolver::GetVariable(), HandleBankruptcyTakeover(), HandleScrollbarScrolling(), HasAnyRailTypesAvail(), HasAnyRoadTypesAvail(), RoadStop::HasFreeBay(), HasTileAnyRoadType(), CommandHelperBase::InternalExecutePrepTest(), CommandHelperBase::InternalExecuteProcessResult(), CommandHelperBase::InternalExecuteValidateTestAndPrepExec(), CommandHelperBase::InternalPostBefore(), IsCargoInClass(), IsEngineBuildable(), IsHouseSpecValid(), BaseStation::IsInUse(), IndustrySpec::IsRawIndustry(), Vehicle::LeaveUnbunchingDepot(), MakeCzechTownName(), MakeTownHouse(), Vehicle::NeedsServicing(), NetworkHandlePauseChange(), NetworkContentListWindow::OnClick(), NetworkContentListWindow::OnKeyPress(), OnTick_Companies(), ReadSprite(), RemoveNearbyStations(), StateGameLoop(), TileLoop_Town(), TriggerHouseAnimation_WatchedCargoAccepted(), TryBuildTownHouse(), NetworkContentListWindow::UpdateFilterState(), UpdateSignalsAroundSegment(), UpdateStationAcceptance(), IndustrySpec::UsesOriginalEconomy(), and VehicleTimetableSorter().

## ◆ base()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Tstorage BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base | ( |  | ) | const
| inlineconstexprnoexcept

Retrieve the raw value behind this bit set.

Returns
  the raw value.

Definition at line 219 of file base_bitset_type.hpp.

Referenced by AfterLoadGame(), AircraftVehicleChangeInfo(), CheckFlatLandRoadStop(), DrawTile_Road(), GetGlobalVariable(), VehicleScopeResolver::GetRandomTriggers(), HouseScopeResolver::GetRandomTriggers(), IndustryTileScopeResolver::GetRandomTriggers(), RoadStopScopeResolver::GetRandomTriggers(), StationScopeResolver::GetRandomTriggers(), GetRefitCostFactor(), AirportScopeResolver::GetVariable(), VehicleScopeResolver::GetVariable(), IndustriesScopeResolver::GetVariable(), RoadStopScopeResolver::GetVariable(), StationScopeResolver::GetVariable(), TownScopeResolver::GetVariable(), OrdersWindow::OnClick(), RailVehicleChangeInfo(), AIInfo::RegisterAPI(), GameInfo::RegisterAPI(), RoadVehicleChangeInfo(), Order::SetDepotActionType(), Order::SetDepotOrderType(), SetHouseRandomTriggers(), SetIndustryRandomTriggers(), Order::SetNonStopType(), ShipVehicleChangeInfo(), and BaseCompanyGraphWindow::UpdateStatistics().

## ◆ begin()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

auto BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::begin | ( |  | ) | const
| inline

Definition at line 257 of file base_bitset_type.hpp.

## ◆ Count()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

uint BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Count | ( |  | ) | const
| inline

Count the number of set bits.

Returns
  The number of bits set to true.

Definition at line 237 of file base_bitset_type.hpp.

References CountBits().

## ◆ end()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

auto BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::end | ( |  | ) | const
| inline

Definition at line 258 of file base_bitset_type.hpp.

## ◆ Flip() [1/2]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl & BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Flip | ( | const Timpl & | other | ) |
| inlineconstexpr

Flip values from another bitset.

Parameters

  other | Bitset of values to flip.

Returns
  The bit set

Definition at line 130 of file base_bitset_type.hpp.

## ◆ Flip() [2/2]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl & BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Flip | ( | Tvalue_type | value | ) |
| inlineconstexpr

Flip the value-th bit.

Parameters

  value | Bit to flip.

Returns
  The bit set

Definition at line 116 of file base_bitset_type.hpp.

Referenced by AirportSetBlocks(), CmdOpenCloseAirport(), CmdReverseTrainDirection(), CmdStartStopVehicle(), BaseConsist::CopyConsistPropertiesFrom(), DispatchLeftClickEvent(), MenuClickSettings(), ReplaceVehicleWindow::OnClick(), BuildVehicleWindow::OnClick(), GenerateLandscapeWindow::OnClick(), GraphLegendWindow::OnClick(), CompanyStationsWindow::OnClick(), FoundTownWindow::OnClick(), OrdersWindow::OrderClick_Nonstop(), ReverseTrainDirection(), and GUIList< T, P, F >::ToggleSortOrder().

## ◆ GetNthSetBit()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

std::optional< Tvalue_type > BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::GetNthSetBit | ( | uint | n | ) | const
| inline

Get the value of the Nth set bit.

Parameters

  n | The Nth set bit from which we want to know the value.

Returns
  The value of the Nth set bit, or std::nullopt if no Nth bit set.

Definition at line 247 of file base_bitset_type.hpp.

Referenced by GetEngineCategoryName(), and TownAuthorityWindow::OnClick().

## ◆ IsValid()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr bool BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::IsValid | ( |  | ) | const
| inlineconstexpr

Test that the raw value of this bit set is valid.

Returns
  true iff the no bits outside the masked value are set.

Definition at line 228 of file base_bitset_type.hpp.

Referenced by CmdIndustrySetFlags().

## ◆ None()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr bool BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::None | ( |  | ) | const
| inlineconstexpr

Test if none of the values are set.

Returns
  true iff none of the values are set.

Definition at line 188 of file base_bitset_type.hpp.

Referenced by Station::AddFacility(), TimetableWindow::BuildArrivalDepartureList(), CmdClearArea(), CmdExpandTown(), IsEngineBuildable(), NetworkHandlePauseChange(), StationViewWindow::OnPaint(), ReadSprite(), LinkGraphOverlay::RebuildCache(), StateGameLoop_LinkGraphPauseControl(), and NetworkContentListWindow::TypeOrSelectedFilter().

## ◆ operator&()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::operator& | ( | const Timpl & | other | ) | const
| inlineconstexpr

Definition at line 210 of file base_bitset_type.hpp.

## ◆ operator&=()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl & BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::operator&= | ( | const Timpl & | other | ) |
| inlineconstexpr

Definition at line 204 of file base_bitset_type.hpp.

## ◆ operator|()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::operator| | ( | const Timpl & | other | ) | const
| inlineconstexpr

Definition at line 199 of file base_bitset_type.hpp.

## ◆ operator|=()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl & BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::operator|= | ( | const Timpl & | other | ) |
| inlineconstexpr

Definition at line 193 of file base_bitset_type.hpp.

## ◆ Reset() [1/3]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl & BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset | ( |  | ) |
| inlineconstexpr

Reset all bits.

Returns
  The bit set

Definition at line 83 of file base_bitset_type.hpp.

Referenced by AddArticulatedParts(), AdvanceWagonsAfterSwap(), AfterLoadGame(), AircraftLeaveHangar(), RoadStop::AllocateDriveThroughBay(), CheckIfCanLevelIndustryPlatform(), CheckShipStayInDepot(), CheckTrainStayInDepot(), RoadStop::ClearDriveThrough(), ClearTownHouse(), CmdAutofillTimetable(), CmdAutoreplaceVehicle(), CmdBuildObject(), CmdBuildObjectArea(), CmdClearArea(), CmdInsertOrder(), CmdLevelLand(), CmdModifyOrder(), CmdOrderRefit(), CmdPause(), CmdRemoveLongRoad(), CmdSignalTrackHelper(), CmdTerraformLand(), CmdTownGrowthRate(), Window::DisableAllWidgetHighlight(), DisableEngineForCompany(), DisasterTick_Zeppeliner(), DispatchLeftClickEvent(), CommandHelper< Tcmd, Tret(*)(DoCommandFlags, Targs...), true >::Do(), DoCreateTown(), DrawRailCatenaryRailway(), DropdownWindow::DropdownWindow(), Order::Equals(), FixupTrainLengths(), GetRailTypeDropDownList(), GRFConfig::GRFConfig(), GUIEngineListAddChildren(), HandleAircraftSmoke(), HandleCrashedAircraft(), HandleWindowDragging(), HasAnyRailTypesAvail(), HasAnyRoadTypesAvail(), HasRoadTypeAvail(), ENGNChunkHandler::Load(), LoadUnloadVehicle(), RoadStop::MakeDriveThrough(), NewVehicleAvailable(), Window::OnDropdownClose(), DropdownWindow::OnFocusLost(), ParamSet(), Vehicle::PreDestructor(), PrepareUnload(), GUIList< T, P, F >::RebuildDone(), LinkRefresher::RefreshLinks(), RemoveAirport(), RemoveBuoy(), RemoveDock(), RemoveFromRailBaseStation(), RemoveRoadStop(), RemoveRoadWaypointStop(), ReverseTrainDirection(), NWidgetCore::SetDisabled(), GUIList< T, P, F >::SetFiltering(), GUIList< T, P, F >::SetFilterState(), SetGroupFlag(), NWidgetCore::SetHighlighted(), GUIList< T, P, F >::SetListing(), NWidgetCore::SetLowered(), Window::SetWidgetHighlight(), GUIList< T, P, F >::Sort(), StartWindowDrag(), StartWindowSizing(), TrainCheckIfLineEnds(), TriggerRoadStopRandomisation(), TriggerStationRandomisation(), TryPathReserve(), SettingEntry::UpdateFilterState(), UpdateStationRating(), UpdateTownGrowth(), UpdateVehicleTimetable(), VehicleEnter_Track(), and VehicleEnterDepot().

## ◆ Reset() [2/3]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl & BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset | ( | const Timpl & | other | ) |
| inlineconstexpr

Reset values from another bitset.

Parameters

  other | Bitset of values to reset.

Returns
  The bit set

Definition at line 105 of file base_bitset_type.hpp.

## ◆ Reset() [3/3]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl & BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset | ( | Tvalue_type | value | ) |
| inlineconstexpr

Reset the value-th bit.

Parameters

  value | Bit to reset.

Returns
  The bit set

Definition at line 94 of file base_bitset_type.hpp.

## ◆ Set() [1/4]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl & BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set | ( |  | ) |
| inlineconstexpr

Set all bits.

Returns
  The bit set

Definition at line 40 of file base_bitset_type.hpp.

Referenced by AcceptEnginePreview(), AddDateIntroducedRailTypes(), AddDateIntroducedRoadTypes(), Station::AddFacility(), ScriptInfo::AddSetting(), AfterLoad_LinkGraphPauseControl(), AfterLoadGame(), AfterLoadVehiclesPhase2(), AirportHasBlock(), AirportSetBlocks(), AllocateRoadType(), AppendCopyableBadgeList(), ApplyBadgeFeaturesToClassBadges(), Window::ApplyDefaults(), CalculateRoadStopCost(), ChangeTownRating(), CheckTrainStayInDepot(), RoadStop::ClearDriveThrough(), DropdownWindow::Close(), NetworkContentDownloadStatusWindow::Close(), CmdAutofillTimetable(), CmdBuildAircraft(), CmdBuildBuoy(), CmdBuildRailStation(), CmdBuildRailVehicle(), CmdBuildRailWagon(), CmdBuildRailWaypoint(), CmdBuildRoadStop(), CmdBuildRoadWaypoint(), CmdBuildVehicle(), CmdClearArea(), CmdCloneVehicle(), CmdCreateGroup(), CmdIndustrySetProduction(), CmdModifyOrder(), CmdMoveVehicle(), CmdPause(), CmdSetGroupLivery(), CmdSetVehicleVisibility(), CmdTerraformLand(), CmdTownGrowthRate(), CommandFlagsToDCFlags(), CompanyCheckBankrupt(), Train::ConsistChanged(), Order::ConvertFromOldSavegame(), BaseConsist::CopyConsistPropertiesFrom(), Vehicle::Crash(), DisasterVehicle::DisasterVehicle(), EnableEngineForCompany(), EnumBitSet< Tenum, Tstorage, Tend_value >::EnumBitSet(), ErrorUnknownCallbackResult(), FinaliseBadges(), FinalisePriceBaseMultipliers(), FixTTOEngines(), GUIList< T, P, F >::ForceRebuild(), GUIList< T, P, F >::ForceResort(), RoadStop::FreeBay(), FreeTerminal(), GetAllCompatibleRailTypes(), GetAllIntroducesRailTypes(), GetAllPoweredRailTypes(), TownAuthorityWindow::GetEnabledActions(), GetGlobalVariable(), SmallMapWindow::GetOverlayCompanyMask(), GetPresentRoadTypes(), GRFUnsafe(), HandleAircraftEnterHangar(), HandleBankruptcyTakeover(), Window::InitializeData(), InitializeNetworkPools(), InitRailTypes(), InitRoadTypes(), CommandHelperBase::InternalExecuteProcessResult(), InvalidateCompanyWindows(), ENGNChunkHandler::Load(), LoadUnloadVehicle(), MakeCzechTownName(), RoadStop::MakeDriveThrough(), MarkBadgeSeen(), MarkTrainAsStuck(), MoveBuoysToWaypoints(), MoveWaypointsToBaseStations(), GUIList< T, P, F >::NeedResort(), NetworkAutoCleanCompanies(), NewsItem::NewsItem(), NewVehicleAvailable(), CompanyStationsWindow::OnClick(), NetworkContentDownloadStatusWindow::OnDownloadProgress(), GraphLegendWindow::OnInvalidateData(), ParamSet(), LinkRefresher::PredictNextOrder(), RailTypeChangeInfo(), GUIList< T, P, F >::RebuildDone(), LinkRefresher::RefreshLinks(), ReplaceChain(), ReverseTrainSwapVeh(), RoadStopUpdateCachedTriggers(), RoadTypeChangeInfo(), ScrollbarClickPositioning(), SettingEntry::SetButtons(), NWidgetCore::SetDisabled(), RoadStop::SetEntranceBusy(), GUIList< T, P, F >::SetFiltering(), GUIList< T, P, F >::SetFilterState(), SetGroupFlag(), NWidgetCore::SetHighlighted(), BaseSettingEntry::SetLastField(), GUIList< T, P, F >::SetListing(), NWidgetCore::SetLowered(), GUIList< T, P, F >::SetSortType(), Window::SetTimeout(), Window::SetWhiteBorder(), Window::SetWidgetHighlight(), ShowDropDownList(), ShowNewGrfVehicleError(), SlStdString(), StartupOneEngine(), StartWindowDrag(), StartWindowSizing(), StationUpdateCachedTriggers(), TileLoop_Town(), TownActionBuildStatue(), TownTickHandler(), TrainApproachingLineEnd(), TrainCheckIfLineEnds(), TriggerRoadStopRandomisation(), TriggerStationRandomisation(), TryBuildTownHouse(), SettingEntry::UpdateFilterState(), SettingsPage::UpdateFilterState(), LinkGraphLegendWindow::UpdateOverlayCompanies(), UpdateStationAcceptance(), BaseCompanyGraphWindow::UpdateStatistics(), UpdateTownGrowth(), UpdateVehicleTimetable(), VehicleEnter_Track(), VehicleEnterDepot(), VehicleEnteredDepotThisTick(), ViewportAddSignStrings(), ViewportAddStationStrings(), ViewportAddTownStrings(), and WaypointWindow::WaypointWindow().

## ◆ Set() [2/4]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl & BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set | ( | const Timpl & | other | ) |
| inlineconstexpr

Set values from another bitset.

Parameters

  other | Bitset of values to set.

Returns
  The bit set

Definition at line 62 of file base_bitset_type.hpp.

## ◆ Set() [3/4]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl & BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set | ( | Tvalue_type | value | ) |
| inlineconstexpr

Set the value-th bit.

Parameters

  value | Bit to set.

Returns
  The bit set

Definition at line 51 of file base_bitset_type.hpp.

## ◆ Set() [4/4]

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Timpl & BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set | ( | Tvalue_type | value,
|  | bool | set
| ) |  |
| inlineconstexpr

Assign the value-th bit.

Parameters

  value | Bit to assign to.
  set | true if the bit should be set, false if the bit should be reset.

Returns
  The EnumBitset

Definition at line 74 of file base_bitset_type.hpp.

## ◆ Test()

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr bool BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test | ( | Tvalue_type | value | ) | const
| inlineconstexpr

Test if the value-th bit is set.

Parameters

  value | Bit to check.

Returns
  true iff the requested bit is set.

Definition at line 141 of file base_bitset_type.hpp.

Referenced by AddAcceptedCargoOfHouse(), AddArticulatedParts(), AddBadgeClassesToConfiguration(), LinkGraph::BaseNode::AddEdge(), AddEngineReplacement(), NewGRFWindow::AddGRFToActive(), LinkGraph::AddNode(), ScriptInfo::AddSetting(), AfterLoadGame(), AircraftController(), AircraftEventHandler_InHangar(), AircraftVehicleChangeInfo(), AirportMaintenanceCost(), AnimateNewObjectTile(), AppendCopyableBadgeList(), NWidgetHorizontal::AssignSizePosition(), NWidgetVertical::AssignSizePosition(), TimetableWindow::BuildArrivalDepartureList(), BuildObject(), RefitWindow::BuildRefitList(), BuildReplacementVehicle(), BuildStationPart(), BuildTownHouse(), CalcEngineReliability(), CalcPercentVehicleFilled(), CanDetermineTimeTaken(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanEnterNewTile(), CanVehicleUseStation(), CargoSpecClassSorter(), CcRoadStop(), CcStartStopVehicle(), ChangeIndustryProduction(), ChangeTownRating(), ChangeTrainDirRandomly(), IntSettingDesc::ChangeValue(), ChangeVehicleNews(), CheckAutoreplaceValidity(), CheckBridgeAvailability(), CheckBuildableTile(), CheckFlatLandRailStation(), CheckforTownRating(), CheckIfAuthorityAllowsNewStation(), CheckIfCanLevelIndustryPlatform(), CheckIfIndustryTilesAreFree(), CheckIfIndustryTileSlopes(), CheckIndustryCloseDownProtection(), RoadStop::Entry::CheckIntegrity(), CheckMinActiveClients(), CheckOrders(), CheckPauseHelper(), CheckPauseOnJoin(), CheckSoftLimit(), CheckSubsidised(), PoolBase::Clean(), RoadStop::ClearDriveThrough(), ClearTile_Station(), ClearTile_Town(), ClearTile_TunnelBridge(), ClearTownHouse(), DropdownWindow::Close(), CloseAllNonVitalWindows(), CloseConstructionWindows(), CloseNonVitalWindows(), CloseWindowById(), CmdAddSharedVehicleGroup(), CmdAddVehicleGroup(), CmdAlterGroup(), CmdAutofillTimetable(), CmdAutoreplaceVehicle(), CmdBuildAircraft(), CmdBuildAirport(), CmdBuildBridge(), CmdBuildBuoy(), CmdBuildCanal(), CmdBuildDock(), CmdBuildIndustry(), CmdBuildObject(), CmdBuildObjectArea(), CmdBuildRailStation(), CmdBuildRailVehicle(), CmdBuildRailWagon(), CmdBuildRailWaypoint(), CmdBuildRoad(), CmdBuildRoadDepot(), CmdBuildRoadStop(), CmdBuildRoadVehicle(), CmdBuildRoadWaypoint(), CmdBuildShip(), CmdBuildShipDepot(), CmdBuildSingleRail(), CmdBuildSingleSignal(), CmdBuildTrainDepot(), CmdBuildTunnel(), CmdBuildVehicle(), CmdBulkChangeTimetable(), CmdBuyCompany(), CmdChangeBankBalance(), CmdChangeCompanySetting(), CmdChangeServiceInt(), CmdChangeSetting(), CmdChangeTimetable(), CmdClearArea(), CmdClearOrderBackup(), CmdCloneOrder(), CmdCloneVehicle(), CmdCompanyAllowListCtrl(), CmdCompanyCtrl(), CmdConvertRail(), CmdConvertRoad(), CmdCreateGoal(), CmdCreateGroup(), CmdCreateLeagueTable(), CmdCreateLeagueTableElement(), CmdCreateStoryPage(), CmdCreateStoryPageElement(), CmdCreateSubsidy(), CmdCustomNewsItem(), CmdDecreaseLoan(), CmdDeleteGroup(), CmdDeleteOrder(), CmdDeleteTown(), CmdDoTownAction(), CmdEngineCtrl(), CmdExpandTown(), CmdForceTrainProceed(), CmdFoundTown(), CmdGiveMoney(), CmdGoalQuestion(), CmdGoalQuestionAnswer(), CmdIncreaseLoan(), CmdIndustrySetExclusivity(), CmdIndustrySetFlags(), CmdIndustrySetProduction(), CmdIndustrySetText(), CmdInsertOrder(), CmdLandscapeClear(), CmdLevelLand(), CmdModifyOrder(), CmdMoveOrder(), CmdMoveRailVehicle(), CmdMoveSign(), CmdMoveStationName(), CmdMoveWaypointName(), CmdOpenCloseAirport(), CmdOrderRefit(), CmdPause(), CmdPlaceHouse(), CmdPlaceSign(), CmdPlantTree(), CmdRefitVehicle(), CmdRemoveAllVehiclesGroup(), CmdRemoveGoal(), CmdRemoveLeagueTableElement(), CmdRemoveLongRoad(), CmdRemoveRoadStop(), CmdRemoveSingleRail(), CmdRemoveSingleSignal(), CmdRemoveStoryPage(), CmdRemoveStoryPageElement(), CmdRenameCompany(), CmdRenameDepot(), CmdRenameEngine(), CmdRenamePresident(), CmdRenameSign(), CmdRenameStation(), CmdRenameTown(), CmdRenameVehicle(), CmdRenameWaypoint(), CmdReverseTrainDirection(), CmdScrollViewport(), CmdSellRailWagon(), CmdSellVehicle(), CmdSendVehicleToDepot(), CmdSetAutoReplace(), CmdSetCompanyColour(), CmdSetCompanyManagerFace(), CmdSetCompanyMaxLoan(), CmdSetGoalCompleted(), CmdSetGoalDestination(), CmdSetGoalProgress(), CmdSetGoalText(), CmdSetGroupFlag(), CmdSetGroupLivery(), CmdSetStoryPageDate(), CmdSetStoryPageTitle(), CmdSetTimetableStart(), CmdSetVehicleOnTime(), CmdSetVehicleVisibility(), CmdShowStoryPage(), CmdSkipToOrder(), CmdStartStopVehicle(), CmdStoryPageButton(), CmdTerraformLand(), CmdTownCargoGoal(), CmdTownGrowthRate(), CmdTownRating(), CmdTownSetText(), CmdTurnRoadVeh(), CmdUpdateLeagueTableElementData(), CmdUpdateLeagueTableElementScore(), CmdUpdateStoryPageElement(), CmdWantEnginePreview(), CMSAMine(), CommandFlagsToDCFlags(), Train::ConsistChanged(), GoodsEntry::ConvertState(), BaseConsist::CopyConsistPropertiesFrom(), CopyHeadSpecificThings(), Vehicle::Crash(), Train::Crash(), NetworkAuthenticationServerHandler::Create(), CreateNewIndustryHelper(), DecloneOrder(), DecodeSingleSprite(), DeleteLastWagon(), Engine::DetermineCapacity(), DetermineNextTrainForceProceeding(), Disaster_CoalMine_Init(), Disaster_Helicopter_Init(), DisasterTick_Ufo(), DispatchLeftClickEvent(), DispatchRightClickEvent(), CommandHelper< Tcmd, Tret(*)(DoCommandFlags, Targs...), true >::Do(), DoBuildLock(), DoClearBridge(), DoClearTunnel(), DoCreateNewIndustry(), DoDrawVehicle(), TarScanner::DoScan(), NWidgetViewport::Draw(), NWidgetScrollbar::Draw(), NWidgetLeaf::Draw(), BaseSettingEntry::Draw(), SettingsPage::Draw(), TownAuthorityWindow::DrawActions(), DrawAircraftImage(), TimetableWindow::DrawArrivalDeparturePanel(), DrawBadgeNameList(), DrawCustomStationFoundations(), DrawEngineList(), DrawFrameRect(), DrawHouseInGUI(), IndustryViewWindow::DrawInfo(), DrawNewHouseTileInGUI(), DrawNewObjectTileInGUI(), DrawOrderString(), TownAuthorityWindow::DrawRatings(), DrawRoadDepotSprite(), DrawRoadStopTile(), DrawRoadVehImage(), SettingEntry::DrawSetting(), DrawStationTile(), TimetableWindow::DrawSummaryPanel(), DrawTile_Road(), DrawTileLayout(), DrawTrainDetails(), DrawTrainImage(), DepotWindow::DrawVehicleInDepot(), BaseVehicleListWindow::DrawVehicleListItems(), GSConfigWindow::DrawWidget(), GraphLegendWindow::DrawWidget(), VehicleGroupWindow::DrawWidget(), BuildIndustryWindow::DrawWidget(), BuildObjectWindow::DrawWidget(), ScriptSettingsWindow::DrawWidget(), StatusBarWindow::DrawWidget(), TownViewWindow::DrawWidget(), TownDirectoryWindow::DrawWidget(), VehicleViewWindow::DrawWidget(), Window::DrawWidgets(), Order::Equals(), ErrorUnknownCallbackResult(), FillGRFDetails(), GUIList< T, P, F >::Filter(), FinalisePriceBaseMultipliers(), FindClosestTrainDepot(), FindNearestHangar(), FixTTOEngines(), FloodVehicleProc(), ReplaceVehicleWindow::GenerateReplaceRailList(), RoadVehicle::GetAccelerationStatus(), Train::GetAccelerationStatus(), Train::GetAirDragArea(), GetAllCargoSuffixes(), GetArticulatedRefitMasks(), GetBadgeSprite(), GetBestFittingSubType(), GetBridgeTilePillarFlags(), GetCapacityOfArticulatedParts(), GetCargoSubtypeText(), GetCargoSuffix(), GetCargoSuffix(), GetCargoTypesOfArticulatedParts(), GetCompanyRailTypes(), GetCompanyRoadTypes(), Train::GetDisplayImageWidth(), NWidgetBadgeFilter::GetDropDownList(), GetEngineLiveryScheme(), GUIList< T, P, F >::GetFiltering(), GetFoundation_Town(), GetGlobalVariable(), BuildHouseWindow::GetHouseInformation(), GetIfStopIsForType(), Train::GetImage(), GetIndustryGamePlayProbability(), GetIndustryProbabilityCallback(), GUIList< T, P, F >::GetListing(), GetLoadAmount(), GetMaskOfTownActions(), Train::GetMaxWeight(), OrderList::GetNextDecisionNode(), Train::GetOrderStationLocation(), NewGRFWindow::GetPalette(), Train::GetPoweredPartPower(), GetPreviewCompany(), GetProducedCargoOfHouse(), GetRailTypeDropDownList(), GetRailTypes(), GetRoadTypes(), GetScaledIndustryGenerationProbability(), GetSettingsDesc(), GetTownRoadType(), GetTownRoadTypeFirstIntroductionDate(), SettingDesc::GetType(), HousePickerCallbacks::GetTypeName(), IntSettingDesc::GetValueParams(), IndustriesScopeResolver::GetVariable(), GetVehicleCannotUseStationReason(), RoadVehicle::GetVehicleTrackdir(), Ship::GetVehicleTrackdir(), Train::GetVehicleTrackdir(), Train::GetWeight(), SelectCompanyLiveryWindow::GetWidgetString(), GenerateLandscapeWindow::GetWidgetString(), OrdersWindow::GetWidgetString(), HandleAircraftSmoke(), HandleAutoscroll(), HandleBankruptcyTakeover(), HandleCrashedTrain(), HandleScrollbarScrolling(), HandleWindowDragging(), HasGrfMiscBit(), HasPowerOnRail(), HasPowerOnRail(), HasPowerOnRoad(), HasRailCatenary(), HasRailTypeAvail(), GoodsEntry::HasRating(), HasRoadCatenary(), HasRoadTypeAvail(), Vehicle::HasUnbunchingOrder(), HeightMapCoastLines(), HeightMapSmoothCoasts(), IConsoleGetSetting(), IndustryProductionCallback(), IndustryTemporarilyRefusesCargo(), IniSaveSettings(), InitRailTypes(), InitRoadTypes(), CommandHelperBase::InternalDoAfter(), CommandHelperBase::InternalExecutePrepTest(), CommandHelperBase::InternalExecuteProcessResult(), CommandHelperBase::InternalExecuteValidateTestAndPrepExec(), CommandHelperBase::InternalPostBefore(), IsArticulatedEngine(), IsArticulatedVehicleRefittable(), IsCompatibleRail(), IsCompatibleRail(), GUIList< T, P, F >::IsDescSortOrder(), NWidgetCore::IsDisabled(), SettingDesc::IsEditable(), Engine::IsEnabled(), IsEngineBuildable(), IsEngineRefittable(), RoadStop::IsEntranceBusy(), ObjectSpec::IsEverAvailable(), SpecializedStation< T, Tis_waypoint >::IsExpected(), BaseSettingEntry::IsFiltered(), GUIList< T, P, F >::IsFilterEnabled(), RoadStop::IsFreeBay(), IsGoodGRFConfigList(), Engine::IsHidden(), NWidgetCore::IsHighlighted(), Aircraft::IsInDepot(), IsLoggableGrfConfig(), NWidgetCore::IsLowered(), IndustrySpec::IsProcessingIndustry(), IsRoadStopAvailable(), Waypoint::IsSingleTile(), IsStationAvailable(), Vehicle::IsStoppedInDepot(), IsTileForestIndustry(), LoadNewGRFFile(), LoadSettings(), LoadUnloadVehicle(), MakeCzechTownName(), IntSettingDesc::MakeValueValid(), MapAircraftMovementState(), MarkTrainAsStuck(), MaybeBringWindowToFront(), MaybeCrashAirplane(), GUIList< T, P, F >::NeedRebuild(), NetworkHandlePauseChange(), NewVehicleAvailable(), ReplaceVehicleWindow::OnClick(), BuildVehicleWindow::OnClick(), GSConfigWindow::OnClick(), GenerateLandscapeWindow::OnClick(), CreateScenarioWindow::OnClick(), VehicleGroupWindow::OnClick(), NetworkStartServerWindow::OnClick(), NewGRFWindow::OnClick(), BuildRoadStationWindow::OnClick(), ScriptSettingsWindow::OnClick(), ScriptDebugWindow::OnClick(), TimetableWindow::OnClick(), TownAuthorityWindow::OnClick(), GameOptionsWindow::OnDropdownSelect(), GenerateLandscapeWindow::OnInvalidateData(), NewGRFWindow::OnInvalidateData(), BuildObjectWindow::OnInvalidateData(), PickerWindow::OnInvalidateData(), ScriptDebugWindow::OnInvalidateData(), TownAuthorityWindow::OnInvalidateData(), BuildHouseWindow::OnInvalidateData(), DropdownWindow::OnMouseLoop(), VehicleGroupWindow::OnPaint(), StationViewWindow::OnPaint(), TimetableWindow::OnPaint(), TownAuthorityWindow::OnPaint(), CheatWindow::OnQueryTextFinished(), GameOptionsWindow::OnQueryTextFinished(), SelectGameWindow::OnResize(), GameOptionsWindow::OnResize(), OrdersWindow::OrderClick_Service(), ParamSet(), PlayVehicleSound(), Vehicle::PreDestructor(), LinkRefresher::PredictNextOrder(), PrepareUnload(), PreviousOrderIsUnbunching(), Window::ProcessHighlightedInvalidations(), ProcessOrders(), PropagateChildLivery(), Rail90DegTurnDisallowed(), RailNoLevelCrossings(), RailVehicleChangeInfo(), RoadStop::Entry::Rebuild(), ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(), NetworkGameSocketHandler::ReceiveCommand(), RefitVehicle(), LinkRefresher::RefreshLinks(), RelocateAllWindows(), RemoveAirport(), RemoveBuoy(), RemoveDock(), RemoveEngineReplacement(), RemoveFromRailBaseStation(), RemoveGenericRoadStop(), RemoveLock(), RemoveOrderFromAllVehicles(), RemoveRailStation(), RemoveRoad(), RemoveRoadStop(), RemoveRoadWaypointStop(), ReplaceChain(), ReplaceFreeUnit(), ScriptConfig::ResetEditableSettings(), ResetSettings(), StationResolverObject::ResolveReal(), ReverseTrainDirection(), ReverseTrainSwapVeh(), RoadNoLevelCrossing(), RoadVehicleChangeInfo(), SendAllVehiclesToDepot(), Vehicle::SendToDepot(), SettingEntry::SetButtons(), SetMouseCursorVehicle(), LinkGraphLegendWindow::SetOverlay(), SetSettingValue(), SetSettingValue(), NWidgetHorizontal::SetupSmallestSize(), NWidgetVertical::SetupSmallestSize(), SetYearEngineAgingStops(), ShipVehicleChangeInfo(), Order::ShouldStopAtStation(), ShowMissingContentWindow(), ShowNewGrfVehicleError(), ShowQueryString(), Vehicle::ShowVisualEffect(), GUIList< T, P, F >::Sort(), StartupOneEngine(), StateGameLoop_LinkGraphPauseControl(), StationHandleBigTick(), VehicleOrderSaver::SwitchToNextOrder(), TestAutoslopeOnRailTile(), Aircraft::Tick(), RoadVehicle::Tick(), Ship::Tick(), Train::Tick(), TileLoop_Town(), ToolbarOptionsClick(), TownActionAdvertiseLarge(), TownActionAdvertiseMedium(), TownActionAdvertiseSmall(), TownActionBribe(), TownActionBuildStatue(), TownActionBuyRights(), TownActionFundBuildings(), TownActionRoadRebuild(), TownAllowedToBuildRoads(), TownCanGrowRoad(), TownLayoutAllows2x2HouseHere(), TownLayoutAllowsHouseHere(), TownDirectoryWindow::TownRatingSorter(), TownTickHandler(), TrainApproachingCrossingEnum(), TrainApproachingCrossingTile(), TrainController(), TrainCrashed(), TriggerHouseAnimation_TileLoop(), TriggerIndustryProduction(), TryBuildTownHouse(), TryPathReserve(), NetworkContentListWindow::TypeOrSelectedFilter(), LinkGraph::BaseEdge::Update(), UpdateAircraftSpeed(), UpdateAirplanesOnNewStation(), UpdateCompanyGroupLiveries(), Train::UpdateDeltaXY(), UpdateHousesAndTowns(), UpdateObjectColours(), UpdateOrderDest(), UpdateSignalsAroundSegment(), UpdateSignalsInBuffer(), UpdateStationRating(), UpdateTownGrowth(), UpdateTownGrowthRate(), UpdateVehicleTimetable(), Station::UpdateVirtCoord(), Vehicle::UpdateVisualEffect(), UsedBadgeClasses::UsedBadgeClasses(), VehicleEnterDepot(), VehicleEnteredDepotThisTick(), VehicleLengthChanged(), StringData::Version(), ViewportAddString(), and ViewportAddVehicles().

## Field Documentation

## ◆ data

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

Tstorage BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::data
| private

Bitmask of values.

Definition at line 261 of file base_bitset_type.hpp.

## ◆ MASK

template<typename Timpl , typename Tvalue_type , typename Tstorage , Tstorage Tmask = std::numeric_limits<Tstorage>::max()>

constexpr Tstorage BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::MASK = Tmask
| staticconstexpr

Mask of valid values.

Definition at line 29 of file base_bitset_type.hpp.

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

- src/core/base_bitset_type.hpp