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