Heart 1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
Loading...
Searching...
No Matches
asynclauncher.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021-2025 QuasarApp.
3 * Distributed under the lgplv3 software license, see the accompanying
4 * Everyone is permitted to copy and distribute verbatim copies
5 * of this license document, but changing it is not allowed.
6*/
7
8#ifndef ASYNCLAUNCHER_H
9#define ASYNCLAUNCHER_H
10
11#include <async.h>
12
13class QThread;
14
15namespace QH {
16
31class HEARTSHARED_EXPORT AsyncLauncher final: public Async
32{
33 Q_OBJECT
34public:
40 AsyncLauncher(QThread *thread);
41
48 bool run(const Job &action, bool wait = false);
49
54 bool stop();
55
60 bool waitForStop();
61
62};
63
64}
65#endif // ASYNCLAUNCHER_H
bool run(const Job &action, bool wait=false)
run This method run the action function in the work thread of this object.
bool stop()
stop This method stop the work thread of this object.
bool waitForStop()
waitForStop This method wait for the thread of this object is stopped.
AsyncLauncher(QThread *thread)
AsyncLauncher This is base constructor of the AsyncLauncher object.
std::function< bool()> Job
Definition async.h:34
Async(QThread *thread)
Async This is default constructor of the async object.
Definition async.cpp:38
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition heart.cpp:13