Go to the documentation of this file.
30 #include <dbus/dbus.h>
38 PendingCall::Private::Private(DBusPendingCall *dpc)
39 : call(dpc), dataslot(-1)
41 if (!dbus_pending_call_allocate_data_slot(&dataslot))
47 PendingCall::Private::~Private()
51 dbus_pending_call_allocate_data_slot(&dataslot);
55 void PendingCall::Private::notify_stub(DBusPendingCall *dpc,
void *data)
66 if (!dbus_pending_call_set_notify(_pvt->call, Private::notify_stub, p, NULL))
75 dbus_pending_call_ref(
_pvt->call);
80 dbus_pending_call_unref(
_pvt->call);
87 dbus_pending_call_unref(
_pvt->call);
89 dbus_pending_call_ref(
_pvt->call);
96 return dbus_pending_call_get_completed(
_pvt->call);
101 dbus_pending_call_cancel(
_pvt->call);
106 dbus_pending_call_block(
_pvt->call);
111 if (!dbus_pending_call_set_data(
_pvt->call,
_pvt->dataslot, p, NULL))
119 return dbus_pending_call_get_data(
_pvt->call,
_pvt->dataslot);
129 DBusMessage *dmsg = dbus_pending_call_steal_reply(
_pvt->call);
132 dbus_bool_t callComplete = dbus_pending_call_get_completed(
_pvt->call);
void * data()
Retrieves data previously set with dbus_pending_call_set_data().
void cancel()
Cancels the pending call, such that any reply or error received will just be ignored.
void block()
Block until the pending call is completed.
PendingCall & operator=(const PendingCall &)
Slot< void, PendingCall & > slot
Message steal_reply()
Gets the reply.
bool completed()
Checks whether the pending call has received a reply yet, or not.