blob: ec9ba107be8db9799bddd982432f5af120bc585c [file] [log] [blame]
kasunath7cea1b92022-06-14 20:23:27 -07001#pragma once
2
3#include "dbus/file_notifier.hpp"
4
kasunath3d0cd552022-08-25 20:22:58 -07005#include <sdbusplus/asio/object_server.hpp>
6
kasunath7cea1b92022-06-14 20:23:27 -07007#include <memory>
8#include <vector>
9
10namespace bios_bmc_smm_error_logger
11{
12namespace rde
13{
14
15/**
16 * @brief A class to handle CPER DBus notification objects.
17 */
18class CperFileNotifierHandler
19{
20 public:
21 /**
22 * @brief Constructor for the CperFileNotifierHandler class.
23 *
kasunath3d0cd552022-08-25 20:22:58 -070024 * @param conn - sdbusplus asio connection.
kasunath7cea1b92022-06-14 20:23:27 -070025 */
kasunath3d0cd552022-08-25 20:22:58 -070026 explicit CperFileNotifierHandler(
27 const std::shared_ptr<sdbusplus::asio::connection>& conn);
kasunath7cea1b92022-06-14 20:23:27 -070028
29 /**
30 * @brief Create a DBus object with the provided filePath value.
31 *
32 * @param filePath - file path of the CPER log JSON file.
33 */
34 void createEntry(const std::string& filePath);
35
36 private:
Patrick Williamsbea36e22022-07-22 19:26:57 -050037 sdbusplus::server::manager_t objManager;
kasunath3d0cd552022-08-25 20:22:58 -070038 sdbusplus::asio::object_server objServer;
kasunath7cea1b92022-06-14 20:23:27 -070039
40 /**
kasunath7cea1b92022-06-14 20:23:27 -070041 * @brief DBus index of the next entry.
42 */
43 uint64_t nextEntry = 0;
44};
45
46} // namespace rde
47} // namespace bios_bmc_smm_error_logger