Qt 4.8
|
The QDBusReply class stores the reply for a method call to a remote object. More...
#include <qdbusreply.h>
Public Functions | |
const QDBusError & | error () |
Returns the error code that was returned from the remote function call. More... | |
bool | isValid () const |
Returns true if no error occurred; otherwise, returns false. More... | |
operator Type () const | |
Returns the same as value(). More... | |
QDBusReply & | operator= (const QDBusMessage &reply) |
Makes this object contain the reply specified by message message. More... | |
QDBusReply & | operator= (const QDBusPendingCall &pcall) |
Makes this object contain the reply specified by the pending asynchronous call pcall. More... | |
QDBusReply & | operator= (const QDBusError &dbusError) |
Sets this object to contain the error code given by error. More... | |
QDBusReply & | operator= (const QDBusReply &other) |
Makes this object be a copy of the object other. More... | |
QDBusReply (const QDBusMessage &reply) | |
Automatically construct a QDBusReply object from the reply message reply, extracting the first return value from it if it is a success reply. More... | |
QDBusReply (const QDBusPendingCall &pcall) | |
Automatically construct a QDBusReply object from the asynchronous pending call pcall. More... | |
QDBusReply (const QDBusPendingReply< T > &reply) | |
Constructs a QDBusReply object from the pending reply message, reply. More... | |
QDBusReply (const QDBusError &dbusError=QDBusError()) | |
Constructs an error reply from the D-Bus error code given by error. More... | |
Type | value () const |
Returns the remote function's calls return value. More... | |
Private Types | |
typedef T | Type |
Properties | |
Type | m_data |
QDBusError | m_error |
The QDBusReply class stores the reply for a method call to a remote object.
A QDBusReply object is a subset of the QDBusMessage object that represents a method call's reply. It contains only the first output argument or the error code and is used by QDBusInterface-derived classes to allow returning the error code as the function's return argument.
It can be used in the following manner:
If the remote method call cannot fail, you can skip the error checking:
However, if it does fail under those conditions, the value returned by QDBusReply::value() is a default-constructed value. It may be indistinguishable from a valid return value.
QDBusReply objects are used for remote calls that have no output arguments or return values (i.e., they have a "void" return type). Use the isValid() function to test if the reply succeeded.
Definition at line 65 of file qdbusreply.h.
|
private |
Definition at line 67 of file qdbusreply.h.
|
inline |
Automatically construct a QDBusReply object from the reply message reply, extracting the first return value from it if it is a success reply.
Definition at line 69 of file qdbusreply.h.
|
inline |
Automatically construct a QDBusReply object from the asynchronous pending call pcall.
If the call isn't finished yet, QDBusReply will call QDBusPendingCall::waitForFinished(), which is a blocking operation.
If the return types patch, QDBusReply will extract the first return argument from the reply.
Definition at line 81 of file qdbusreply.h.
|
inline |
Constructs a QDBusReply object from the pending reply message, reply.
Definition at line 91 of file qdbusreply.h.
|
inline |
Constructs an error reply from the D-Bus error code given by error.
Definition at line 96 of file qdbusreply.h.
|
inline |
Returns the error code that was returned from the remote function call.
If the remote call did not return an error (i.e., if it succeeded), then the QDBusError object that is returned will not be a valid error code (QDBusError::isValid() will return false).
Definition at line 116 of file qdbusreply.h.
Referenced by QConnmanManagerInterface::connectService(), QConnmanManagerInterface::disableTechnology(), QConnmanManagerInterface::enableTechnology(), QConnmanManagerInterface::lookupService(), QConnmanManagerInterface::registerCounter(), QConnmanManagerInterface::requestScan(), QOfonoSmsInterface::sendMessage(), and QConnmanManagerInterface::unregisterCounter().
|
inline |
Returns true if no error occurred; otherwise, returns false.
Definition at line 114 of file qdbusreply.h.
Referenced by QConnmanManagerInterface::connectService(), QOfonoManagerInterface::getModems(), QOfonoNetworkRegistrationInterface::getOperators(), QOfonoDataConnectionManagerInterface::getPrimaryContexts(), QOfonoManagerInterface::getProperties(), QConnmanManagerInterface::getServices(), QConnmanManagerInterface::getTechnologies(), and QConnmanManagerInterface::lookupService().
|
inline |
Returns the same as value().
This function is not available if the remote call returns void
.
Definition at line 123 of file qdbusreply.h.
|
inline |
Makes this object contain the reply specified by message message.
If message is an error message, this function will copy the error code and message into this object
If message is a standard reply message and contains at least one parameter, it will be copied into this object, as long as it is of the correct type. If it's not of the same type as this QDBusError object, this function will instead set an error code indicating a type mismatch.
Definition at line 73 of file qdbusreply.h.
|
inline |
Makes this object contain the reply specified by the pending asynchronous call pcall.
If the call is not finished yet, this function will call QDBusPendingCall::waitForFinished() to block until the reply arrives.
If pcall finishes with an error message, this function will copy the error code and message into this object
If pcall finished with a standard reply message and contains at least one parameter, it will be copied into this object, as long as it is of the correct type. If it's not of the same type as this QDBusError object, this function will instead set an error code indicating a type mismatch.
Definition at line 85 of file qdbusreply.h.
|
inline |
Sets this object to contain the error code given by error.
You can later access it with error().
Definition at line 100 of file qdbusreply.h.
|
inline |
|
inline |
Returns the remote function's calls return value.
If the remote call returned with an error, the return value of this function is undefined and may be undistinguishable from a valid return value.
This function is not available if the remote call returns void
.
Definition at line 118 of file qdbusreply.h.
Referenced by QNetworkManagerInterfaceDeviceWireless::getAccessPoints(), QNetworkManagerInterface::getDevices(), QOfonoManagerInterface::getModems(), QOfonoNetworkRegistrationInterface::getOperators(), QOfonoDataConnectionManagerInterface::getPrimaryContexts(), QOfonoManagerInterface::getProperties(), QConnmanManagerInterface::getProperties(), QOfonoModemInterface::getProperties(), QConnmanProfileInterface::getProperties(), QOfonoNetworkRegistrationInterface::getProperties(), QConnmanServiceInterface::getProperties(), QOfonoNetworkOperatorInterface::getProperties(), QOfonoSimInterface::getProperties(), QConnmanTechnologyInterface::getProperties(), QOfonoDataConnectionManagerInterface::getProperties(), QOfonoPrimaryDataContextInterface::getProperties(), QOfonoSmsInterface::getProperties(), QConnmanManagerInterface::getServices(), QNetworkManagerSettingsConnection::getSettings(), QConnmanManagerInterface::getState(), QConnmanManagerInterface::getTechnologies(), QNetworkManagerSettings::listConnections(), qDBusReplyToScriptValue(), and QNetworkManagerSettingsConnection::QNetworkManagerSettingsConnection().
|
private |
Definition at line 130 of file qdbusreply.h.
Referenced by QDBusReply< QStringList >::operator Type(), QDBusReply< QStringList >::operator=(), and QDBusReply< QStringList >::value().
|
private |
Definition at line 129 of file qdbusreply.h.
Referenced by QDBusReply< QStringList >::error(), QDBusReply< QStringList >::isValid(), and QDBusReply< QStringList >::operator=().