blob: 529ca21b7cf2d72b26db70352c04334a70c588e8 [file] [log] [blame]
Jayanth Othayotha320c7c2017-06-14 07:17:21 -05001#pragma once
2
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -05003#include "xyz/openbmc_project/Dump/Internal/Create/server.hpp"
4
Jayanth Othayotha320c7c2017-06-14 07:17:21 -05005#include <sdbusplus/bus.hpp>
6#include <sdbusplus/server/object.hpp>
7
Jayanth Othayotha320c7c2017-06-14 07:17:21 -05008namespace phosphor
9{
10namespace dump
11{
Brad Bishopae871bd2018-10-18 16:32:05 -040012
13class Manager;
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050014namespace internal
15{
16
17using CreateIface = sdbusplus::server::object::object<
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -050018 sdbusplus::xyz::openbmc_project::Dump::Internal::server::Create>;
Jayanth Othayothd3273ea2017-07-12 22:55:32 -050019using Mgr = phosphor::dump::Manager;
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050020
21/** @class Manager
22 * @brief Implementation for the
23 * xyz.openbmc_project.Dump.Internal.Create DBus API.
24 */
25class Manager : public CreateIface
26{
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -050027 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 Othayotha320c7c2017-06-14 07:17:21 -050034
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -050035 /** @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 Othayotha320c7c2017-06-14 07:17:21 -050042
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -050043 /** @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 Othayotha320c7c2017-06-14 07:17:21 -050055};
56
57} // namespace internal
58} // namespace dump
59} // namespace phosphor