You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
3.1 KiB
C

/**
*
* @file FITKThreadTaskGroup.h
* @brief 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*
*/
#ifndef __FITKTHREADTASK_GROUP_H__
#define __FITKTHREADTASK_GROUP_H__
#include "FITKCoreAPI.h"
#include <QObject>
#include "FITKAbstractObject.hpp"
#include <QMutex>
#include <QList>
namespace Core
{
class FITKThreadTask;
/**
* @brief 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
class FITKCoreAPI FITKThreadTaskGroup : public QObject, public Core::FITKAbstractObject
{
Q_OBJECT
friend FITKThreadTask;
public:
/**
* @brief Construct a new FITKThreadTaskGroup object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
explicit FITKThreadTaskGroup() = default;
/**
* @brief Destroy the FITKThreadTaskGroup object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
virtual ~FITKThreadTaskGroup() = default;
/**
* @brief
* @param[i] task
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
virtual void appendThreadTask(FITKThreadTask* task);
/**
* @brief
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
int getTaskCount();
/**
* @brief
* @param[i] index
* @return FITKThreadTask*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
FITKThreadTask* getTaskAt(int index);
/**
* @brief 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
void push2ThreadPool();
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
void wait();
signals:
/**
* @brief
* @param[o] group
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
void threadTaskGroupFinishedSig(FITKThreadTaskGroup* group);
private:
/**
* @brief
* @param[i] task
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
void removeThreadTask(FITKThreadTask* task);
protected:
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
QList<FITKThreadTask*> _taskList{};
/**
* @brief 线,
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
bool _puhsed2ThreadPool{ false };
};
}
#endif