blob: 44fcfc65f2b0c91b01cecee31867c584195338e8 [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 -080021/** @class Entry
22 * @brief OpenBMC Fault Log Dump Entry implementation.
23 */
Ed Tanous5fd768d2023-01-09 09:26:11 -080024class Entry : virtual public phosphor::dump::Entry
Claire Weinan919f71c2022-03-01 19:02:07 -080025{
26 public:
27 Entry() = delete;
28 Entry(const Entry&) = delete;
29 Entry& operator=(const Entry&) = delete;
30 Entry(Entry&&) = delete;
31 Entry& operator=(Entry&&) = delete;
32 ~Entry() = default;
33
34 /** @brief Constructor for the Dump Entry Object
35 * @param[in] bus - Bus to attach to.
36 * @param[in] objPath - Object path to attach to
37 * @param[in] dumpId - Dump id.
38 * @param[in] timeStamp - Dump creation timestamp
39 * in microseconds since the epoch.
40 * @param[in] fileSize - Dump file size in bytes.
41 * @param[in] file - Full path of dump file.
42 * @param[in] status - status of the dump.
Asmitha Karunanithi74a1f392021-10-27 03:23:59 -050043 * @param[in] originatorId - Id of the originator of the dump
44 * @param[in] originatorType - Originator type
Claire Weinan919f71c2022-03-01 19:02:07 -080045 * @param[in] parent - The dump entry's parent.
46 */
Patrick Williams9b18bf22022-07-22 19:26:55 -050047 Entry(sdbusplus::bus_t& bus, const std::string& objPath, uint32_t dumpId,
Claire Weinan919f71c2022-03-01 19:02:07 -080048 uint64_t timeStamp, uint64_t fileSize,
49 const std::filesystem::path& file,
Asmitha Karunanithi74a1f392021-10-27 03:23:59 -050050 phosphor::dump::OperationStatus status, std::string originatorId,
51 originatorTypes originatorType, phosphor::dump::Manager& parent) :
Claire Weinan919f71c2022-03-01 19:02:07 -080052 phosphor::dump::Entry(bus, objPath.c_str(), dumpId, timeStamp, fileSize,
Dhruvaraj Subhashchandran64f8da92021-12-08 03:48:23 -060053 file, status, originatorId, originatorType,
54 parent)
Ed Tanous5fd768d2023-01-09 09:26:11 -080055 {}
Claire Weinan919f71c2022-03-01 19:02:07 -080056
57 /** @brief Delete this d-bus object.
58 */
59 void delete_() override;
Claire Weinan919f71c2022-03-01 19:02:07 -080060};
61
62} // namespace faultlog
63} // namespace dump
64} // namespace phosphor