PerformProbe: Invoke PerformScan::updateSystemConfiguration() directly
Drop the lambda we previously required.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I4cfa0a8a026226a6a4d77191045da43c5b4a30a7
diff --git a/src/PerformProbe.cpp b/src/PerformProbe.cpp
index d120b3c..7c5a2b2 100644
--- a/src/PerformProbe.cpp
+++ b/src/PerformProbe.cpp
@@ -19,6 +19,7 @@
#include <boost/algorithm/string/replace.hpp>
#include <regex>
+#include <utility>
constexpr const bool debug = false;
@@ -218,19 +219,19 @@
return ret;
}
-PerformProbe::PerformProbe(
- const std::vector<std::string>& probeCommand,
- std::shared_ptr<PerformScan>& scanPtr,
- std::function<void(FoundDevices&, const MapperGetSubTreeResponse&)>&&
- callback) :
- _probeCommand(probeCommand),
- scan(scanPtr), _callback(std::move(callback))
+PerformProbe::PerformProbe(nlohmann::json& recordRef,
+ const std::vector<std::string>& probeCommand,
+ std::string probeName,
+ std::shared_ptr<PerformScan>& scanPtr) :
+ recordRef(recordRef),
+ _probeCommand(probeCommand), probeName(std::move(probeName)), scan(scanPtr)
{}
PerformProbe::~PerformProbe()
{
FoundDevices foundDevs;
if (probe(_probeCommand, scan, foundDevs))
{
- _callback(foundDevs, scan->dbusProbeObjects);
+ scan->updateSystemConfiguration(recordRef, probeName, foundDevs,
+ scan->dbusProbeObjects);
}
}