EntityManager: Promote FoundDeviceT to a struct and rename
Using tuples is a readability headache. Use names provided by a struct
rather than opaque indices.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ifd5225ee28e0898d35193165ae379e6e7c6026da
diff --git a/src/PerformScan.cpp b/src/PerformScan.cpp
index befd210..ab1bd4b 100644
--- a/src/PerformScan.cpp
+++ b/src/PerformScan.cpp
@@ -293,7 +293,7 @@
auto probePointer = std::make_shared<PerformProbe>(
probeCommand, thisRef,
[&, recordPtr,
- probeName](FoundDeviceT& foundDevices,
+ probeName](FoundDevices& foundDevices,
const MapperGetSubTreeResponse& allInterfaces) {
_passed = true;
std::set<nlohmann::json> usedNames;
@@ -310,7 +310,7 @@
itr != foundDevices.end();)
{
std::string recordName =
- getRecordName(std::get<0>(*itr), probeName);
+ getRecordName(itr->interface, probeName);
auto fromLastJson = lastJson.find(recordName);
if (fromLastJson != lastJson.end())
@@ -377,8 +377,8 @@
for (auto& foundDeviceAndPath : foundDevices)
{
const DBusInterface& foundDevice =
- std::get<0>(foundDeviceAndPath);
- const std::string& path = std::get<1>(foundDeviceAndPath);
+ foundDeviceAndPath.interface;
+ const std::string& path = foundDeviceAndPath.path;
// Need all interfaces on this path so that template
// substitutions can be done with any of the contained