Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | #include <tuple> |
| 3 | #include <systemd/sd-bus.h> |
| 4 | #include <sdbusplus/server.hpp> |
| 5 | |
| 6 | namespace sdbusplus |
| 7 | { |
| 8 | namespace xyz |
| 9 | { |
| 10 | namespace openbmc_project |
| 11 | { |
| 12 | namespace Led |
| 13 | { |
| 14 | namespace server |
| 15 | { |
| 16 | |
| 17 | class Group |
| 18 | { |
| 19 | public: |
| 20 | /* Define all of the basic class operations: |
| 21 | * Not allowed: |
| 22 | * - Default constructor to avoid nullptrs. |
| 23 | * - Copy operations due to internal unique_ptr. |
| 24 | * Allowed: |
| 25 | * - Move operations. |
| 26 | * - Destructor. |
| 27 | */ |
| 28 | Group() = delete; |
| 29 | Group(const Group&) = delete; |
| 30 | Group& operator=(const Group&) = delete; |
| 31 | Group(Group&&) = default; |
| 32 | Group& operator=(Group&&) = default; |
| 33 | virtual ~Group() = default; |
| 34 | |
| 35 | /** @brief Constructor to put object onto bus at a dbus path. |
| 36 | * @param[in] bus - Bus to attach to. |
| 37 | * @param[in] path - Path to attach at. |
| 38 | */ |
| 39 | Group(bus::bus& bus, const char* path); |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | /** Get value of Asserted */ |
| 45 | virtual bool asserted() const; |
| 46 | /** Set value of Asserted */ |
| 47 | virtual bool asserted(bool value); |
| 48 | |
| 49 | |
| 50 | private: |
| 51 | |
| 52 | /** @brief sd-bus callback for get-property 'Asserted' */ |
| 53 | static int _callback_get_Asserted( |
| 54 | sd_bus*, const char*, const char*, const char*, |
| 55 | sd_bus_message*, void*, sd_bus_error*); |
| 56 | /** @brief sd-bus callback for set-property 'Asserted' */ |
| 57 | static int _callback_set_Asserted( |
| 58 | sd_bus*, const char*, const char*, const char*, |
| 59 | sd_bus_message*, void*, sd_bus_error*); |
| 60 | |
| 61 | |
| 62 | static constexpr auto _interface = "xyz.openbmc_project.Led.Group"; |
| 63 | static const vtable::vtable_t _vtable[]; |
| 64 | sdbusplus::server::interface::interface |
| 65 | _xyz_openbmc_project_Led_Group_interface; |
| 66 | |
| 67 | bool _asserted{}; |
| 68 | |
| 69 | }; |
| 70 | |
| 71 | |
| 72 | } // namespace server |
| 73 | } // namespace Led |
| 74 | } // namespace openbmc_project |
| 75 | } // namespace xyz |
| 76 | } // namespace sdbusplus |
| 77 | |