4 #ifndef SWIFT_SIM_XSWIFTBUS_DBUSASYNCCALLBACKS_H
5 #define SWIFT_SIM_XSWIFTBUS_DBUSASYNCCALLBACKS_H
15 class DBusAsyncCallbacks
18 DBusAsyncCallbacks() =
default;
19 DBusAsyncCallbacks(
const std::function<dbus_bool_t(T *)> &add,
const std::function<
void(T *)> &remove,
20 const std::function<
void(T *)> &toggled)
21 : m_addHandler(add), m_removeHandler(remove), m_toggledHandler(toggled)
24 static dbus_bool_t add(T *watch,
void *refcon)
26 return static_cast<DBusAsyncCallbacks *
>(refcon)->m_addHandler(watch);
29 static void remove(T *watch,
void *refcon)
31 return static_cast<DBusAsyncCallbacks *
>(refcon)->m_removeHandler(watch);
34 static void toggled(T *watch,
void *refcon)
36 return static_cast<DBusAsyncCallbacks *
>(refcon)->m_toggledHandler(watch);
40 std::function<dbus_bool_t(T *)> m_addHandler;
41 std::function<void(T *)> m_removeHandler;
42 std::function<void(T *)> m_toggledHandler;
Plugin loaded by X-Plane which publishes a DBus service.