30 using namespace swift::misc::aviation;
31 using namespace swift::misc::physical_quantities;
32 using namespace swift::misc::geo;
33 using namespace swift::misc::network;
36 namespace swift::sample
38 int CSamplesContainer::samples()
41 const CAtcStation station1(CTestData::getMunichTower());
43 CAtcStation station3(CTestData::getMunichApproach());
53 qDebug() <<
"-- list:";
58 qDebug() <<
"-- find by:";
62 qDebug() <<
"-- sort by:";
65 qDebug() <<
"-----------------------------------------------";
71 CFrequency changedFrequency(118.25, CFrequencyUnit::MHz());
76 changedProperties = station1Cpy.
apply(vm,
true);
77 qDebug() <<
"apply, changed" << changedProperties << vm <<
"expected 1";
78 changedProperties = station1Cpy.
apply(vm,
true);
79 qDebug() <<
"apply, changed" << changedProperties << vm <<
"expected 0";
84 qDebug() <<
"applyIf, changed" << changed << vm <<
"expected 1";
86 qDebug() <<
"applyIf, changed" << changed << vm <<
"expected 1";
88 qDebug() <<
"applyIf, changed" << changed << vm <<
"expected 0";
Value object encapsulating a list of property indexes.
Specialized value object compliant map for variants, based on indexes.
CSequence sortedBy(K1 key1, Keys... keys) const
Return a copy sorted by some particular key(s).
CSequence findBy(Predicate p) const
Return a copy containing only those elements for which a given predicate returns true.
void push_back(const T &value)
Appends an element at the end of the sequence.
int applyIf(Predicate p, const VariantMap &newValues, bool skipEqualValues=false)
Modify by applying a value map to each element for which a given predicate returns true.
void clear()
Removes all elements in the sequence.
static CVariant from(T &&value)
Synonym for fromValue().
Value object encapsulating information about an ATC station.
const CCallsign & getCallsign() const
Get callsign.
QString getControllerRealName() const
Get controller name.
const physical_quantities::CFrequency & getFrequency() const
Get frequency.
Value object for a list of ATC stations.
CPropertyIndexList apply(const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false)
Update by variant map.
QString toQString(bool i18n=false) const
Cast as QString.
Generate data for testing purposes.
Free functions in swift::misc.