4#ifndef QDBUSPENDINGREPLY_H
5#define QDBUSPENDINGREPLY_H
7#include <QtDBus/qtdbusglobal.h>
8#include <QtDBus/qdbusargument.h>
9#include <QtDBus/qdbuspendingcall.h>
29 template<
int Index,
typename T,
typename...
Types>
35 template<
typename T,
typename...
Types>
42 {
return QMetaType::fromType<T>(); }
45 {
return QMetaType::fromType<QDBusVariant>(); }
49template<
typename...
Types>
54 enum {
Count = std::is_same_v<typename Select<0>::Type,
void> ? 0 :
sizeof...(Types) };
69 { assign(
other);
return *
this; }
71 { assign(call);
return *
this; }
73 { assign(
message);
return *
this; }
76 template<
int Index>
inline
79 static_assert(Index >= 0 && Index <
Count,
"Index out of bounds");
81 return qdbus_cast<ResultType>(
argumentAt(Index));
97 return argumentAt<0>();
102 return argumentAt<0>();
106 inline void calculateMetaTypes()
109 if constexpr (
Count == 0) {
112 std::array<QMetaType, Count> typeIds = { QDBusPendingReplyTypes::metaTypeFor<Types>()... };
120 calculateMetaTypes();
126 calculateMetaTypes();
147 { assign(
other);
return *
this; }
149 { assign(call);
return *
this; }
151 { assign(
message);
return *
this; }
QExplicitlySharedDataPointer< QDBusPendingCallPrivate > d
QDBusMessage reply() const
void setMetaTypes(int count, const QMetaType *metaTypes)
void assign(const QDBusPendingCall &call)
QVariant argumentAt(int index) const
QDBusPendingReply & operator=(const QDBusPendingReply &other)
QDBusPendingReply()=default
QDBusPendingReply(const QDBusPendingReply &other)
Q_IMPLICIT QDBusPendingReply(const QDBusPendingCall &call)
QDBusPendingReply & operator=(const QDBusPendingCall &call)
Q_IMPLICIT QDBusPendingReply(const QDBusMessage &message)
QDBusPendingReply & operator=(const QDBusMessage &message)
QDBusPendingReply & operator=(const QDBusMessage &message)
Makes this object take its contents from the message message and drops the reference to the current p...
Q_IMPLICIT QDBusPendingReply(const QDBusMessage &message)
Creates a QDBusPendingReply object that will take its contents from the message message.
Q_IMPLICIT QDBusPendingReply(const QDBusPendingCall &call)
Creates a QDBusPendingReply object that will take its contents from the call pending asynchronous cal...
QDBusPendingReply(const QDBusPendingReply &other)
Creates a copy of the other QDBusPendingReply object.
constexpr int count() const
Return the number of arguments the reply is supposed to have.
QDBusPendingReply & operator=(const QDBusPendingReply &other)
Makes a copy of other and drops the reference to the current pending call.
Select< 0 >::Type value() const
Returns the first argument in this reply, cast to type Types[0] (the first template parameter of this...
QDBusPendingReply()=default
Creates an empty QDBusPendingReply object.
Select< Index >::Type argumentAt() const
Returns the argument at position index in the reply's contents.
QDBusPendingReply & operator=(const QDBusPendingCall &call)
Makes this object take its contents from the call pending call and drops the reference to the current...
QMetaType metaTypeFor< QVariant >()
Combined button and popup list for selecting options.
GLenum GLenum GLsizei count
GLuint GLsizei const GLchar * message
Select< Index - 1, Types... > Next