Utility function allows to remove multiple callsigns

This commit is contained in:
Klaus Basan
2016-11-10 21:55:23 +01:00
parent 5babb26861
commit fbf048db4e
2 changed files with 9 additions and 1 deletions

View File

@@ -119,6 +119,12 @@ namespace BlackMisc
return this->container().removeIf(&OBJ::getCallsign, callsign);
}
template <class OBJ, class CONTAINER>
int ICallsignObjectList<OBJ, CONTAINER>::removeByCallsigns(const CCallsignSet &callsigns)
{
return this->container().removeIf([ & ](const OBJ &obj) { return callsigns.contains(obj.getCallsign()); });
}
template <class OBJ, class CONTAINER>
QMap<QString, int> ICallsignObjectList<OBJ, CONTAINER>::getSuffixes() const
{
@@ -209,4 +215,3 @@ namespace BlackMisc
} // namespace
} // namespace

View File

@@ -80,6 +80,9 @@ namespace BlackMisc
//! Remove all objects with callsign
int removeByCallsign(const CCallsign &callsign);
//! Remove all objects with callsigns
int removeByCallsigns(const CCallsignSet &callsigns);
//! All suffixes with their respective count
QMap<QString, int> getSuffixes() const;