Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 3 | #include "manager.hpp" |
| 4 | |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 5 | #include <sdbusplus/bus.hpp> |
| 6 | #include <sdbusplus/server/object.hpp> |
Andrew Geissler | d02c3cb | 2020-05-16 10:28:02 -0500 | [diff] [blame^] | 7 | #include <string> |
Vishwanatha Subbanna | 55ef5b0 | 2017-03-10 13:32:08 +0530 | [diff] [blame] | 8 | #include <xyz/openbmc_project/Led/Group/server.hpp> |
Andrew Geissler | d02c3cb | 2020-05-16 10:28:02 -0500 | [diff] [blame^] | 9 | |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 10 | namespace phosphor |
| 11 | { |
| 12 | namespace led |
| 13 | { |
| 14 | |
| 15 | /** @class Group |
| 16 | * @brief Manages group of LEDs and applies action on the elements of group |
| 17 | */ |
| 18 | class Group : sdbusplus::server::object::object< |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 19 | sdbusplus::xyz::openbmc_project::Led::server::Group> |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 20 | { |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 21 | public: |
| 22 | Group() = delete; |
| 23 | ~Group() = default; |
| 24 | Group(const Group&) = delete; |
| 25 | Group& operator=(const Group&) = delete; |
| 26 | Group(Group&&) = default; |
| 27 | Group& operator=(Group&&) = default; |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 28 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 29 | /** @brief Constructs LED Group |
| 30 | * |
| 31 | * @param[in] bus - Handle to system dbus |
| 32 | * @param[in] objPath - The Dbus path that hosts LED group |
| 33 | * @param[in] manager - Reference to Manager |
| 34 | */ |
| 35 | Group(sdbusplus::bus::bus& bus, const std::string& objPath, |
| 36 | Manager& manager) : |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 37 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 38 | sdbusplus::server::object::object< |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 39 | sdbusplus::xyz::openbmc_project::Led::server::Group>( |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 40 | bus, objPath.c_str()), |
| 41 | path(objPath), manager(manager) |
| 42 | { |
| 43 | // Nothing to do here |
| 44 | } |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 45 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 46 | /** @brief Property SET Override function |
| 47 | * |
| 48 | * @param[in] value - True or False |
| 49 | * @return - Success or exception thrown |
| 50 | */ |
| 51 | bool asserted(bool value) override; |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 52 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 53 | private: |
| 54 | /** @brief Path of the group instance */ |
| 55 | std::string path; |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 56 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 57 | /** @brief Reference to Manager object */ |
| 58 | Manager& manager; |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | } // namespace led |
| 62 | } // namespace phosphor |