Create dump manager for each dump type.

Currently all types of dumps exist in the same path
and under the single dump manager. When there are
multiple dumps to be created separate path is needed
for creating and managing the dump. this commit
is splitting the dump manager into multiple objects
without  adding any new functionality. There will be
only one dump manager process but it will contain
seperate dump manager objects for system and BMC
dumps as per current scope.

Tested the existing dump functions with the build
- created bmc dump
- created system dump using notify
- deleted dump entry
- offloaded bmc dump

Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: Id4806660be1f1ba0b3cb6f840ae185a967f05a83
diff --git a/dump_manager_system.hpp b/dump_manager_system.hpp
new file mode 100644
index 0000000..948dc3d
--- /dev/null
+++ b/dump_manager_system.hpp
@@ -0,0 +1,66 @@
+#pragma once
+
+#include "dump_manager.hpp"
+#include "dump_utils.hpp"
+#include "xyz/openbmc_project/Dump/NewDump/server.hpp"
+
+#include <sdbusplus/bus.hpp>
+#include <sdbusplus/server/object.hpp>
+
+namespace phosphor
+{
+namespace dump
+{
+namespace system
+{
+
+using NotifyIface = sdbusplus::server::object::object<
+    sdbusplus::xyz::openbmc_project::Dump::server::NewDump>;
+
+/** @class Manager
+ *  @brief System Dump  manager implementation.
+ *  @details A concrete implementation for the
+ *  xyz.openbmc_project.Dump.Notify DBus API
+ */
+class Manager : virtual public NotifyIface,
+                virtual public phosphor::dump::Manager
+{
+  public:
+    Manager() = delete;
+    Manager(const Manager&) = default;
+    Manager& operator=(const Manager&) = delete;
+    Manager(Manager&&) = delete;
+    Manager& operator=(Manager&&) = delete;
+    virtual ~Manager() = default;
+
+    /** @brief Constructor to put object onto bus at a dbus path.
+     *  @param[in] bus - Bus to attach to.
+     *  @param[in] event - Dump manager sd_event loop.
+     *  @param[in] path - Path to attach at.
+     *  @param[in] baseEntryPath - Base path of the dump entry.
+     */
+    Manager(sdbusplus::bus::bus& bus, const char* path,
+            const std::string& baseEntryPath) :
+        NotifyIface(bus, path),
+        phosphor::dump::Manager(bus, path, baseEntryPath)
+    {
+    }
+
+    void restore() override
+    {
+        // TODO #2597  Implement the restore to restore the dump entries
+        // after the service restart.
+    }
+
+    /** @brief Notify the system dump manager about creation of a new dump.
+     *  @param[in] dumpType - Type of the Dump.
+     *  @param[in] dumpId - Id from the source of the dump.
+     *  @param[in] size - Size of the dump.
+     */
+    void notify(NewDump::DumpType dumpType, uint32_t dumpId,
+                uint64_t size) override;
+};
+
+} // namespace system
+} // namespace dump
+} // namespace phosphor