Refactor MDRV2 class to allow more than one

Refactored the main MDRV2 class to allow more than one object of this
class to exist at the same time. All hardcoded paths have been made
parameters to the constructor, so that they can be varied at runtime as
needed, to avoid overlap.

Also did some necessary internal cleanups to facilitate this.

Tested: Created multiple copies of the MDRV2 object at the same time,
it worked, all appeared on D-Bus, under distinct object paths and
inventory paths. Destructed the MDRV2 object, it disappeared from
D-Bus, constructed it again, it came back.

https://gist.github.com/Krellan/6930bc2ed1ac16b93afcc3a12c02e545

Change-Id: Icd1ebf50086b526cf0cff149eb8ddc59da78f0a9
Signed-off-by: Josh Lehan <krellan@google.com>
diff --git a/include/system.hpp b/include/system.hpp
index 4753a01..ac75a0c 100644
--- a/include/system.hpp
+++ b/include/system.hpp
@@ -17,6 +17,7 @@
 #pragma once
 #include "smbios_mdrv2.hpp"
 
+#include <sdbusplus/asio/connection.hpp>
 #include <xyz/openbmc_project/Common/UUID/server.hpp>
 #include <xyz/openbmc_project/Inventory/Decorator/Revision/server.hpp>
 
@@ -40,15 +41,17 @@
     System(System&&) = default;
     System& operator=(System&&) = default;
 
-    System(sdbusplus::bus_t& bus, const std::string& objPath,
-           uint8_t* smbiosTableStorage) :
+    System(std::shared_ptr<sdbusplus::asio::connection> bus,
+           std::string objPath, uint8_t* smbiosTableStorage,
+           std::string filePath) :
         sdbusplus::server::object_t<
             sdbusplus::server::xyz::openbmc_project::common::UUID>(
-            bus, objPath.c_str()),
+            *bus, objPath.c_str()),
         sdbusplus::server::object_t<sdbusplus::server::xyz::openbmc_project::
                                         inventory::decorator::Revision>(
-            bus, objPath.c_str()),
-        bus(bus), path(objPath), storage(smbiosTableStorage)
+            *bus, objPath.c_str()),
+        bus(std::move(bus)), path(std::move(objPath)),
+        storage(smbiosTableStorage), smbiosFilePath(std::move(filePath))
     {
         std::string input = "0";
         uuid(input);
@@ -58,7 +61,8 @@
     std::string uuid(std::string value) override;
 
     std::string version(std::string value) override;
-    sdbusplus::bus_t& bus;
+
+    std::shared_ptr<sdbusplus::asio::connection> bus;
 
   private:
     /** @brief Path of the group instance */
@@ -108,6 +112,8 @@
         uint8_t skuNum;
         uint8_t family;
     } __attribute__((packed));
+
+    std::string smbiosFilePath;
 };
 
 } // namespace smbios