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