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