Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QDBusPendingReply< T1, T2, T3, T4, T5, T6, T7, T8 > Class Template Reference

Inheritance diagram for QDBusPendingReply< T1, T2, T3, T4, T5, T6, T7, T8 >:

QDBusPendingCall

List of all members.


Detailed Description

template<typename T1 = void, typename T2 = void, typename T3 = void, typename T4 = void, typename T5 = void, typename T6 = void, typename T7 = void, typename T8 = void>
class QDBusPendingReply< T1, T2, T3, T4, T5, T6, T7, T8 >

The QDBusPendingReply class contains the reply to an asynchronous method call.

QtDBus

Since:
4.5
The QDBusPendingReply is a template class with up to 8 template parameters. Those parameters are the types that will be used to extract the contents of the reply's data.

This class is similar in functionality to QDBusReply, but with two important differences:

QDBusReply accepts exactly one return type, whereas QDBusPendingReply can have from 1 to 8 types QDBusReply only works on already completed replies, whereas QDBusPendingReply allows one to wait for replies from pending calls

Where with QDBusReply you would write:

doc/src/snippets/code/src_qdbus_qdbusreply.cpp 0

with QDBusPendingReply, the equivalent code (including the blocking wait for the reply) would be:

doc/src/snippets/code/src.qdbus.qdbuspendingreply.cpp 0

For method calls that have more than one output argument, with QDBusReply, you would write:

doc/src/snippets/code/src_qdbus_qdbusreply.cpp 1

whereas with QDBusPendingReply, all of the output arguments should be template parameters:

doc/src/snippets/code/src.qdbus.qdbuspendingreply.cpp 2

QDBusPendingReply objects can be associated with QDBusPendingCallWatcher objects, which emit signals when the reply arrives.

See also:
QDBusPendingCallWatcher, QDBusReply, QDBusAbstractInterface::asyncCall()

Definition at line 108 of file qdbuspendingreply.h.


Public Types

enum  { Count = ForEach::Total }

Public Member Functions

template<int Index>
const Select< Index >::Type argumentAt () const
int count () const
QDBusError error () const
bool isError () const
bool isFinished () const
bool isValid () const
 operator typename Select< 0 >::Type () const
QDBusPendingReplyoperator= (const QDBusMessage &message)
QDBusPendingReplyoperator= (const QDBusPendingCall &call)
QDBusPendingReplyoperator= (const QDBusPendingReply &other)
 QDBusPendingReply (const QDBusMessage &message)
 QDBusPendingReply (const QDBusPendingCall &call)
 QDBusPendingReply (const QDBusPendingReply &other)
 QDBusPendingReply ()
QDBusMessage reply () const
Select< 0 >::Type value () const
void waitForFinished ()

Protected Member Functions

QVariant argumentAt (int index) const
void setMetaTypes (int count, const int *metaTypes)

Protected Attributes

QExplicitlySharedDataPointer
< QDBusPendingCallPrivate > 
d

Private Types

typedef
QDBusPendingReplyTypes::ForEach
< T1, T2, T3, T4, T5, T6, T7,
T8 > 
ForEach

Private Member Functions

void assign (const QDBusMessage &message)
void assign (const QDBusPendingCall &call)
void calculateMetaTypes ()

Friends

class QDBusConnection
class QDBusPendingCallPrivate
class QDBusPendingCallWatcher

Classes

struct  Select

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

Generated by  Doxygen 1.6.0   Back to index