42 #ifndef QDBUSPENDINGREPLY_H 43 #define QDBUSPENDINGREPLY_H 45 #include <QtCore/qglobal.h> 46 #include <QtDBus/qdbusmacros.h> 47 #include <QtDBus/qdbusargument.h> 48 #include <QtDBus/qdbuspendingcall.h> 63 void assign(
const QDBusPendingCall &call);
67 void setMetaTypes(
int count,
const int *metaTypes);
72 typename T1,
typename T2,
typename T3,
typename T4,
73 typename T5,
typename T6,
typename T7,
typename T8>
76 typedef Select<Index - 1, T2, T3, T4, T5, T6, T7, T8,
void>
Next;
79 template<
typename T1,
typename T2,
typename T3,
typename T4,
80 typename T5,
typename T6,
typename T7,
typename T8>
81 struct Select<0, T1, T2, T3, T4, T5, T6, T7, T8>
87 {
return qMetaTypeId<T1>(); }
90 {
return qMetaTypeId<QDBusVariant>(); }
92 template<
typename T1,
typename T2,
typename T3,
typename T4,
93 typename T5,
typename T6,
typename T7,
typename T8>
97 enum { Total = Next::Total + 1 };
100 *p = metaTypeFor<T1>(0);
101 Next::fillMetaTypes(++p);
105 struct ForEach<void, void, void, void, void, void, void, void>
108 static inline void fillMetaTypes(
int *)
113 template<
typename T1 = void,
typename T2 = void,
typename T3 = void,
typename T4 = void,
114 typename T5 = void,
typename T6 = void,
typename T7 = void,
typename T8 =
void>
141 { assign(other);
return *
this; }
143 { assign(call);
return *
this; }
145 { assign(message);
return *
this; }
147 inline int count()
const {
return Count; }
149 #if defined(Q_QDOC) || defined(Q_NO_USING_KEYWORD) 157 bool isFinished()
const;
158 void waitForFinished();
160 bool isValid()
const;
161 bool isError()
const;
165 template<
int Index>
inline Type argumentAt()
const;
166 inline T1 value()
const;
167 inline operator T1()
const;
169 template<
int Index>
inline 173 Q_ASSERT_X(Index < count() && Index >= 0,
"QDBusPendingReply::argumentAt",
174 "Index out of bounds");
176 return qdbus_cast<ResultType>(argumentAt(Index), 0);
181 return argumentAt<0>();
186 return argumentAt<0>();
194 int typeIds[Count > 0 ? Count : 1];
196 setMetaTypes(Count, typeIds);
202 calculateMetaTypes();
208 calculateMetaTypes();
The QVariant class acts like a union for the most common Qt data types.
QDBusPendingReply & operator=(const QDBusPendingCall &call)
Makes this object take its contents from the call pending call and drops the reference to the current...
#define QT_END_NAMESPACE
This macro expands to.
QDBusPendingReply(const QDBusPendingReply &other)
Creates a copy of the other QDBusPendingReply object.
static void fillMetaTypes(int *p)
T qdbus_cast(const QDBusArgument &arg)
QDBusPendingReply(const QDBusMessage &message)
Creates a QDBusPendingReply object that will take its contents from the message message.
The QDBusError class represents an error received from the D-Bus bus or from remote applications foun...
The QDBusPendingCall class refers to one pending asynchronous call.
QDBusPendingReply()
Creates an empty QDBusPendingReply object.
QDBusPendingReply & operator=(const QDBusPendingReply &other)
Makes a copy of other and drops the reference to the current pending call.
int count() const
Return the number of arguments the reply is supposed to have.
int metaTypeFor< QVariant >(QVariant *)
void assign(const QDBusMessage &message)
Select< Index - 1, T2, T3, T4, T5, T6, T7, T8, void > Next
#define QT_BEGIN_NAMESPACE
This macro expands to.
QDBusPendingReply(const QDBusPendingCall &call)
Creates a QDBusPendingReply object that will take its contents from the call pending asynchronous cal...
QDBusPendingReply & operator=(const QDBusMessage &message)
Makes this object take its contents from the message message and drops the reference to the current p...
#define Q_ASSERT_X(cond, where, what)
The QDBusMessage class represents one message sent or received over the D-Bus bus.
void calculateMetaTypes()
The QDBusPendingReply class contains the reply to an asynchronous method call.
QVariant argumentAt(int index) const
Returns the argument at position index in the reply's contents.
void assign(const QDBusPendingCall &call)
void assign(const QDBusPendingCall &call)
QDBusPendingReplyTypes::ForEach< T1, T2, T3, T4, T5, T6, T7, T8 > ForEach
ForEach< T2, T3, T4, T5, T6, T7, T8, void > Next
QVariant argumentAt(int index) const