swift
Loading...
Searching...
No Matches
distributorlist.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_MISC_SIMULATION_DISTRIBUTORLIST_H
7#define SWIFT_MISC_SIMULATION_DISTRIBUTORLIST_H
8
9#include <QMetaType>
10#include <QString>
11#include <QStringList>
12
13#include "misc/collection.h"
15#include "misc/orderablelist.h"
16#include "misc/sequence.h"
19
20SWIFT_DECLARE_SEQUENCE_MIXINS(swift::misc::simulation, CDistributor, CDistributorList)
21
22namespace swift::misc::simulation
23{
24 class CAircraftModel;
25 class CSimulatorModel;
26
29 public CSequence<CDistributor>,
30 public db::IDatastoreObjectList<CDistributor, CDistributorList, QString>,
31 public IOrderableList<CDistributor, CDistributorList>,
32 public mixin::MetaType<CDistributorList>
33 {
34 public:
37
39 CDistributorList() = default;
40
43
45 CDistributor findByKeyOrAlias(const QString &keyOrAlias) const;
46
50
53
55 CDistributor smartDistributorSelector(const CDistributor &distributorPattern) const;
56
58 CDistributor smartDistributorSelector(const CDistributor &distributorPattern,
59 const CAircraftModel &model) const;
60
62 bool matchesAnyKeyOrAlias(const QString &keyOrAlias) const;
63
66
68 CDistributorList matchesSimulator(const CSimulatorInfo &simulator) const;
69
72
74 bool isCompletelyFromDb() const;
75
78 };
79} // namespace swift::misc::simulation
80
83
84#endif // SWIFT_MISC_SIMULATION_DISTRIBUTORLIST_H
Generic ordered container with value semantics.
Definition collection.h:113
CSequence()=default
Default constructor.
List of objects read from database. Such objects should implement.
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
Aircraft model (used by another pilot, my models on disk).
Value object encapsulating information of software distributor.
Definition distributor.h:33
Value object encapsulating a list of distributors.
CDistributor findByModelData(const CAircraftModel &model) const
Find by model string.
CSequence()=default
Default constructor.
CDistributorList matchesSimulator(const CSimulatorInfo &simulator) const
Find for given simulator.
CDistributor findByKeyOrAlias(const QString &keyOrAlias) const
Find by id or alias.
bool isCompletelyFromDb() const
All data from DB?
QStringList getDbKeysAndAliases(bool sort) const
All DB keys and aliases.
int removeIfNotLoadedFromDb()
Remove distributors not from DB.
CDistributor smartDistributorSelector(const CDistributor &distributorPattern) const
Best match by given pattern.
CDistributorList matchesAnyFsFamily() const
Find all for all FS simulators.
CDistributorList()=default
Default constructor.
bool matchesAnyKeyOrAlias(const QString &keyOrAlias) const
At least is matching key or alias.
CDistributorList findFsFamilyStandard() const
Find the FS family standard distributors.
Simple hardcoded info about the corresponding simulator.
#define SWIFT_MISC_DECLARE_USING_MIXIN_METATYPE(DERIVED)
When a derived class and a base class both inherit from mixin::MetaType, the derived class uses this ...
#define SWIFT_DECLARE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template declaration of mixins for a CSequence subclass to be placed near the top of the hea...
Definition sequence.h:62
#define SWIFT_MISC_EXPORT
Export a class or function from the library.