OpenTTD Source 20250518-master-g1b0fd0e6fd
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 >:
EnumBitSet< AirportBlock, uint64_t > EnumBitSet< Flag, uint8_t > EnumBitSet< AirportMovingDataFlag, uint16_t > EnumBitSet< AirportTileCallbackMask, uint8_t > EnumBitSet< BadgeFlag, uint8_t > EnumBitSet< GrfSpecFeature, uint32_t, GrfSpecFeature::GSF_END > EnumBitSet< VehicleFlag, uint16_t > EnumBitSet< SettingEntryFlag, uint8_t > EnumBitSet< StationFacility, uint8_t > EnumBitSet< StationRandomTrigger, uint8_t > EnumBitSet< StationAnimationTrigger, uint16_t > EnumBitSet< SortListFlag, uint8_t > EnumBitSet< RailType, uint64_t > EnumBitSet< EndSegmentReason, uint16_t > EnumBitSet< CanalCallbackMask, uint8_t > EnumBitSet< CargoClass, uint16_t > EnumBitSet< CargoCallbackMask, uint8_t > EnumBitSet< CmdFlag, uint8_t > EnumBitSet< CommandFlag, uint16_t > EnumBitSet< RoadType, uint64_t > EnumBitSet< ContentType, uint16_t, CONTENT_TYPE_END > EnumBitSet< CzechChooseFlag, uint8_t > EnumBitSet< CzechAllowFlag, uint8_t > EnumBitSet< EngineFlag, uint8_t > EnumBitSet< EngineDisplayFlag, uint8_t > EnumBitSet< LandscapeType, uint8_t > EnumBitSet< EngineMiscFlag, uint8_t > EnumBitSet< VehicleCallbackMask, uint16_t > EnumBitSet< ExtraEngineFlag, uint8_t > EnumBitSet< GRFConfigFlag, uint8_t > EnumBitSet< GRFBug, uint8_t > EnumBitSet< BorderFlag, uint8_t > EnumBitSet< State, uint8_t > EnumBitSet< GroupFlag, uint8_t > EnumBitSet< HouseZone, uint16_t > EnumBitSet< BuildingFlag, uint8_t > EnumBitSet< HouseCallbackMask, uint16_t > EnumBitSet< HouseExtraFlag, uint8_t > EnumBitSet< IndustryControlFlag, uint8_t, IndustryControlFlag::End > EnumBitSet< PartOfSubsidy, uint8_t > EnumBitSet< IndustryLifeType, uint8_t > EnumBitSet< IndustryBehaviour, uint32_t > EnumBitSet< IndustryCallbackMask, uint16_t > EnumBitSet< IndustryTileCallbackMask, uint8_t > EnumBitSet< IndustryTileSpecialFlag, uint8_t > EnumBitSet< AspectFlag, uint8_t > EnumBitSet< NWidgetDisplayFlag, uint16_t > EnumBitSet< NWidContainerFlag, uint8_t > EnumBitSet< NewsFlag, uint8_t > EnumBitSet< ObjectFlag, uint16_t > EnumBitSet< ObjectCallbackMask, uint8_t > EnumBitSet< QueryStringFlag, uint8_t > EnumBitSet< RailTypeFlag, uint8_t > EnumBitSet< RoadStopStatusFlag, uint8_t > EnumBitSet< RoadStopDrawMode, uint8_t > EnumBitSet< RoadStopCallbackMask, uint8_t > EnumBitSet< RoadStopSpecFlag, uint8_t > EnumBitSet< RoadTypeFlag, uint8_t > EnumBitSet< ScriptConfigFlag, uint8_t > EnumBitSet< SettingFlag, uint16_t > EnumBitSet< SpriteComponent, uint8_t, SpriteComponent::End > EnumBitSet< StationCallbackMask, uint16_t > EnumBitSet< StationSpecFlag, uint8_t > EnumBitSet< ViewportStringFlag, uint8_t > EnumBitSet< TownAction, uint8_t > EnumBitSet< VehicleRandomTrigger, uint8_t > EnumBitSet< VehState, uint8_t > EnumBitSet< WindowFlag, uint16_t > EnumBitSet< Tenum, Tstorage, Tend_value >

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_typeType of values to wrap.
TstorageStorage 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
otherBitSet 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 AircraftController(), HandleBankruptcyTakeover(), 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
otherBitSet 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(), CanVehicleUseStation(), ChangeIndustryProduction(), CheckAutoreplaceValidity(), CheckClickOnVehicle(), CheckIfIndustryTilesAreFree(), ClearTownHouse(), CmdBuildObject(), CmdClearArea(), CmdLandscapeClear(), CmdTurnRoadVeh(), CMSAMine(), DistributeQueue(), NWidgetViewport::Draw(), NWidgetScrollbar::Draw(), IndustryViewWindow::DrawInfo(), StatusBarWindow::DrawWidget(), NetworkContentListWindow::FilterContentList(), FreeTerminal(), GetOrderCmdFromTile(), 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(), NetworkContentListWindow::UpdateFilterState(), UpdateSignalsAroundSegment(), UpdateStationAcceptance(), and IndustrySpec::UsesOriginalEconomy().

