Heart 1.3.848.aa44c26
Heart is base back end library for your c++ Qt projects.
|
The AsyncLauncher class is wraper of the Async class for support moving invokes to thread of the current object. More...
#include <asynclauncher.h>
Public Member Functions | |
AsyncLauncher (QThread *thread, QObject *ptr=nullptr) | |
AsyncLauncher This is base constructor of the AsyncLauncher object. | |
bool | run (const Job &action, bool wait=false) |
run This method run the action function in the work thread of this object. | |
Public Member Functions inherited from QH::Async | |
bool | asyncLauncher (const Job &job, bool await=false, bool freaze=true) const |
asyncLauncher This method invoke a job on the thread (using the asyncHandler method) of this object. | |
Additional Inherited Members | |
Public Types inherited from QH::Async | |
using | Job = std::function< bool()> |
Protected Member Functions inherited from QH::Async | |
Async (QThread *thread, QObject *ptr=nullptr) | |
Async This is default constructor of the async object. | |
~Async () | |
bool | waitFor (bool *condition, int timeout=WAIT_TIME, bool freaze=true) const |
waitFor This is base wait function. | |
bool | waitFor (const Job &condition, int timeout=WAIT_TIME, bool freaze=true) const |
waitFor This is base wait function. | |
The AsyncLauncher class is wraper of the Async class for support moving invokes to thread of the current object.
Definition at line 31 of file asynclauncher.h.
QH::AsyncLauncher::AsyncLauncher | ( | QThread * | thread, |
QObject * | ptr = nullptr |
||
) |
AsyncLauncher This is base constructor of the AsyncLauncher object.
thread | This is pointer to the work thread. If you want to change thread in run time just use the setThread method. |
ptr | This is QObject parent. |
Definition at line 11 of file asynclauncher.cpp.
bool QH::AsyncLauncher::run | ( | const Job & | action, |
bool | wait = false |
||
) |
run This method run the action function in the work thread of this object.
action | This is function for running in the work thread. |
wait | This option for sets awaiting of the finishing the action function. By default this is false. |
Definition at line 16 of file asynclauncher.cpp.