kasunath | 7cea1b9 | 2022-06-14 20:23:27 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "dbus/file_notifier.hpp" |
| 4 | |
| 5 | #include <memory> |
| 6 | #include <vector> |
| 7 | |
| 8 | namespace bios_bmc_smm_error_logger |
| 9 | { |
| 10 | namespace rde |
| 11 | { |
| 12 | |
| 13 | /** |
| 14 | * @brief A class to handle CPER DBus notification objects. |
| 15 | */ |
| 16 | class CperFileNotifierHandler |
| 17 | { |
| 18 | public: |
| 19 | /** |
| 20 | * @brief Constructor for the CperFileNotifierHandler class. |
| 21 | * |
| 22 | * @param bus - bus to attache to. |
| 23 | */ |
Patrick Williams | bea36e2 | 2022-07-22 19:26:57 -0500 | [diff] [blame] | 24 | explicit CperFileNotifierHandler(sdbusplus::bus_t& bus); |
kasunath | 7cea1b9 | 2022-06-14 20:23:27 -0700 | [diff] [blame] | 25 | |
| 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 Williams | bea36e2 | 2022-07-22 19:26:57 -0500 | [diff] [blame] | 34 | sdbusplus::bus_t& bus; |
| 35 | sdbusplus::server::manager_t objManager; |
kasunath | 7cea1b9 | 2022-06-14 20:23:27 -0700 | [diff] [blame] | 36 | |
| 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 |