* RegionMap: new 'default' region

This commit is contained in:
Scott Powell
2026-04-12 22:06:10 +10:00
parent 3b32f35288
commit 6a939ed8f8
2 changed files with 19 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ struct RegionEntry {
class RegionMap {
TransportKeyStore* _store;
uint16_t next_id, home_id;
uint16_t next_id, home_id, default_id;
uint16_t num_regions;
RegionEntry regions[MAX_REGION_ENTRIES];
RegionEntry wildcard;
@@ -43,6 +43,8 @@ public:
RegionEntry* findById(uint16_t id);
RegionEntry* getHomeRegion(); // NOTE: can be NULL
void setHomeRegion(const RegionEntry* home);
RegionEntry* getDefaultRegion(); // NOTE: can be NULL
void setDefaultRegion(const RegionEntry* def);
bool removeRegion(const RegionEntry& region);
bool clear();
void resetFrom(const RegionMap& src) { num_regions = 0; next_id = src.next_id; }