| 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 "vendor.h" |
| 8 | #include <string> |
| 9 | #include <unordered_map> |
| 10 | #include <unordered_set> |
| 11 | |
| 12 | class GPUInfo final : public IGPUInfo |
| 13 | { |
| 14 | public: |
| 15 | GPUInfo(Vendor vendor, int index, IGPUInfo::Path &&path) noexcept; |
| 16 | |
| 17 | Vendor vendor() const override; |
| 18 | int index() const override; |
| 19 | IGPUInfo::Path const &path() const override; |
| 20 | std::vector<std::string> keys() const override; |
| 21 | std::string info(std::string_view key) const override; |
| 22 | bool hasCapability(std::string_view name) const override; |
| 23 | void initialize( |
| 24 | std::vector<std::unique_ptr<IGPUInfo::IProvider>> const &infoProviders, |
| 25 | IHWIDTranslator const &hwidTranslator) override; |
| 26 | |
| 27 | private: |
| 28 | Vendor const vendor_; |
| 29 | int const index_; |
| 30 | IGPUInfo::Path const path_; |
| 31 | std::unordered_map<std::string, std::string> info_; |
| 32 | std::unordered_set<std::string> capabilities_; |
| 33 | }; |