| #pragma once |
| |
| #include "../utils.hpp" |
| |
| #include <systemd/sd-journal.h> |
| |
| #include <boost/container/flat_map.hpp> |
| #include <nlohmann/json.hpp> |
| #include <sdbusplus/asio/object_server.hpp> |
| |
| #include <functional> |
| #include <list> |
| #include <vector> |
| |
| namespace scan |
| { |
| struct DBusDeviceDescriptor |
| { |
| DBusInterface interface; |
| std::string path; |
| }; |
| |
| using FoundDevices = std::vector<DBusDeviceDescriptor>; |
| |
| struct PerformScan : std::enable_shared_from_this<PerformScan> |
| { |
| PerformScan(nlohmann::json& systemConfiguration, |
| nlohmann::json& missingConfigurations, |
| std::list<nlohmann::json>& configurations, |
| sdbusplus::asio::object_server& objServer, |
| std::function<void()>&& callback); |
| |
| void updateSystemConfiguration(const nlohmann::json& recordRef, |
| const std::string& probeName, |
| FoundDevices& foundDevices); |
| void run(); |
| virtual ~PerformScan(); |
| nlohmann::json& _systemConfiguration; |
| nlohmann::json& _missingConfigurations; |
| std::list<nlohmann::json> _configurations; |
| sdbusplus::asio::object_server& objServer; |
| std::function<void()> _callback; |
| bool _passed = false; |
| MapperGetSubTreeResponse dbusProbeObjects; |
| std::vector<std::string> passedProbes; |
| }; |
| |
| } // namespace scan |