swift
aircraftmodelloaderprovider.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_IAIRCRAFTMODELLOADERPROVIDER_H
7 #define SWIFT_MISC_SIMULATION_IAIRCRAFTMODELLOADERPROVIDER_H
8 
10 
11 namespace swift::misc::simulation
12 {
17  {
18  Q_OBJECT
19 
20  public:
22  static IAircraftModelLoader *createModelLoader(const CSimulatorInfo &simulator, QObject *parent = nullptr);
23 
25  IAircraftModelLoader *loaderInstance(const CSimulatorInfo &simulator);
26 
28  static CMultiAircraftModelLoaderProvider &multiModelLoaderInstance();
29 
32  IAircraftModelLoader *modelLoaderFsx() const { return m_loaderFsx; }
33  IAircraftModelLoader *modelLoaderP3D() const { return m_loaderP3D; }
34  IAircraftModelLoader *modelLoaderXP() const { return m_loaderXP; }
35  IAircraftModelLoader *modelLoaderFS9() const { return m_loaderFS9; }
36  IAircraftModelLoader *modelLoaderFG() const { return m_loaderFG; }
37  IAircraftModelLoader *modelLoaderMsfs() const { return m_loaderMsfs; }
39 
40  signals:
42  void loadingFinished(const swift::misc::CStatusMessageList &status, const CSimulatorInfo &simulator,
44 
46  void diskLoadingStarted(const CSimulatorInfo &simulator, IAircraftModelLoader::LoadMode mode);
47 
49  void loadingProgress(const CSimulatorInfo &simulator, const QString &message, int progressPercentage);
50 
52  void cacheChanged(const CSimulatorInfo &simulator);
53 
54  private:
55  IAircraftModelLoader *m_loaderFsx = nullptr;
56  IAircraftModelLoader *m_loaderP3D = nullptr;
57  IAircraftModelLoader *m_loaderXP = nullptr;
58  IAircraftModelLoader *m_loaderFS9 = nullptr;
59  IAircraftModelLoader *m_loaderFG = nullptr;
60  IAircraftModelLoader *m_loaderMsfs = nullptr;
61  IAircraftModelLoader *m_loaderMsfs2024 = nullptr;
62 
64  IAircraftModelLoader *initLoader(const CSimulatorInfo &simulator);
65  };
66 } // namespace swift::misc::simulation
67 
68 #endif // SWIFT_MISC_SIMULATION_IAIRCRAFTMODELLOADERPROVIDER_H
Status messages, e.g. from Core -> GUI.
Single instances of all model loaders (lazy init)
IAircraftModelLoader * modelLoaderMsfs() const
Simulator specific loaders.
IAircraftModelLoader * modelLoaderFG() const
Simulator specific loaders.
void diskLoadingStarted(const CSimulatorInfo &simulator, IAircraftModelLoader::LoadMode mode)
Disk loading started.
void cacheChanged(const CSimulatorInfo &simulator)
Relayed from centralized caches.
IAircraftModelLoader * modelLoaderFsx() const
Simulator specific loaders.
void loadingFinished(const swift::misc::CStatusMessageList &status, const CSimulatorInfo &simulator, IAircraftModelLoader::LoadFinishedInfo info)
Parsing is finished or cache has been loaded.
IAircraftModelLoader * modelLoaderP3D() const
Simulator specific loaders.
IAircraftModelLoader * modelLoaderXP() const
Simulator specific loaders.
IAircraftModelLoader * modelLoaderFS9() const
Simulator specific loaders.
void loadingProgress(const CSimulatorInfo &simulator, const QString &message, int progressPercentage)
Loading progress, normally from disk.
Simple hardcoded info about the corresponding simulator.
Definition: simulatorinfo.h:41
Load the aircraft for a simulator.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.