blob: 4e0a283d501f507bd2cd7a6dfdd91f65aa8d1512 [file] [log] [blame]
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +05301#pragma once
2
Patrick Venture91ac8d32018-11-01 17:03:22 -07003#include "manager.hpp"
4
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +05305#include <sdbusplus/bus.hpp>
6#include <sdbusplus/server/object.hpp>
Vishwanatha Subbanna55ef5b02017-03-10 13:32:08 +05307#include <xyz/openbmc_project/Led/Group/server.hpp>
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +05308namespace phosphor
9{
10namespace led
11{
12
13/** @class Group
14 * @brief Manages group of LEDs and applies action on the elements of group
15 */
16class Group : sdbusplus::server::object::object<
Patrick Venture91ac8d32018-11-01 17:03:22 -070017 sdbusplus::xyz::openbmc_project::Led::server::Group>
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +053018{
Patrick Venture91ac8d32018-11-01 17:03:22 -070019 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 Subbanna4c8c72b2016-11-29 23:02:06 +053026
Patrick Venture91ac8d32018-11-01 17:03:22 -070027 /** @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 Subbanna4c8c72b2016-11-29 23:02:06 +053035
Patrick Venture91ac8d32018-11-01 17:03:22 -070036 sdbusplus::server::object::object<
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +053037 sdbusplus::xyz::openbmc_project::Led::server::Group>(
Patrick Venture91ac8d32018-11-01 17:03:22 -070038 bus, objPath.c_str()),
39 path(objPath), manager(manager)
40 {
41 // Nothing to do here
42 }
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +053043
Patrick Venture91ac8d32018-11-01 17:03:22 -070044 /** @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 Subbanna4c8c72b2016-11-29 23:02:06 +053050
Patrick Venture91ac8d32018-11-01 17:03:22 -070051 private:
52 /** @brief Path of the group instance */
53 std::string path;
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +053054
Patrick Venture91ac8d32018-11-01 17:03:22 -070055 /** @brief Reference to Manager object */
56 Manager& manager;
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +053057};
58
59} // namespace led
60} // namespace phosphor