Represents a single task (a function) to be executed in a thread pool.
More...
#include <attachment_queue_manager.h>
|
| void | finished () |
| | Emitted after the task function (TaskFunc_) has finished executing.
|
| |
|
| | AttachmentTask (const std::function< void()> &taskFunc, QObject *parent=nullptr) |
| | Constructs an AttachmentTask.
|
| |
| void | run () override |
| | Executes the stored task function (TaskFunc_). Called by the QThreadPool when the task is started. Emits finished() upon completion.
|
| |
|
| std::function< void()> | TaskFunc_ |
| | The function object that represents the task to be executed.
|
| |
Represents a single task (a function) to be executed in a thread pool.
This class wraps a std::function and implements QRunnable, allowing it to be managed by QThreadPool. It emits a signal when the task function completes.
◆ AttachmentTask()
| AttachmentTask::AttachmentTask |
( |
const std::function< void()> & | taskFunc, |
|
|
QObject * | parent = nullptr ) |
|
explicit |
Constructs an AttachmentTask.
- Parameters
-
| taskFunc | The std::function to be executed when run() is called. |
| parent | Optional parent QObject. |
◆ finished
| void AttachmentTask::finished |
( |
| ) |
|
|
signal |
Emitted after the task function (TaskFunc_) has finished executing.
◆ run()
| void AttachmentTask::run |
( |
| ) |
|
|
override |
Executes the stored task function (TaskFunc_). Called by the QThreadPool when the task is started. Emits finished() upon completion.
◆ TaskFunc_
| std::function<void()> AttachmentTask::TaskFunc_ |
|
private |
The function object that represents the task to be executed.
The documentation for this class was generated from the following files: