mirror of
https://github.com/esphome/esphome.git
synced 2025-10-28 21:53:48 +00:00
policy
This commit is contained in:
@@ -17,11 +17,13 @@ namespace climate {
|
|||||||
|
|
||||||
// Type aliases for climate enum bitmasks
|
// Type aliases for climate enum bitmasks
|
||||||
// These replace std::set<EnumType> to eliminate red-black tree overhead
|
// These replace std::set<EnumType> to eliminate red-black tree overhead
|
||||||
// For contiguous enums starting at 0, bitmask size is automatically calculated from the last enum value
|
// For contiguous enums starting at 0, DefaultBitPolicy provides 1:1 mapping (enum value = bit position)
|
||||||
using ClimateModeMask = FiniteSetMask<ClimateMode, CLIMATE_MODE_AUTO + 1>;
|
// Bitmask size is automatically calculated from the last enum value
|
||||||
using ClimateFanModeMask = FiniteSetMask<ClimateFanMode, CLIMATE_FAN_QUIET + 1>;
|
using ClimateModeMask = FiniteSetMask<ClimateMode, DefaultBitPolicy<ClimateMode, CLIMATE_MODE_AUTO + 1>>;
|
||||||
using ClimateSwingModeMask = FiniteSetMask<ClimateSwingMode, CLIMATE_SWING_HORIZONTAL + 1>;
|
using ClimateFanModeMask = FiniteSetMask<ClimateFanMode, DefaultBitPolicy<ClimateFanMode, CLIMATE_FAN_QUIET + 1>>;
|
||||||
using ClimatePresetMask = FiniteSetMask<ClimatePreset, CLIMATE_PRESET_ACTIVITY + 1>;
|
using ClimateSwingModeMask =
|
||||||
|
FiniteSetMask<ClimateSwingMode, DefaultBitPolicy<ClimateSwingMode, CLIMATE_SWING_HORIZONTAL + 1>>;
|
||||||
|
using ClimatePresetMask = FiniteSetMask<ClimatePreset, DefaultBitPolicy<ClimatePreset, CLIMATE_PRESET_ACTIVITY + 1>>;
|
||||||
|
|
||||||
// Lightweight linear search for small vectors (1-20 items)
|
// Lightweight linear search for small vectors (1-20 items)
|
||||||
// Avoids std::find template overhead
|
// Avoids std::find template overhead
|
||||||
|
|||||||
Reference in New Issue
Block a user