| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "core/info/vendor.h" |
| 7 | #include <filesystem> |
| 8 | #include <memory> |
| 9 | #include <optional> |
| 10 | #include <string> |
| 11 | #include <tuple> |
| 12 | #include <vector> |
| 13 | |
| 14 | class IHelperControl; |
| 15 | class ISysModelSyncer; |
| 16 | class ISession; |
| 17 | class IUIFactory; |
| 18 | |
| 19 | class CoreFactory final |
| 20 | { |
| 21 | public: |
| 22 | struct Components |
| 23 | { |
| 24 | std::unique_ptr<IHelperControl> helperControl; |
| 25 | std::shared_ptr<ISysModelSyncer> sysSyncer; |
| 26 | std::unique_ptr<ISession> session; |
| 27 | std::unique_ptr<IUIFactory> uiFactory; |
| 28 | }; |
| 29 | |
| 30 | CoreFactory() noexcept; |
| 31 | std::optional<Components> build(std::string &&appName, bool logCommands, |
| 32 | bool logProfileStack) const; |
| 33 | |
| 34 | private: |
| 35 | std::tuple<std::filesystem::path, std::filesystem::path> |
| 36 | standardDirectories() const; |
| 37 | void createAppDirectories(std::string const &appDirectory, |
| 38 | std::filesystem::path const &config, |
| 39 | std::filesystem::path const &cache) const; |
| 40 | |
| 41 | std::vector<Vendor> gpuVendors_; |
| 42 | }; |