![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtDBus More...
#include <qdbuspendingcall.h>
Public Member Functions | |
QDBusPendingCall (const QDBusPendingCall &other) | |
Creates a copy of the other pending asynchronous call. | |
~QDBusPendingCall () | |
Destroys this copy of the QDBusPendingCall object. | |
QDBusPendingCall & | operator= (QDBusPendingCall &&other) noexcept |
QDBusPendingCall & | operator= (const QDBusPendingCall &other) |
Creates a copy of the other pending asynchronous call and drops the reference to the previously-referenced call. | |
void | swap (QDBusPendingCall &other) noexcept |
bool | isFinished () const |
void | waitForFinished () |
bool | isError () const |
bool | isValid () const |
QDBusError | error () const |
QDBusMessage | reply () const |
Static Public Member Functions | |
static QDBusPendingCall | fromError (const QDBusError &error) |
static QDBusPendingCall | fromCompletedCall (const QDBusMessage &message) |
Protected Member Functions | |
QDBusPendingCall (QDBusPendingCallPrivate *dd) | |
Protected Attributes | |
QExplicitlySharedDataPointer< QDBusPendingCallPrivate > | d |
Friends | |
class | QDBusPendingCallPrivate |
class | QDBusPendingCallWatcher |
class | QDBusConnection |
\inmodule QtDBus
The QDBusPendingCall class refers to one pending asynchronous call.
A QDBusPendingCall object is a reference to a method call that was sent over D-Bus without waiting for a reply. QDBusPendingCall is an opaque type, meant to be used as a handle for a pending reply.
In most programs, the QDBusPendingCall class will not be used directly. It can be safely replaced with the template-based QDBusPendingReply, in order to access the contents of the reply or wait for it to be complete.
The QDBusPendingCallWatcher class allows one to connect to a signal that will indicate when the reply has arrived or if the call has timed out. It also provides the QDBusPendingCallWatcher::waitForFinished() method which will suspend the execution of the program until the reply has arrived.
Definition at line 22 of file qdbuspendingcall.h.
QDBusPendingCall::QDBusPendingCall | ( | const QDBusPendingCall & | other | ) |
Creates a copy of the other pending asynchronous call.
Note that both objects will refer to the same pending call.
Definition at line 212 of file qdbuspendingcall.cpp.
References QDBusPendingCall().
Referenced by QDBusPendingCall(), and QDBusPendingCall().
QDBusPendingCall::~QDBusPendingCall | ( | ) |
Destroys this copy of the QDBusPendingCall object.
If this copy is also the last copy of a pending asynchronous call, the call will be canceled and no further notifications will be received. There will be no way of accessing the reply's contents when it arrives.
Definition at line 236 of file qdbuspendingcall.cpp.
|
protected |
Definition at line 220 of file qdbuspendingcall.cpp.
References QDBusPendingCall(), QBasicAtomicInteger< T >::deref(), Q_ASSERT, Q_UNUSED, and QSharedData::ref.
QDBusError QDBusPendingCall::error | ( | ) | const |
Definition at line 350 of file qdbuspendingcall.cpp.
References d, QDBusError::Disconnected, QDBusUtil::disconnectedErrorMessage(), QDBusPendingCallPrivate::mutex, and QDBusPendingCallPrivate::replyMessage.
Referenced by QNetworkManagerInterface::QNetworkManagerInterface(), fromError(), and reply().
|
static |
This function is useful for code that requires simulating a pending call, but that has already finished.
Definition at line 435 of file qdbuspendingcall.cpp.
References d, QDBusMessage::ErrorMessage, QDBusPendingCallPrivate, QSharedData::ref, QDBusMessage::ReplyMessage, QDBusPendingCallPrivate::replyMessage, QBasicAtomicInteger< T >::storeRelaxed(), and QDBusMessage::type().
Referenced by fromError().
|
static |
Definition at line 418 of file qdbuspendingcall.cpp.
References QDBusMessage::createError(), error(), and fromCompletedCall().
Referenced by QDBusAbstractInterface::asyncCallWithArgumentList(), and QIBusProxy::GetProperty().
bool QDBusPendingCall::isError | ( | ) | const |
Definition at line 334 of file qdbuspendingcall.cpp.
References d, QDBusMessage::ErrorMessage, QDBusPendingCallPrivate::mutex, QDBusPendingCallPrivate::replyMessage, and QDBusMessage::type().
Referenced by QNetworkManagerInterface::QNetworkManagerInterface().
bool QDBusPendingCall::isFinished | ( | ) | const |
Definition at line 294 of file qdbuspendingcall.cpp.
References d, QDBusMessage::InvalidMessage, QDBusPendingCallPrivate::mutex, QDBusPendingCallPrivate::replyMessage, and QDBusMessage::type().
bool QDBusPendingCall::isValid | ( | ) | const |
Definition at line 317 of file qdbuspendingcall.cpp.
References d, QDBusPendingCallPrivate::mutex, QDBusMessage::ReplyMessage, QDBusPendingCallPrivate::replyMessage, and QDBusMessage::type().
QDBusPendingCall & QDBusPendingCall::operator= | ( | const QDBusPendingCall & | other | ) |
Creates a copy of the other pending asynchronous call and drops the reference to the previously-referenced call.
Note that both objects will refer to the same pending call after this function.
If this object contained the last reference of a pending asynchronous call, the call will be canceled and no further notifications will be received. There will be no way of accessing the reply's contents when it arrives.
Definition at line 252 of file qdbuspendingcall.cpp.
|
inlinenoexcept |
Definition at line 27 of file qdbuspendingcall.h.
References other(), and swap().
Referenced by QDBusPendingReplyBase::assign().
QDBusMessage QDBusPendingCall::reply | ( | ) | const |
Definition at line 374 of file qdbuspendingcall.cpp.
References QDBusMessage::createError(), d, error(), QDBusPendingCallPrivate::mutex, and QDBusPendingCallPrivate::replyMessage.
|
inlinenoexcept |
Swaps this pending call instance with other. This function is very fast and never fails.
Definition at line 30 of file qdbuspendingcall.h.
void QDBusPendingCall::waitForFinished | ( | ) |
Definition at line 303 of file qdbuspendingcall.cpp.
References d, and QDBusPendingCallPrivate::waitForFinished().
|
friend |
Definition at line 50 of file qdbuspendingcall.h.
|
friend |
Definition at line 48 of file qdbuspendingcall.h.
Referenced by QDBusPendingReplyBase::assign(), and fromCompletedCall().
|
friend |
Definition at line 49 of file qdbuspendingcall.h.
|
protected |
Definition at line 47 of file qdbuspendingcall.h.
Referenced by QDBusPendingCallWatcher::QDBusPendingCallWatcher(), QDBusPendingReplyBase::argumentAt(), QDBusPendingReplyBase::assign(), error(), fromCompletedCall(), isError(), isFinished(), isValid(), operator=(), reply(), QDBusPendingReplyBase::setMetaTypes(), waitForFinished(), and QDBusPendingCallWatcher::waitForFinished().