9#ifndef BLUEZQT_TPENDINGCALL_H
10#define BLUEZQT_TPENDINGCALL_H
12#include <QDBusPendingReply>
14#include "pendingcall.h"
18using namespace std::placeholders;
36 template<
int Index,
typename Ty,
typename... Ts>
38 using Type =
typename Select<Index - 1, Ts...>::Type;
40 template<
typename Ty,
typename... Ts>
41 struct Select<0, Ty, Ts...> {
56 inline const typename Select<Index, T...>::Type
valueAt()
const
58 using ResultType =
typename Select<Index, T...>::Type;
59 return qdbus_cast<ResultType>(m_reply.argumentAt(Index),
nullptr);
63 TPendingCall(
const QDBusPendingCall &call, QObject *parent =
nullptr)
68 void process(QDBusPendingCallWatcher *watcher, ErrorProcessor errorProcessor, QVariantList *values)
71 errorProcessor(m_reply.error());
72 if (m_reply.isError()) {
76 for (
int i = 0; i < m_reply.count(); ++i) {
77 values->append(m_reply.argumentAt(i));
81 QDBusPendingReply<T...> m_reply;
83 friend class MediaTransport;
Pending method call.
Definition pendingcall.h:33
Pending method call (template version).
Definition tpendingcall.h:34
const Select< Index, T... >::Type valueAt() const
Returns a return value at given index of the call.
Definition tpendingcall.h:56