| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "icpuinfo.h" |
| 7 | #include "igpuinfo.h" |
| 8 | #include "iswinfo.h" |
| 9 | #include <memory> |
| 10 | #include <vector> |
| 11 | |
| 12 | class InfoProviderRegistry final |
| 13 | : public ICPUInfo::IProviderRegistry |
| 14 | , public IGPUInfo::IProviderRegistry |
| 15 | , public ISWInfo::IProviderRegistry |
| 16 | { |
| 17 | public: |
| 18 | std::vector<std::unique_ptr<ICPUInfo::IProvider>> const & |
| 19 | cpuInfoProviders() const override; |
| 20 | std::vector<std::unique_ptr<IGPUInfo::IProvider>> const & |
| 21 | gpuInfoProviders() const override; |
| 22 | std::vector<std::unique_ptr<ISWInfo::IProvider>> const & |
| 23 | swInfoProviders() const override; |
| 24 | |
| 25 | static bool add(std::unique_ptr<ICPUInfo::IProvider> &&provider); |
| 26 | static bool add(std::unique_ptr<IGPUInfo::IProvider> &&provider); |
| 27 | static bool add(std::unique_ptr<ISWInfo::IProvider> &&provider); |
| 28 | |
| 29 | private: |
| 30 | static std::vector<std::unique_ptr<ICPUInfo::IProvider>> &cpuInfoProviders_(); |
| 31 | static std::vector<std::unique_ptr<IGPUInfo::IProvider>> &gpuInfoProviders_(); |
| 32 | static std::vector<std::unique_ptr<ISWInfo::IProvider>> &swInfoProviders_(); |
| 33 | }; |