diff options
Diffstat (limited to 'group.hpp')
-rw-r--r-- | group.hpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/group.hpp b/group.hpp new file mode 100644 index 0000000..3a14dc1 --- /dev/null +++ b/group.hpp @@ -0,0 +1,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 |