Matthew Barth | 29e9e38 | 2020-01-23 13:40:49 -0600 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include <interfaces/manager_interface.hpp> |
| 4 | #include <sdbusplus/bus.hpp> |
| 5 | #include <sdbusplus/server/object.hpp> |
| 6 | |
| 7 | namespace phosphor::power::regulators |
| 8 | { |
| 9 | |
| 10 | constexpr auto busName = "xyz.openbmc_project.Power.Regulators"; |
| 11 | constexpr auto objPath = "/xyz/openbmc_project/power/regulators/manager"; |
| 12 | |
| 13 | using ManagerObject = sdbusplus::server::object::object< |
| 14 | phosphor::power::regulators::interface::ManagerInterface>; |
| 15 | |
| 16 | class Manager : public ManagerObject |
| 17 | { |
| 18 | public: |
| 19 | Manager() = delete; |
| 20 | Manager(const Manager&) = delete; |
| 21 | Manager(Manager&&) = delete; |
| 22 | Manager& operator=(const Manager&) = delete; |
| 23 | Manager& operator=(Manager&&) = delete; |
| 24 | ~Manager() = default; |
| 25 | |
| 26 | /** |
| 27 | * Constructor |
| 28 | * Creates a manager over the regulators. |
| 29 | * |
| 30 | * @param[in] bus - the dbus bus |
| 31 | */ |
| 32 | Manager(sdbusplus::bus::bus& bus); |
| 33 | |
| 34 | /** |
| 35 | * @brief Overridden manager object's configure method |
| 36 | */ |
| 37 | void configure() override; |
| 38 | |
| 39 | /** |
| 40 | * @brief Overridden manager object's monitor method |
| 41 | * |
| 42 | * @param[in] enable - Enable or disable regulator monitoring |
| 43 | */ |
| 44 | void monitor(bool enable) override; |
| 45 | |
| 46 | private: |
| 47 | /** |
| 48 | * The dbus bus |
| 49 | */ |
| 50 | sdbusplus::bus::bus& bus; |
| 51 | }; |
| 52 | |
| 53 | } // namespace phosphor::power::regulators |