#include <pendingcall_p.h>

Inheritance diagram for DBus::PendingCall:
Inheritance graph

Public Member Functions

 Private (DBusPendingCall *)
 
 ~Private ()
 
 PendingCall (Private *)
 
 PendingCall (const PendingCall &)
 
virtual ~PendingCall ()
 
PendingCalloperator= (const PendingCall &)
 
bool completed ()
 Checks whether the pending call has received a reply yet, or not. More...
 
void cancel ()
 Cancels the pending call, such that any reply or error received will just be ignored. More...
 
void block ()
 Block until the pending call is completed. More...
 
void data (void *data)
 Stores a pointer on a PendingCall, along with an optional function to be used for freeing the data when the data is set again, or when the pending call is finalized. More...
 
void * data ()
 Retrieves data previously set with dbus_pending_call_set_data(). More...
 
Slot< void, PendingCall & > & slot ()
 
Message steal_reply ()
 Gets the reply. More...
 

Static Public Member Functions

static void notify_stub (DBusPendingCall *dpc, void *data)
 

Public Attributes

DBusPendingCall * call
 
int dataslot
 
Slot< void, PendingCall & > slot
 

Private Attributes

RefPtrI< Private_pvt
 

Friends

struct Private
 
class Connection
 

Detailed Description

Definition at line 40 of file pendingcall_p.h.

Constructor & Destructor Documentation

◆ ~Private()

DBus::PendingCall::~Private ( )

◆ PendingCall() [1/2]

DBus::PendingCall::PendingCall ( Private )

◆ PendingCall() [2/2]

PendingCall::PendingCall ( const PendingCall c)

Definition at line 72 of file pendingcall.cpp.

References _pvt.

◆ ~PendingCall()

PendingCall::~PendingCall ( )
virtual

Definition at line 78 of file pendingcall.cpp.

References _pvt.

Member Function Documentation

◆ block()

void PendingCall::block ( )

Block until the pending call is completed.

The blocking is as with Connection::send_blocking(); it does not enter the main loop or process other messages, it simply waits for the reply in question.

If the pending call is already completed, this function returns immediately.

Definition at line 104 of file pendingcall.cpp.

References _pvt.

◆ cancel()

void PendingCall::cancel ( )

Cancels the pending call, such that any reply or error received will just be ignored.

Drops the dbus library's internal reference to the DBusPendingCall so will free the call if nobody else is holding a reference. However you usually get a reference from Connection::send_async() so probably your app owns a ref also.

Note that canceling a pending call will not simulate a timed-out call; if a call times out, then a timeout error reply is received. If you cancel the call, no reply is received unless the the reply was already received before you canceled.

Definition at line 99 of file pendingcall.cpp.

References _pvt.

◆ completed()

bool PendingCall::completed ( )

Checks whether the pending call has received a reply yet, or not.

Returns
true If a reply has been received.

Definition at line 94 of file pendingcall.cpp.

References _pvt.

◆ data() [1/2]

void * PendingCall::data ( )

Retrieves data previously set with dbus_pending_call_set_data().

The slot must still be allocated (must not have been freed).

Returns
The data, or NULL if not found.

Definition at line 117 of file pendingcall.cpp.

References _pvt.

◆ data() [2/2]

void PendingCall::data ( void *  data)

Stores a pointer on a PendingCall, along with an optional function to be used for freeing the data when the data is set again, or when the pending call is finalized.

The slot is allocated automatic.

Parameters
dataThe data to store.
Exceptions
ErrorNoMemory

Definition at line 109 of file pendingcall.cpp.

References _pvt.

◆ notify_stub()

static void DBus::PendingCall::notify_stub ( DBusPendingCall *  dpc,
void *  data 
)
static

◆ operator=()

PendingCall & PendingCall::operator= ( const PendingCall c)

Definition at line 83 of file pendingcall.cpp.

References _pvt.

◆ Private()

DBus::PendingCall::Private ( DBusPendingCall *  )

◆ slot()

Slot< void, PendingCall & > & DBus::PendingCall::slot ( )
Returns
The data slot.

◆ steal_reply()

Message PendingCall::steal_reply ( )

Gets the reply.

Ownership of the reply message passes to the caller. This function can only be called once per pending call, since the reply message is tranferred to the caller.

Returns
The reply Message.
Exceptions
ErrorNoReply

Definition at line 127 of file pendingcall.cpp.

References _pvt, and DBus::Message::Private().

Friends And Related Function Documentation

◆ Connection

friend class Connection
friend

Definition at line 128 of file pendingcall.h.

◆ Private

friend struct Private
friend

Definition at line 127 of file pendingcall.h.

Referenced by DBus::Connection::send_async().

Member Data Documentation

◆ _pvt

RefPtrI<Private> DBus::PendingCall::_pvt
private

◆ call

DBusPendingCall* DBus::PendingCall::call

Definition at line 42 of file pendingcall_p.h.

◆ dataslot

int DBus::PendingCall::dataslot

Definition at line 43 of file pendingcall_p.h.

◆ slot

Slot< void, PendingCall & > & PendingCall::slot

Definition at line 44 of file pendingcall_p.h.


The documentation for this class was generated from the following files: