Matt Spinler | ebf6989 | 2024-05-17 14:56:16 -0500 | [diff] [blame^] | 1 | #pragma once |
| 2 | #include <sdbusplus/async/context.hpp> |
| 3 | #include <xyz/openbmc_project/State/BMC/Redundancy/server.hpp> |
| 4 | |
| 5 | namespace bmc::redundancy |
| 6 | { |
| 7 | |
| 8 | using RedundancyIntf = |
| 9 | sdbusplus::xyz::openbmc_project::State::BMC::server::Redundancy; |
| 10 | using RedundancyInterface = sdbusplus::server::object_t<RedundancyIntf>; |
| 11 | |
| 12 | class Manager |
| 13 | { |
| 14 | public: |
| 15 | ~Manager() = default; |
| 16 | Manager(const Manager&) = delete; |
| 17 | Manager& operator=(const Manager&) = delete; |
| 18 | Manager(Manager&&) = delete; |
| 19 | Manager& operator=(Manager&&) = delete; |
| 20 | |
| 21 | /** |
| 22 | * @brief Constructor |
| 23 | * |
| 24 | * @param cts - The async context object |
| 25 | */ |
| 26 | explicit Manager(sdbusplus::async::context& ctx); |
| 27 | |
| 28 | private: |
| 29 | /** |
| 30 | * @brief Kicks off the Manager startup as a coroutine |
| 31 | */ |
| 32 | sdbusplus::async::task<> startup(); |
| 33 | |
| 34 | /** |
| 35 | * @brief Determines the BMC role, active or passive |
| 36 | */ |
| 37 | void determineRole(); |
| 38 | |
| 39 | /** |
| 40 | * @brief The async context object |
| 41 | */ |
| 42 | sdbusplus::async::context& ctx; |
| 43 | |
| 44 | /** |
| 45 | * @brief The Redundancy D-Bus interface |
| 46 | */ |
| 47 | RedundancyInterface redundancyInterface; |
| 48 | }; |
| 49 | |
| 50 | } // namespace bmc::redundancy |