summaryrefslogtreecommitdiffstats
path: root/group.hpp
blob: 34f7afde0059e4511a92baa5cb78582da4fedc97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once

#include <sdbusplus/bus.hpp>
#include <sdbusplus/server/object.hpp>
#include <xyz/openbmc_project/Led/Group/server.hpp>
#include "manager.hpp"
namespace phosphor
{
namespace led
{

/** @class Group
 *  @brief Manages group of LEDs and applies action on the elements of group
 */
class Group : sdbusplus::server::object::object<
              sdbusplus::xyz::openbmc_project::Led::server::Group>
{
    public:
        Group() = delete;
        ~Group() = default;
        Group(const Group&) = delete;
        Group& operator=(const Group&) = delete;
        Group(Group&&) = default;
        Group& operator=(Group&&) = default;

        /** @brief Constructs LED Group
         *
         * @param[in] bus     - Handle to system dbus
         * @param[in] objPath - The Dbus path that hosts LED group
         * @param[in] manager - Reference to Manager
         */
        Group(sdbusplus::bus::bus& bus,
              const std::string& objPath,
              Manager& manager) :

            sdbusplus::server::object::object<
            sdbusplus::xyz::openbmc_project::Led::server::Group>(
                    bus, objPath.c_str()),
            path(objPath),
            manager(manager)
        {
            // Nothing to do here
        }

        /** @brief Property SET Override function
         *
         *  @param[in]  value   -  True or False
         *  @return             -  Success or exception thrown
         */
        bool asserted(bool value) override;

    private:
        /** @brief Path of the group instance */
        std::string path;

        /** @brief Reference to Manager object */
        Manager& manager;
};

} // namespace led
} // namespace phosphor
OpenPOWER on IntegriCloud