Convenience functions for aircraft list

This commit is contained in:
Klaus Basan
2015-01-18 21:48:34 +01:00
parent ac87e7ef60
commit 6bcc8940fa
2 changed files with 27 additions and 1 deletions

View File

@@ -10,7 +10,9 @@
#include "avaircraftlist.h"
#include "nwuser.h"
#include "predicates.h"
#include "propertyindexallclasses.h"
using namespace BlackMisc;
using namespace BlackMisc::PhysicalQuantities;
using namespace BlackMisc::Network;
@@ -30,6 +32,23 @@ namespace BlackMisc
CSequence<CAircraft>(other)
{ }
/*
* Contains callsign
*/
bool CAircraftList::containsCallsign(const CCallsign &callsign) const
{
if (callsign.isEmpty()) { return false; }
return this->contains(&CAircraft::getCallsign, callsign);
}
/*
* Change for callsign
*/
int CAircraftList::applyIfCallsign(const CCallsign &callsign, const CPropertyIndexVariantMap &variantMap)
{
return this->applyIf(&CAircraft::getCallsign, callsign, variantMap, false);
}
/*
* Register metadata
*/