◆ base()

◆ 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
otherBitset 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

◆ 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
nThe 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 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 CmdClearArea(), IsEngineBuildable(), NetworkHandlePauseChange(), 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(), CheckTrainStayInDepot(), RoadStop::ClearDriveThrough(), CmdAutofillTimetable(), CmdAutoreplaceVehicle(), CmdBuildObject(), CmdBuildObjectArea(), CmdClearArea(), CmdLevelLand(), CmdPause(), CmdRemoveLongRoad(), CmdSignalTrackHelper(), CmdTerraformLand(), Window::DisableAllWidgetHighlight(), DisableEngineForCompany(), DisasterTick_Zeppeliner(), DispatchLeftClickEvent(), CommandHelper< Tcmd, Tret(*)(DoCommandFlags, Targs...), true >::Do(), DrawRailCatenaryRailway(), DropdownWindow::DropdownWindow(), FixupTrainLengths(), GetRailTypeDropDownList(), GRFConfig::GRFConfig(), GUIEngineListAddChildren(), HandleAircraftSmoke(), HandleCrashedAircraft(), HandleWindowDragging(), HasAnyRailTypesAvail(), HasAnyRoadTypesAvail(), HasRoadTypeAvail(), ENGNChunkHandler::Load(), LoadUnloadVehicle(), RoadStop::MakeDriveThrough(), NewVehicleAvailable(), Window::OnDropdownClose(), ParamSet(), Vehicle::PreDestructor(), PrepareUnload(), GUIList< T, P, F >::RebuildDone(), LinkRefresher::RefreshLinks(), RemoveAirport(), RemoveBuoy(), RemoveDock(), RemoveFromRailBaseStation(), RemoveRoadStop(), RemoveRoadWaypointStop(), 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(), SettingEntry::UpdateFilterState(), UpdateVehicleTimetable(), and VehicleEnter_Track().

◆ 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
otherBitset 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
valueBit 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(), CmdBuildRailWaypoint(), CmdBuildRoadStop(), CmdBuildRoadVehicle(), CmdBuildRoadWaypoint(), CmdBuildShip(), CmdBuildVehicle(), CmdClearArea(), CmdCloneVehicle(), CmdCreateGroup(), CmdIndustrySetProduction(), CmdMoveVehicle(), CmdPause(), CmdSetVehicleVisibility(), CmdTerraformLand(), CommandFlagsToDCFlags(), CompanyCheckBankrupt(), Train::ConsistChanged(), 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(), TownAuthorityWindow::GetEnabledActions(), GetGlobalVariable(), SmallMapWindow::GetOverlayCompanyMask(), GetPresentRoadTypes(), GRFUnsafe(), HandleAircraftEnterHangar(), HandleBankruptcyTakeover(), Window::InitializeData(), InitializeNetworkPools(), InitRailTypes(), InitRoadTypes(), CommandHelperBase::InternalExecuteProcessResult(), InvalidateCompanyWindows(), ENGNChunkHandler::Load(), LoadUnloadVehicle(), MakeCzechTownName(), RoadStop::MakeDriveThrough(), MarkBadgeSeen(), 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(), TownActionBuildStatue(), TrainApproachingLineEnd(), TrainCheckIfLineEnds(), TriggerRoadStopRandomisation(), TriggerStationRandomisation(), TryBuildTownHouse(), SettingEntry::UpdateFilterState(), SettingsPage::UpdateFilterState(), LinkGraphLegendWindow::UpdateOverlayCompanies(), UpdateStationAcceptance(), BaseGraphWindow::UpdateStatistics(), 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
otherBitset 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
valueBit 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
valueBit to assign to.
settrue 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
valueBit to check.
Returns
true iff the requested bit is set.

