blob: e90fa719db043ea353cea2efe77c555a9c455282 [file] [log] [blame]
kasunath7cea1b92022-06-14 20:23:27 -07001#pragma once
2
3#include "dbus/file_notifier.hpp"
4
5#include <memory>
6#include <vector>
7
8namespace bios_bmc_smm_error_logger
9{
10namespace rde
11{
12
13/**
14 * @brief A class to handle CPER DBus notification objects.
15 */
16class CperFileNotifierHandler
17{
18 public:
19 /**
20 * @brief Constructor for the CperFileNotifierHandler class.
21 *
22 * @param bus - bus to attache to.
23 */
Patrick Williamsbea36e22022-07-22 19:26:57 -050024 explicit CperFileNotifierHandler(sdbusplus::bus_t& bus);
kasunath7cea1b92022-06-14 20:23:27 -070025
26 /**
27 * @brief Create a DBus object with the provided filePath value.
28 *
29 * @param filePath - file path of the CPER log JSON file.
30 */
31 void createEntry(const std::string& filePath);
32
33 private:
Patrick Williamsbea36e22022-07-22 19:26:57 -050034 sdbusplus::bus_t& bus;
35 sdbusplus::server::manager_t objManager;
kasunath7cea1b92022-06-14 20:23:27 -070036
37 /**
38 * @brief A vector to keep track of DBus FilePath objects.
39 */
40 std::vector<std::unique_ptr<CperFileNotifier>> notifierObjs;
41
42 /**
43 * @brief DBus index of the next entry.
44 */
45 uint64_t nextEntry = 0;
46};
47
48} // namespace rde
49} // namespace bios_bmc_smm_error_logger