-
Notifications
You must be signed in to change notification settings - Fork 23
/
elog_block.hpp
60 lines (49 loc) · 1.71 KB
/
elog_block.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
#pragma once
#include "config.h"
#include "xyz/openbmc_project/Logging/ErrorBlocksTransition/server.hpp"
#include <sdbusplus/bus.hpp>
#include <sdbusplus/server/object.hpp>
#include <xyz/openbmc_project/Association/Definitions/server.hpp>
namespace phosphor
{
namespace logging
{
using BlockIface = sdbusplus::server::object_t<
sdbusplus::server::xyz::openbmc_project::logging::ErrorBlocksTransition,
sdbusplus::server::xyz::openbmc_project::association::Definitions>;
using AssociationList =
std::vector<std::tuple<std::string, std::string, std::string>>;
/** @class Block
* @brief OpenBMC logging Block implementation.
* @details A concrete implementation for the
* xyz.openbmc_project.Logging.ErrorBlocksTransition DBus API
*/
class Block : public BlockIface
{
public:
Block() = delete;
Block(const Block&) = delete;
Block& operator=(const Block&) = delete;
Block(Block&&) = delete;
Block& operator=(Block&&) = delete;
virtual ~Block() = default;
/** @brief Constructor to put object onto bus at a dbus path.
* @param[in] bus - Bus to attach to.
* @param[in] path - Path to attach at.
* @param[in] entryId - Distinct ID of the error.
*/
Block(sdbusplus::bus_t& bus, const std::string& path, uint32_t entryId) :
BlockIface(bus, path.c_str()), entryId(entryId)
{
std::string entryPath{
std::string(OBJ_ENTRY) + '/' + std::to_string(entryId)};
AssociationList assoc{
std::make_tuple(std::string{"blocking_error"},
std::string{"blocking_obj"}, entryPath)};
associations(std::move(assoc));
};
uint32_t entryId;
private:
};
} // namespace logging
} // namespace phosphor