Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <sdbusplus/bus.hpp> |
| 4 | #include <sdbusplus/server/object.hpp> |
| 5 | |
| 6 | #include "xyz/openbmc_project/Dump/Internal/Create/server.hpp" |
| 7 | |
| 8 | namespace phosphor |
| 9 | { |
| 10 | namespace dump |
| 11 | { |
| 12 | namespace internal |
| 13 | { |
| 14 | |
| 15 | using CreateIface = sdbusplus::server::object::object< |
| 16 | sdbusplus::xyz::openbmc_project::Dump::Internal::server::Create>; |
Jayanth Othayoth | d3273ea | 2017-07-12 22:55:32 -0500 | [diff] [blame] | 17 | using Mgr = phosphor::dump::Manager; |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 18 | |
| 19 | /** @class Manager |
| 20 | * @brief Implementation for the |
| 21 | * xyz.openbmc_project.Dump.Internal.Create DBus API. |
| 22 | */ |
| 23 | class Manager : public CreateIface |
| 24 | { |
| 25 | public: |
| 26 | Manager() = delete; |
| 27 | Manager(const Manager&) = delete; |
| 28 | Manager& operator=(const Manager&) = delete; |
| 29 | Manager(Manager&&) = delete; |
| 30 | Manager& operator=(Manager&&) = delete; |
| 31 | virtual ~Manager() = default; |
| 32 | |
| 33 | /** @brief Constructor to put object onto bus at a dbus path. |
| 34 | * @param[in] bus - Bus to attach to. |
Jayanth Othayoth | d3273ea | 2017-07-12 22:55:32 -0500 | [diff] [blame] | 35 | * @param[in] dumpMgr - Dump Manager object |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 36 | * @param[in] path - Path to attach at. |
| 37 | */ |
Jayanth Othayoth | d3273ea | 2017-07-12 22:55:32 -0500 | [diff] [blame] | 38 | Manager(sdbusplus::bus::bus& bus, Mgr& dumpMgr, const char* path): |
| 39 | CreateIface(bus, path), |
| 40 | dumpMgr(dumpMgr) {}; |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 41 | |
| 42 | /** @brief Implementation for Create |
| 43 | * Create BMC Dump based on the Dump type. |
| 44 | * |
| 45 | * @param[in] type - Type of the Dump. |
| 46 | * @param[in] fullPaths - List of absolute paths to the files |
| 47 | * to be included as part of Dump package. |
| 48 | */ |
| 49 | void create( |
| 50 | Type type, |
| 51 | std::vector<std::string> fullPaths) override; |
Jayanth Othayoth | d3273ea | 2017-07-12 22:55:32 -0500 | [diff] [blame] | 52 | private: |
| 53 | /** @brief Dump Manager object. */ |
| 54 | Mgr& dumpMgr; |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | } // namespace internal |
| 58 | } // namespace dump |
| 59 | } // namespace phosphor |