swift
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"
18 #include "misc/swiftmiscexport.h"
19 
20 SWIFT_DECLARE_SEQUENCE_MIXINS(swift::misc::simulation, CDistributor, CDistributorList)
21 
22 namespace 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 
40 
43 
45  CDistributor findByKeyOrAlias(const QString &keyOrAlias) const;
46 
49  CDistributor findByModelData(const CAircraftModel &model) const;
50 
52  CDistributorList findFsFamilyStandard() const;
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 
65  QStringList getDbKeysAndAliases(bool sort) const;
66 
68  CDistributorList matchesSimulator(const CSimulatorInfo &simulator) const;
69 
71  CDistributorList matchesAnyFsFamily() const;
72 
74  bool isCompletelyFromDb() const;
75 
77  int removeIfNotLoadedFromDb();
78  };
79 } // namespace swift::misc::simulation
80 
83 
84 #endif // SWIFT_MISC_SIMULATION_DISTRIBUTORLIST_H
Generic ordered container with value semantics.
Definition: collection.h:107
Generic sequential container with value semantics.
Definition: sequence.h:86
CSequence()=default
Default constructor.
List of orderable IOrderable objects.
Definition: orderablelist.h:19
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...
Definition: mixinmetatype.h:29
Aircraft model (used by another pilot, my models on disk)
Definition: aircraftmodel.h:71
Value object encapsulating information of software distributor.
Definition: distributor.h:33
Value object encapsulating a list of distributors.
Simple hardcoded info about the corresponding simulator.
Definition: simulatorinfo.h:41
#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.