Definition at line 141 of file base_bitset_type.hpp.

Referenced by AddAcceptedCargoOfHouse(), AddArticulatedParts(), 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(), 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(), 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(), 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(), NetworkAuthenticationServerHandler::Create(), CreateNewIndustryHelper(), DecloneOrder(), DecodeSingleSprite(), DeleteLastWagon(), Engine::DetermineCapacity(), 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(), DrawEngineList(), DrawFrameRect(), DrawHouseInGUI(), IndustryViewWindow::DrawInfo(), DrawNewHouseTileInGUI(), DrawNewObjectTileInGUI(), 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(), TownDirectoryWindow::DrawWidget(), VehicleViewWindow::DrawWidget(), Window::DrawWidgets(), ErrorUnknownCallbackResult(), FillGRFDetails(), GUIList< T, P, F >::Filter(), FinalisePriceBaseMultipliers(), FindClosestTrainDepot(), FindNearestHangar(), FixTTOEngines(), FloodVehicleProc(), RoadVehicle::GetAccelerationStatus(), Train::GetAccelerationStatus(), Train::GetAirDragArea(), GetAllCargoSuffixes(), GetArticulatedRefitMasks(), GetBadgeSprite(), GetBestFittingSubType(), GetCapacityOfArticulatedParts(), GetCargoSubtypeText(), GetCargoSuffix(), GetCargoSuffix(), GetCargoTypesOfArticulatedParts(), GetCompanyRailTypes(), GetCompanyRoadTypes(), GetEngineLiveryScheme(), GUIList< T, P, F >::GetFiltering(), GetFoundation_Town(), GetGlobalVariable(), BuildHouseWindow::GetHouseInformation(), GetIfStopIsForType(), GetIndustryGamePlayProbability(), GetIndustryProbabilityCallback(), GUIList< T, P, F >::GetListing(), GetLoadAmount(), GetMaskOfTownActions(), Train::GetOrderStationLocation(), NewGRFWindow::GetPalette(), GetPreviewCompany(), GetProducedCargoOfHouse(), GetRailTypeDropDownList(), GetRailTypes(), GetRoadTypes(), GetScaledIndustryGenerationProbability(), GetSettingsDesc(), GetTownRoadType(), GetTownRoadTypeFirstIntroductionDate(), SettingDesc::GetType(), HousePickerCallbacks::GetTypeName(), IntSettingDesc::GetValueParams(), IndustriesScopeResolver::GetVariable(), GetVehicleCannotUseStationReason(), RoadVehicle::GetVehicleTrackdir(), Ship::GetVehicleTrackdir(), Train::GetVehicleTrackdir(), GenerateLandscapeWindow::GetWidgetString(), HandleAircraftSmoke(), HandleAutoscroll(), HandleBankruptcyTakeover(), HandleCrashedTrain(), HandleScrollbarScrolling(), HandleWindowDragging(), HasGrfMiscBit(), HasPowerOnRail(), HasPowerOnRoad(), HasRailCatenary(), HasRailTypeAvail(), GoodsEntry::HasRating(), HasRoadCatenary(), HasRoadTypeAvail(), HeightMapCoastLines(), HeightMapSmoothCoasts(), IConsoleGetSetting(), IndustryProductionCallback(), IndustryTemporarilyRefusesCargo(), IniSaveSettings(), InitRailTypes(), InitRoadTypes(), CommandHelperBase::InternalDoAfter(), CommandHelperBase::InternalExecutePrepTest(), CommandHelperBase::InternalExecuteProcessResult(), CommandHelperBase::InternalExecuteValidateTestAndPrepExec(), CommandHelperBase::InternalPostBefore(), IsArticulatedEngine(), IsArticulatedVehicleRefittable(), 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(), SpriteLoaderMakeIndexed::LoadSprite(), LoadUnloadVehicle(), MakeCzechTownName(), IntSettingDesc::MakeValueValid(), MapAircraftMovementState(), 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(), VehicleGroupWindow::OnPaint(), StationViewWindow::OnPaint(), TimetableWindow::OnPaint(), TownAuthorityWindow::OnPaint(), CheatWindow::OnQueryTextFinished(), GameOptionsWindow::OnQueryTextFinished(), SelectGameWindow::OnResize(), GameOptionsWindow::OnResize(), ParamSet(), PlayVehicleSound(), Vehicle::PreDestructor(), LinkRefresher::PredictNextOrder(), PrepareUnload(), Window::ProcessHighlightedInvalidations(), Rail90DegTurnDisallowed(), RailNoLevelCrossings(), RailVehicleChangeInfo(), RoadStop::Entry::Rebuild(), ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(), NetworkGameSocketHandler::ReceiveCommand(), RefitVehicle(), LinkRefresher::RefreshLinks(), RelocateAllWindows(), RemoveAirport(), RemoveBuoy(), RemoveDock(), RemoveEngineReplacement(), RemoveFromRailBaseStation(), RemoveGenericRoadStop(), RemoveLock(), RemoveRailStation(), RemoveRoad(), RemoveRoadStop(), RemoveRoadWaypointStop(), ReplaceChain(), ReplaceFreeUnit(), ScriptConfig::ResetEditableSettings(), ResetSettings(), StationResolverObject::ResolveReal(), ReverseTrainSwapVeh(), RoadNoLevelCrossing(), RoadVehicleChangeInfo(), SendAllVehiclesToDepot(), Vehicle::SendToDepot(), SettingEntry::SetButtons(), SetMouseCursorVehicle(), LinkGraphLegendWindow::SetOverlay(), SetSettingValue(), SetSettingValue(), NWidgetHorizontal::SetupSmallestSize(), NWidgetVertical::SetupSmallestSize(), SetYearEngineAgingStops(), ShipVehicleChangeInfo(), ShowMissingContentWindow(), ShowNewGrfVehicleError(), ShowQueryString(), Vehicle::ShowVisualEffect(), GUIList< T, P, F >::Sort(), StartupOneEngine(), StateGameLoop_LinkGraphPauseControl(), StationHandleBigTick(), TestAutoslopeOnRailTile(), Aircraft::Tick(), RoadVehicle::Tick(), Ship::Tick(), Train::Tick(), TileLoop_Town(), ToolbarOptionsClick(), TownActionAdvertiseLarge(), TownActionAdvertiseMedium(), TownActionAdvertiseSmall(), TownActionBribe(), TownActionBuildStatue(), TownActionBuyRights(), TownActionFundBuildings(), TownActionRoadRebuild(), TownCanGrowRoad(), TownDirectoryWindow::TownRatingSorter(), TrainApproachingCrossingEnum(), TrainApproachingCrossingTile(), TrainController(), TrainCrashed(), TriggerHouseAnimation_TileLoop(), TriggerIndustryProduction(), TryBuildTownHouse(), NetworkContentListWindow::TypeOrSelectedFilter(), LinkGraph::BaseEdge::Update(), UpdateAircraftSpeed(), Train::UpdateDeltaXY(), UpdateHousesAndTowns(), UpdateObjectColours(), UpdateSignalsAroundSegment(), UpdateSignalsInBuffer(), UpdateVehicleTimetable(), Station::UpdateVirtCoord(), Vehicle::UpdateVisualEffect(), QueryStringWindow::UpdateWidgetSize(), StationViewWindow::UpdateWidgetSize(), UsedBadgeClasses::UsedBadgeClasses(), 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: