blob: 8a535e19e16006eee25aa84b47ed5c5f001da210 [file] [log] [blame]
Dhruvaraj Subhashchandran4a98e8f2020-01-29 07:11:08 -06001#pragma once
2
3#include "dump_entry.hpp"
4#include "xyz/openbmc_project/Dump/Entry/BMC/server.hpp"
5#include "xyz/openbmc_project/Dump/Entry/server.hpp"
6#include "xyz/openbmc_project/Object/Delete/server.hpp"
7#include "xyz/openbmc_project/Time/EpochTime/server.hpp"
8
9#include <experimental/filesystem>
10#include <sdbusplus/bus.hpp>
11#include <sdbusplus/server/object.hpp>
12
13namespace phosphor
14{
15namespace dump
16{
17namespace bmc
18{
19template <typename T>
20using ServerObject = typename sdbusplus::server::object::object<T>;
21
22using EntryIfaces = sdbusplus::server::object::object<
23 sdbusplus::xyz::openbmc_project::Dump::Entry::server::BMC>;
24
25namespace fs = std::experimental::filesystem;
26
27class Manager;
28
29/** @class Entry
30 * @brief OpenBMC Dump Entry implementation.
31 * @details A concrete implementation for the
32 * xyz.openbmc_project.Dump.Entry DBus API
33 */
34class Entry : virtual public EntryIfaces, virtual public phosphor::dump::Entry
35{
36 public:
37 Entry() = delete;
38 Entry(const Entry&) = delete;
39 Entry& operator=(const Entry&) = delete;
40 Entry(Entry&&) = delete;
41 Entry& operator=(Entry&&) = delete;
42 ~Entry() = default;
43
44 /** @brief Constructor for the Dump Entry Object
45 * @param[in] bus - Bus to attach to.
46 * @param[in] objPath - Object path to attach to
47 * @param[in] dumpId - Dump id.
48 * @param[in] timeStamp - Dump creation timestamp
49 * since the epoch.
50 * @param[in] fileSize - Dump file size in bytes.
51 * @param[in] file - Name of dump file.
52 * @param[in] parent - The dump entry's parent.
53 */
54 Entry(sdbusplus::bus::bus& bus, const std::string& objPath, uint32_t dumpId,
55 uint64_t timeStamp, uint64_t fileSize, const fs::path& file,
56 phosphor::dump::Manager& parent) :
57 EntryIfaces(bus, objPath.c_str(), true),
58 phosphor::dump::Entry(bus, objPath.c_str(), dumpId, timeStamp, fileSize,
59 parent),
60 file(file){};
61
62 /** @brief Delete this d-bus object.
63 */
64 void delete_() override;
65
66 private:
67 /** @Dump file name */
68 fs::path file;
69};
70
71} // namespace bmc
72} // namespace dump
73} // namespace phosphor