DBus::PendingCall Class Reference

#include <pendingcall_p.h>

List of all members.

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.
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.
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.
void * data ()
 Retrieves data previously set with dbus_pending_call_set_data().
Slot< void, PendingCall & > & slot ()
Message steal_reply ()
 Gets the reply.

Static Public Member Functions

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

Public Attributes

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


Detailed Description

Definition at line 39 of file pendingcall_p.h.


Constructor & Destructor Documentation

DBus::PendingCall::~Private (  ) 

DBus::PendingCall::PendingCall ( Private *   ) 

PendingCall::PendingCall ( const PendingCall c  ) 

Definition at line 72 of file pendingcall.cpp.

PendingCall::~PendingCall (  )  [virtual]

Definition at line 78 of file pendingcall.cpp.


Member Function Documentation

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.

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.

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.

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.

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:
data The data to store.
Exceptions:
ErrorNoMemory 

Definition at line 109 of file pendingcall.cpp.

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

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

Definition at line 83 of file pendingcall.cpp.

DBus::PendingCall::Private ( DBusPendingCall *   ) 

Returns:
The data slot.

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 DBus::Message::Private().


Member Data Documentation

DBusPendingCall* DBus::PendingCall::call

Definition at line 41 of file pendingcall_p.h.

Definition at line 42 of file pendingcall_p.h.

Definition at line 43 of file pendingcall_p.h.


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

Generated on Sat Jul 11 11:14:28 2009 for libdbus-c++ by  doxygen 1.5.9