1 #pragma once 2 3 #include "../utils.hpp" 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 49