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 | { |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 12 | namespace bmc |
| 13 | { |
Brad Bishop | ae871bd | 2018-10-18 16:32:05 -0400 | [diff] [blame] | 14 | |
| 15 | class Manager; |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 16 | namespace internal |
| 17 | { |
| 18 | |
Patrick Williams | 9b18bf2 | 2022-07-22 19:26:55 -0500 | [diff] [blame] | 19 | using CreateIface = sdbusplus::server::object_t< |
Jayanth Othayoth | cb65ffc | 2018-10-16 08:29:32 -0500 | [diff] [blame] | 20 | sdbusplus::xyz::openbmc_project::Dump::Internal::server::Create>; |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 21 | using Mgr = phosphor::dump::bmc::Manager; |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 22 | |
| 23 | /** @class Manager |
| 24 | * @brief Implementation for the |
| 25 | * xyz.openbmc_project.Dump.Internal.Create DBus API. |
| 26 | */ |
| 27 | class Manager : public CreateIface |
| 28 | { |
Jayanth Othayoth | cb65ffc | 2018-10-16 08:29:32 -0500 | [diff] [blame] | 29 | public: |
| 30 | Manager() = delete; |
| 31 | Manager(const Manager&) = delete; |
| 32 | Manager& operator=(const Manager&) = delete; |
| 33 | Manager(Manager&&) = delete; |
| 34 | Manager& operator=(Manager&&) = delete; |
| 35 | virtual ~Manager() = default; |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 36 | |
Jayanth Othayoth | cb65ffc | 2018-10-16 08:29:32 -0500 | [diff] [blame] | 37 | /** @brief Constructor to put object onto bus at a dbus path. |
| 38 | * @param[in] bus - Bus to attach to. |
| 39 | * @param[in] dumpMgr - Dump Manager object |
| 40 | * @param[in] path - Path to attach at. |
| 41 | */ |
Patrick Williams | 9b18bf2 | 2022-07-22 19:26:55 -0500 | [diff] [blame] | 42 | Manager(sdbusplus::bus_t& bus, Mgr& dumpMgr, const char* path) : |
Jayanth Othayoth | cb65ffc | 2018-10-16 08:29:32 -0500 | [diff] [blame] | 43 | CreateIface(bus, path), dumpMgr(dumpMgr){}; |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 44 | |
Jayanth Othayoth | cb65ffc | 2018-10-16 08:29:32 -0500 | [diff] [blame] | 45 | /** @brief Implementation for Create |
| 46 | * Create BMC Dump based on the Dump type. |
| 47 | * |
| 48 | * @param[in] type - Type of the Dump. |
| 49 | * @param[in] fullPaths - List of absolute paths to the files |
| 50 | * to be included as part of Dump package. |
| 51 | */ |
| 52 | void create(Type type, std::vector<std::string> fullPaths) override; |
| 53 | |
| 54 | private: |
| 55 | /** @brief Dump Manager object. */ |
| 56 | Mgr& dumpMgr; |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | } // namespace internal |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 60 | } // namespace bmc |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 61 | } // namespace dump |
| 62 | } // namespace phosphor |