| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "../igpuinfo.h" |
| 7 | #include "core/idatasource.h" |
| 8 | #include <filesystem> |
| 9 | #include <memory> |
| 10 | #include <string> |
| 11 | #include <vector> |
| 12 | |
| 13 | class GPUInfoUevent final : public IGPUInfo::IProvider |
| 14 | { |
| 15 | public: |
| 16 | GPUInfoUevent(std::unique_ptr< |
| 17 | IDataSource<std::vector<std::string>, std::filesystem::path const>> |
| 18 | &&dataSource) noexcept; |
| 19 | |
| 20 | std::vector<std::pair<std::string, std::string>> |
| 21 | provideInfo(Vendor vendor, int gpuIndex, IGPUInfo::Path const &path, |
| 22 | IHWIDTranslator const &hwIDTranslator) const override; |
| 23 | |
| 24 | std::vector<std::string> |
| 25 | provideCapabilities(Vendor vendor, int, |
| 26 | IGPUInfo::Path const &path) const override; |
| 27 | |
| 28 | private: |
| 29 | std::unique_ptr<IDataSource<std::vector<std::string>, |
| 30 | std::filesystem::path const>> const dataSource_; |
| 31 | static bool registered_; |
| 32 | }; |