AsyncWorker

Since: BlackBerry 10.0.0

#include <bb/data/AsyncWorker>

To link against this class, add the following line to your .pro file: LIBS += -lbbdata

Represents objects that do asynchronous work.

You can extend this class and pass it to an AsyncDataAccess object and it will perform the work in another thread.

An AsyncWorker is expected to perform multiple operations with commands being passed to it using one of the execute functions in AsyncDataAccess.

See SqlWorker for a concrete example of how this can be used.


Overview

Inheritance

bb::data::AsyncWorker
bb::data::SqlWorker

Public Functions Index

AsyncWorker (QObject *parent=0)
virtual ~AsyncWorker ()
voidexecute (const QVariant &criteria, bb::data::DataAccessReply *replyData)=0

Public Functions

AsyncWorker (

Constructs a worker that will perform asynchronous work.

Ownership will be managed by the async framework. The object ownership will be transferred to an internal object within this framework.

Parameters
parent

The parent owner. Do not specify as ownership will be overridden.

Since:

BlackBerry 10.0.0

virtual~AsyncWorker ()

Destructor.

Since:

BlackBerry 10.0.0

void execute (

Executes a task asynchronously in another thread provided by AsyncDataAccess.

This method will ultimately be called when either AsyncDataAccess::execute() or AsyncDataAccess::executeAndWait() is called.

Parameters
criteria

The work to be performed such as an SQL query command.

replyData

An output parameter, which is a pointer to an object that is updated with work results.

Since:

BlackBerry 10.0.0

Last modified: 2014-03-13

comments powered by Disqus