From 29d436ee6792ca51c1ba41c8b5278cbd74109089 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 28 Sep 2015 17:17:38 +0200 Subject: [PATCH] refs #469 convenience function in METAR set --- src/blackmisc/weather/metarset.cpp | 5 +++++ src/blackmisc/weather/metarset.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/blackmisc/weather/metarset.cpp b/src/blackmisc/weather/metarset.cpp index d4cffeae9..ae0e97456 100644 --- a/src/blackmisc/weather/metarset.cpp +++ b/src/blackmisc/weather/metarset.cpp @@ -17,5 +17,10 @@ namespace BlackMisc CCollection(other) { } + CMetar CMetarSet::getMetarForAirport(const Aviation::CAirportIcaoCode &icao) const + { + return this->findFirstByOrDefault(&CMetar::getAirportIcaoCode, icao); + } + } // namespace } // namespace diff --git a/src/blackmisc/weather/metarset.h b/src/blackmisc/weather/metarset.h index 24dd3726b..b9a883103 100644 --- a/src/blackmisc/weather/metarset.h +++ b/src/blackmisc/weather/metarset.h @@ -34,6 +34,9 @@ namespace BlackMisc //! Construct from a base class object. CMetarSet(const CCollection &other); + + //! METAR for ICAO code + CMetar getMetarForAirport(const Aviation::CAirportIcaoCode &icao) const; }; } //namespace