blob: 3e5b53a004a991f30624e0917ce32eb44a20e83b [file] [log] [blame]
Claire Weinan919f71c2022-03-01 19:02:07 -08001#pragma once
2
3#include "dump_entry.hpp"
4
5#include <sdbusplus/bus.hpp>
6#include <sdbusplus/server/object.hpp>
7#include <xyz/openbmc_project/Object/Delete/server.hpp>
8#include <xyz/openbmc_project/Time/EpochTime/server.hpp>
9
10#include <filesystem>
11
12namespace phosphor
13{
14namespace dump
15{
16namespace faultlog
17{
18template <typename T>
Patrick Williams9b18bf22022-07-22 19:26:55 -050019using ServerObject = typename sdbusplus::server::object_t<T>;
Claire Weinan919f71c2022-03-01 19:02:07 -080020
Claire Weinan919f71c2022-03-01 19:02:07 -080021class Manager;
22
23/** @class Entry
24 * @brief OpenBMC Fault Log Dump Entry implementation.
25 */
Ed Tanous5fd768d2023-01-09 09:26:11 -080026class Entry : virtual public phosphor::dump::Entry
Claire Weinan919f71c2022-03-01 19:02:07 -080027{
28 public:
29 Entry() = delete;
30 Entry(const Entry&) = delete;
31 Entry& operator=(const Entry&) = delete;
32 Entry(Entry&&) = delete;
33 Entry& operator=(Entry&&) = delete;
34 ~Entry() = default;
35
36 /** @brief Constructor for the Dump Entry Object
37 * @param[in] bus - Bus to attach to.
38 * @param[in] objPath - Object path to attach to
39 * @param[in] dumpId - Dump id.
40 * @param[in] timeStamp - Dump creation timestamp
41 * in microseconds since the epoch.
42 * @param[in] fileSize - Dump file size in bytes.
43 * @param[in] file - Full path of dump file.
44 * @param[in] status - status of the dump.
Asmitha Karunanithi74a1f392021-10-27 03:23:59 -050045 * @param[in] originatorId - Id of the originator of the dump
46 * @param[in] originatorType - Originator type
Claire Weinan919f71c2022-03-01 19:02:07 -080047 * @param[in] parent - The dump entry's parent.
48 */
Patrick Williams9b18bf22022-07-22 19:26:55 -050049 Entry(sdbusplus::bus_t& bus, const std::string& objPath, uint32_t dumpId,
Claire Weinan919f71c2022-03-01 19:02:07 -080050 uint64_t timeStamp, uint64_t fileSize,
51 const std::filesystem::path& file,
Asmitha Karunanithi74a1f392021-10-27 03:23:59 -050052 phosphor::dump::OperationStatus status, std::string originatorId,
53 originatorTypes originatorType, phosphor::dump::Manager& parent) :
Claire Weinan919f71c2022-03-01 19:02:07 -080054 phosphor::dump::Entry(bus, objPath.c_str(), dumpId, timeStamp, fileSize,
Dhruvaraj Subhashchandran64f8da92021-12-08 03:48:23 -060055 file, status, originatorId, originatorType,
56 parent)
Ed Tanous5fd768d2023-01-09 09:26:11 -080057 {}
Claire Weinan919f71c2022-03-01 19:02:07 -080058
59 /** @brief Delete this d-bus object.
60 */
61 void delete_() override;
Claire Weinan919f71c2022-03-01 19:02:07 -080062};
63
64} // namespace faultlog
65} // namespace dump
66} // namespace phosphor