Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Christopher Meis | fc9e7fd | 2025-04-03 13:13:35 +0200 | [diff] [blame^] | 3 | #include "../utils.hpp" |
Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 4 | |
| 5 | #include <systemd/sd-journal.h> |
| 6 | |
| 7 | #include <boost/container/flat_map.hpp> |
| 8 | #include <nlohmann/json.hpp> |
| 9 | #include <sdbusplus/asio/object_server.hpp> |
| 10 | |
| 11 | #include <functional> |
| 12 | #include <list> |
| 13 | #include <vector> |
| 14 | |
| 15 | namespace scan |
| 16 | { |
| 17 | struct DBusDeviceDescriptor |
| 18 | { |
| 19 | DBusInterface interface; |
| 20 | std::string path; |
| 21 | }; |
| 22 | |
| 23 | using FoundDevices = std::vector<DBusDeviceDescriptor>; |
| 24 | |
| 25 | struct PerformScan : std::enable_shared_from_this<PerformScan> |
| 26 | { |
| 27 | PerformScan(nlohmann::json& systemConfiguration, |
| 28 | nlohmann::json& missingConfigurations, |
| 29 | std::list<nlohmann::json>& configurations, |
| 30 | sdbusplus::asio::object_server& objServer, |
| 31 | std::function<void()>&& callback); |
| 32 | |
| 33 | void updateSystemConfiguration(const nlohmann::json& recordRef, |
| 34 | const std::string& probeName, |
| 35 | FoundDevices& foundDevices); |
| 36 | void run(); |
| 37 | virtual ~PerformScan(); |
| 38 | nlohmann::json& _systemConfiguration; |
| 39 | nlohmann::json& _missingConfigurations; |
| 40 | std::list<nlohmann::json> _configurations; |
| 41 | sdbusplus::asio::object_server& objServer; |
| 42 | std::function<void()> _callback; |
| 43 | bool _passed = false; |
| 44 | MapperGetSubTreeResponse dbusProbeObjects; |
| 45 | std::vector<std::string> passedProbes; |
| 46 | }; |
| 47 | |
| 48 | } // namespace scan |