Do tmpl substitutions using all properties on path

The current code would substitute the template arguments in the JSON
files, such as $bus, by only looking at the properties of the interface
that passed the probe.

This commit will try to find a substitution using the properties of all
of the interfaces on the same object path as the interface that passed
the probe.  It does this by reading and storing the properties of all
interfaces that came back from the existing GetSubTree call that finds
the paths of the probed interfaces, instead of just limiting it to the
interfaces that were probed.  The template substitutions are then tried
on the properties of all interfaces until one is successful.

This change is being made so that the interface used in the probe
doesn't also need to contain properties for the device details, such as
the bus property, that otherwise wouldn't belong there.  For example,
the com.ibm.ipzvpd.VINI interface, which models EEPROM contents, is
currently used in probes on IBM systems, and with this change the bus
and address properties can now be on a separate interface, such as the
recently proposed xyz.openbmc_project.Inventory.Decorator.I2CDevice.

Tested:  Tested that the $bus template can be successfully filled in
with the Bus property from an interface other than the one the probe was
matched on.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ic6f1539b38f6a4098f131d7f14cad6b6ddff041f
diff --git a/include/EntityManager.hpp b/include/EntityManager.hpp
index 5867556..748c49b 100644
--- a/include/EntityManager.hpp
+++ b/include/EntityManager.hpp
@@ -29,12 +29,16 @@
 #include <list>
 #include <string>
 
+// paths - > interfaces -> properties
 using DBusProbeObjectT = boost::container::flat_map<
     std::string,
-    std::vector<boost::container::flat_map<std::string, BasicVariantType>>>;
+    boost::container::flat_map<
+        std::string,
+        boost::container::flat_map<std::string, BasicVariantType>>>;
 
-using FoundDeviceT =
-    std::vector<boost::container::flat_map<std::string, BasicVariantType>>;
+// vector of tuple<map<propertyName, variant>, D-Bus path>>
+using FoundDeviceT = std::vector<std::tuple<
+    boost::container::flat_map<std::string, BasicVariantType>, std::string>>;
 
 struct PerformScan : std::enable_shared_from_this<PerformScan>
 {
@@ -60,14 +64,15 @@
 // this class finds the needed dbus fields and on destruction runs the probe
 struct PerformProbe : std::enable_shared_from_this<PerformProbe>
 {
-    PerformProbe(const std::vector<std::string>& probeCommand,
-                 std::shared_ptr<PerformScan>& scanPtr,
-                 std::function<void(FoundDeviceT&)>&& callback);
+    PerformProbe(
+        const std::vector<std::string>& probeCommand,
+        std::shared_ptr<PerformScan>& scanPtr,
+        std::function<void(FoundDeviceT&, const DBusProbeObjectT&)>&& callback);
     virtual ~PerformProbe();
 
     std::vector<std::string> _probeCommand;
     std::shared_ptr<PerformScan> scan;
-    std::function<void(FoundDeviceT&)> _callback;
+    std::function<void(FoundDeviceT&, const DBusProbeObjectT&)> _callback;
 };
 
 inline void logDeviceAdded(const nlohmann::json& record)