Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QServiceReplyBase Class

The QServiceReplyBase class tracks non-blocking service framework calls. More...

 #include <QServiceReplyBase>

Inherits: QObject.

Public Functions

QServiceReplyBase(QObject * parent = 0)
virtual ~QServiceReplyBase()
QServiceManager::Error error() const
bool isFinished() const
bool isRunning() const
QString request() const
void setRequest(const QString & request)
  • 31 public functions inherited from QObject

Signals

void errorChanged()
void finished()
void started()

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QServiceReplyBase class tracks non-blocking service framework calls.

The QServiceReplyBase class is a data-carrying class. Each instance is short-lived and only exists during the lifetime of a QServiceManager call. The QServiceReplyBase instance never owns any of the data it points to, it just serves to carry the payload from the background request back to the caller.

When an instance is first created, after being returned from QServiceManager::loadInterface(), that instance will return false from both the isRunning() and isFinished() functions. Then the request is started, and it will emit the started() signal. After that, and until the request is completed, the isRunning() function will return true. Finally the request is completed, and it will emit the finished() signal. After that the isRunning() function will return false, and the isFinished() function will return true. At this point client code can access the proxyObject() function to obtain the payload of the service request.

Typically there should be no reason to construct a QServiceReplyBase (or sub-class) instance: instead simply use the instances returned from the QServiceManager::loadInterface() function.

The service QObject returned from the proxyObject() function is owned by the caller of the original QServiceManager::loadInterface() function which resulted in the QServiceReplyBase instance. Likewise the QServiceObjectBase instance itself is owned by the caller and after the payload is retrieved, it should be queued for destruction with deleteLater() in the function which handles the finished() signal.

As a convenience the manager() function will return the QServiceManager associated with the request, and the request() function will return a QString indicating the details of the request itself.

For performance reasons the QServiceReplyBase object is not synchronized, and thread-safety is ensured by observing the following invariant condition:

  • all calls to non-const methods are serialised

In general client code should never have to worry about this, since the private slots which can modify the reply are called via queued signal-slot connections behind the scenes ensuring that such accesses are serialised.

In the case of a request based on an interface name, request() will return the interface name; otherwise in the case of a request based on a descriptor it will return the interface name of the descriptor.

See also QServiceReplyTyped and QServiceManager.

Member Function Documentation

QServiceReplyBase::QServiceReplyBase(QObject * parent = 0)

Constructs a new QServiceReplyBase object. All values are set to defaults. Generally creating QServiceReplayBase instances should be left to the QServiceManager.

QServiceReplyBase::~QServiceReplyBase() [virtual]

Destroys this object recovering all resources.

QServiceManager::Error QServiceReplyBase::error() const

Returns any error state that may have been set on this reply.

See also isFinished().

void QServiceReplyBase::errorChanged() [signal]

void QServiceReplyBase::finished() [signal]

bool QServiceReplyBase::isFinished() const

Returns true if the QServiceReplyBase isNoError completed. When this is true, the baseObject() and proxyObject() functions may be called to retrieve the payload of the reply. Note that you should check the value of the error() function to see if the request completed successfully.

See also isRunning() and error().

bool QServiceReplyBase::isRunning() const

Returns true if the QServiceReplyBase is being processed. When this is true, the baseObject() and proxyObject() should not be accessed as they are in an undefined state. Instead wait for the finished() signal to be emitted and access those value then.

See also isFinished().

QString QServiceReplyBase::request() const

Convenience function that returns an informative string of the request which was issued when this reply was created. This string is not used by the request processor in any way and exists mainly for logging and debugging purposes.

See also setRequest().

void QServiceReplyBase::setRequest(const QString & request)

Sets the informative request string for this reply. This function is called by the QServiceManager object when the request is created. In general client code should not need to call this function.

See also request().

void QServiceReplyBase::started() [signal]

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web