-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbmc_dump_entry.hpp
73 lines (64 loc) · 2.28 KB
/
bmc_dump_entry.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once
#include "bmcstored_dump_entry.hpp"
#include "xyz/openbmc_project/Common/GeneratedBy/server.hpp"
#include "xyz/openbmc_project/Dump/Entry/BMC/server.hpp"
#include <sdbusplus/bus.hpp>
#include <sdbusplus/server/object.hpp>
#include <filesystem>
namespace phosphor
{
namespace dump
{
namespace bmc
{
template <typename T>
using ServerObject = typename sdbusplus::server::object::object<T>;
using EntryIfaces = sdbusplus::server::object::object<
sdbusplus::xyz::openbmc_project::Common::server::GeneratedBy,
sdbusplus::xyz::openbmc_project::Dump::Entry::server::BMC>;
class Manager;
/** @class Entry
* @brief OpenBMC Dump Entry implementation.
* @details A concrete implementation for the
* xyz.openbmc_project.Dump.Entry DBus API
*/
class Entry :
virtual public EntryIfaces,
virtual public phosphor::dump::bmc_stored::Entry
{
public:
Entry() = delete;
Entry(const Entry&) = delete;
Entry& operator=(const Entry&) = delete;
Entry(Entry&&) = delete;
Entry& operator=(Entry&&) = delete;
~Entry() = default;
/** @brief Constructor for the Dump Entry Object
* @param[in] bus - Bus to attach to.
* @param[in] objPath - Object path to attach to
* @param[in] dumpId - Dump id.
* @param[in] timeStamp - Dump creation timestamp
* since the epoch.
* @param[in] fileSize - Dump file size in bytes.
* @param[in] file - Name of dump file.
* @param[in] status - status of the dump.
* @param[in] parent - The dump entry's parent.
*/
Entry(sdbusplus::bus::bus& bus, const std::string& objPath, uint32_t dumpId,
uint64_t timeStamp, uint64_t fileSize,
const std::filesystem::path& file, std::string genId,
phosphor::dump::OperationStatus status,
phosphor::dump::Manager& parent) :
EntryIfaces(bus, objPath.c_str(), EntryIfaces::action::defer_emit),
phosphor::dump::bmc_stored::Entry(bus, objPath.c_str(), dumpId,
timeStamp, fileSize, file, status,
parent)
{
generatorId(genId);
// Emit deferred signal.
this->phosphor::dump::bmc::EntryIfaces::emit_object_added();
}
};
} // namespace bmc
} // namespace dump
} // namespace phosphor