Add `getManagedObjects` method call

Add the `getManagedObjects` method call to the shared sdbusplus.hpp file
for fan applications.

Change-Id: I46baecd3ed971058dea10cf326b0206a696a3a22
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/sdbusplus.hpp b/sdbusplus.hpp
index 16bd083..1f2839f 100644
--- a/sdbusplus.hpp
+++ b/sdbusplus.hpp
@@ -291,6 +291,25 @@
         return getService(getBus(), path, interface);
     }
 
+    /** @brief Get managed objects. */
+    template <typename Variant>
+    static auto getManagedObjects(sdbusplus::bus::bus& bus,
+                                  const std::string& service,
+                                  const std::string& path)
+    {
+        using namespace std::literals::string_literals;
+
+        using Path = sdbusplus::message::object_path;
+        using Intf = std::string;
+        using Prop = std::string;
+        using GetManagedObjects =
+            std::map<Path, std::map<Intf, std::map<Prop, Variant>>>;
+
+        return callMethodAndRead<GetManagedObjects>(
+            bus, service, path, "org.freedesktop.DBus.ObjectManager"s,
+            "GetManagedObjects"s);
+    }
+
     /** @brief Get a property with mapper lookup. */
     template <typename Property>
     static auto getProperty(sdbusplus::bus::bus& bus, const std::string& path,