Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 1 | #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 | |
| 12 | namespace phosphor |
| 13 | { |
| 14 | namespace dump |
| 15 | { |
| 16 | namespace faultlog |
| 17 | { |
| 18 | template <typename T> |
Patrick Williams | 9b18bf2 | 2022-07-22 19:26:55 -0500 | [diff] [blame] | 19 | using ServerObject = typename sdbusplus::server::object_t<T>; |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 20 | |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 21 | class Manager; |
| 22 | |
| 23 | /** @class Entry |
| 24 | * @brief OpenBMC Fault Log Dump Entry implementation. |
| 25 | */ |
Ed Tanous | 5fd768d | 2023-01-09 09:26:11 -0800 | [diff] [blame] | 26 | class Entry : virtual public phosphor::dump::Entry |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 27 | { |
| 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 Karunanithi | 74a1f39 | 2021-10-27 03:23:59 -0500 | [diff] [blame] | 45 | * @param[in] originatorId - Id of the originator of the dump |
| 46 | * @param[in] originatorType - Originator type |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 47 | * @param[in] parent - The dump entry's parent. |
| 48 | */ |
Patrick Williams | 9b18bf2 | 2022-07-22 19:26:55 -0500 | [diff] [blame] | 49 | Entry(sdbusplus::bus_t& bus, const std::string& objPath, uint32_t dumpId, |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 50 | uint64_t timeStamp, uint64_t fileSize, |
| 51 | const std::filesystem::path& file, |
Asmitha Karunanithi | 74a1f39 | 2021-10-27 03:23:59 -0500 | [diff] [blame] | 52 | phosphor::dump::OperationStatus status, std::string originatorId, |
| 53 | originatorTypes originatorType, phosphor::dump::Manager& parent) : |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 54 | phosphor::dump::Entry(bus, objPath.c_str(), dumpId, timeStamp, fileSize, |
Dhruvaraj Subhashchandran | 64f8da9 | 2021-12-08 03:48:23 -0600 | [diff] [blame] | 55 | file, status, originatorId, originatorType, |
| 56 | parent) |
Ed Tanous | 5fd768d | 2023-01-09 09:26:11 -0800 | [diff] [blame] | 57 | {} |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 58 | |
| 59 | /** @brief Delete this d-bus object. |
| 60 | */ |
| 61 | void delete_() override; |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 62 | }; |
| 63 | |
| 64 | } // namespace faultlog |
| 65 | } // namespace dump |
| 66 | } // namespace phosphor |