Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
AttachmentTask Class Referencefinal

Represents a single task (a function) to be executed in a thread pool. More...

#include <attachment_queue_manager.h>

Inheritance diagram for AttachmentTask:
Collaboration diagram for AttachmentTask:

Signals

void finished ()
 Emitted after the task function (TaskFunc_) has finished executing.
 

Public Member Functions

 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.
 

Private Attributes

std::function< void()> TaskFunc_
 The function object that represents the task to be executed.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AttachmentTask()

AttachmentTask::AttachmentTask ( const std::function< void()> & taskFunc,
QObject * parent = nullptr )
explicit

Constructs an AttachmentTask.

Parameters
taskFuncThe std::function to be executed when run() is called.
parentOptional parent QObject.

Member Function Documentation

◆ finished

void AttachmentTask::finished ( )
signal

Emitted after the task function (TaskFunc_) has finished executing.

Here is the caller graph for this function:

◆ run()

void AttachmentTask::run ( )
override

Executes the stored task function (TaskFunc_). Called by the QThreadPool when the task is started. Emits finished() upon completion.

Here is the call graph for this function:

Member Data Documentation

◆ 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: