blob: 9f5a796fb8b3dbc89a2c28cbc73f288a544fc784 [file] [log] [blame]
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +05301#pragma once
2#include <tuple>
3#include <systemd/sd-bus.h>
4#include <sdbusplus/server.hpp>
5
6namespace sdbusplus
7{
8namespace xyz
9{
10namespace openbmc_project
11{
12namespace Led
13{
14namespace server
15{
16
17class 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