#include #include #include #include #include namespace scwx { namespace awips { namespace ibw { static const std::string logPrefix_ = "scwx::awips::ibw::impact_based_warnings"; static const boost::unordered_flat_map impactBasedWarningInfo_ { {Phenomenon::Marine, ImpactBasedWarningInfo {.hasTornadoPossibleTag_ = true}}, {Phenomenon::FlashFlood, ImpactBasedWarningInfo { .threatCategories_ {ThreatCategory::Base, ThreatCategory::Considerable, ThreatCategory::Catastrophic}}}, {Phenomenon::SevereThunderstorm, ImpactBasedWarningInfo { .hasTornadoPossibleTag_ = true, .threatCategories_ {ThreatCategory::Base, ThreatCategory::Considerable, ThreatCategory::Destructive}}}, {Phenomenon::SnowSquall, ImpactBasedWarningInfo {}}, {Phenomenon::Tornado, ImpactBasedWarningInfo { .hasObservedTag_ = true, .threatCategories_ {ThreatCategory::Base, ThreatCategory::Considerable, ThreatCategory::Catastrophic}}}, {Phenomenon::Unknown, ImpactBasedWarningInfo {}}}; static const std::unordered_map threatCategoryName_ {{ThreatCategory::Base, "Base"}, {ThreatCategory::Significant, "Significant"}, {ThreatCategory::Considerable, "Considerable"}, {ThreatCategory::Destructive, "Destructive"}, {ThreatCategory::Catastrophic, "Catastrophic"}, {ThreatCategory::Unknown, "?"}}; const ImpactBasedWarningInfo& GetImpactBasedWarningInfo(Phenomenon phenomenon) { auto it = impactBasedWarningInfo_.find(phenomenon); if (it != impactBasedWarningInfo_.cend()) { return it->second; } return impactBasedWarningInfo_.at(Phenomenon::Unknown); } SCWX_GET_ENUM(ThreatCategory, GetThreatCategory, threatCategoryName_) const std::string& GetThreatCategoryName(ThreatCategory threatCategory) { return threatCategoryName_.at(threatCategory); } } // namespace ibw } // namespace awips } // namespace scwx