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.

122 lines
2.9 KiB
C

/**
*
* @file FITKThreadPool.h
* @brief 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-02
*
*/
#ifndef __FITKTHREADPOOL_H___
#define __FITKTHREADPOOL_H___
#include "FITKCoreAPI.h"
#include "FITKCoreMacros.h"
#include "FITKAbstractObject.hpp"
#include <QMutex>
namespace AppFrame
{
class FITKSignalTransfer;
}
namespace Core
{
class FITKThreadPoolPrivate;
class FITKThreadPoolDeletor;
class FITKThreadTask;
/**
* @brief 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-02
*/
class FITKCoreAPI FITKThreadPool : public FITKAbstractObject
{
friend FITKThreadPoolDeletor;
friend FITKThreadTask;
DeclSingleton(FITKThreadPool);
public:
/**
* @brief
* @param[i] task 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-02
*/
void execTask(FITKThreadTask* task);
/**
* @brief 线
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-02
*/
int getTaskCount() const;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-02
*/
void wait();
/**
* @brief
* @param[i] task
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-08-31
*/
void wait(FITKThreadTask* task);
/**
* @brief
* @param[i] task
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-02
*/
void init(AppFrame::FITKSignalTransfer* sigTransfer);
private:
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-02
*/
void initialize();
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-07-17
*/
void finalize();
/**
* @brief
* @return FITKThreadPoolPrivate*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-02
*/
FITKThreadPoolPrivate* getAgent();
private:
/**
* @brief 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-02
*/
FITKThreadPoolPrivate* _threadPoolAgent{};
};
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-02
*/
class FITKThreadPoolDeletor
{
public:
explicit FITKThreadPoolDeletor() = default;
~FITKThreadPoolDeletor();
};
}
#endif