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.
AppFlowPost/FITK_Kernel/FITKCore/FITKAbstractDataManagerHelp...

237 lines
7.8 KiB
C

/**
*
* @file FITKAbstractDataManagerHelper.h
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*
*/
#ifndef __FITKABSTRACTEDATAMANAGERHELPER_H__
#define __FITKABSTRACTEDATAMANAGERHELPER_H__
#include <QList>
#include <QHash>
#include <QObject>
#include <QString>
#include "FITKCoreAPI.h"
namespace Core
{
class FITKAbstractDataObject;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
class FITKCoreAPI FITKAbstractDataManagerHelper : public QObject
{
Q_OBJECT
public:
/**
* @brief Construct a new FITKAbstractDataManagerHelper object
* @param[i] l
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
explicit FITKAbstractDataManagerHelper(QList<FITKAbstractDataObject*>& l);
/**
* @brief Destroy the FITKAbstractDataManagerHelper object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-07
*/
~FITKAbstractDataManagerHelper() = default;
/**
* @brief
* @param[i] obj
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
void appendData(FITKAbstractDataObject* obj);
/**
* @brief
* @param[i] objs
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-08-27
*/
void appendData(const QList<FITKAbstractDataObject*>& objs);
/**
* @brief
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
int getDataCount() const;
/**
* @brief
* @param[i] obj
* @return true
* @return false
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
bool isContains(FITKAbstractDataObject* obj) const;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
void clear();
/**
* @brief
* @param[i] index
* @param[i] item
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
void insertDataObj(int index, FITKAbstractDataObject* item);
/**
* @brief
* @param[i] index
* @return T*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
FITKAbstractDataObject* getDataByIndex(const int index);
/**
* @brief ID
* @param[i] id ID
* @return T*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
FITKAbstractDataObject* getDataByID(const int id);
/**
* @brief FITKAbstractNDataObject
* @param[i] name
* @param[i] CompSens
* @return T*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
FITKAbstractDataObject* getDataByName(const QString& name, bool compSens);
/**
* @brief -1
* @param[i] obj
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
int getDataIndex(FITKAbstractDataObject* obj);
/**
* @brief
* @param[i] obj
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
void removeDataObj(FITKAbstractDataObject* obj);
/**
* @brief ,
* @param[i] obj
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
void removeDataObjWithoutRelease(FITKAbstractDataObject* obj);
/**
* @brief index
* @param[i] index
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
void removeDataByIndex(int index);
/**
* @brief ID
* @param[i] id ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
void removeDataByID(int id);
/**
* @brief
* @param[i] name
* @param[i] CompSens
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
void removeDataByName(const QString &name, bool CompSens);
/**
* @brief ID
* @param[i] id ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-07
*/
void setParentDataID(const int & id);
/**
* @brief id
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-07
*/
int getParentDataID() const;
/**
* @brief
* @param[i] name
* @return QString
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-11
*/
QString checkName(const QString& name);
/**
* @brief ID
* @param dataIdID
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-10-22
*/
int getIndexByID(int dataId);
/**
* @brief ID
* @param dataIndex
* @return ID
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-10-22
*/
int getIDByIndex(int dataIndex);
private:
/**
* @brief /
* @param[i] obj
* @param[i] con
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
void connectHelper(FITKAbstractDataObject* obj, bool con = true);
public slots :
/**
* @brief
* @param[i] obj
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
void dataObjectDestoried(FITKAbstractDataObject* obj);
private:
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-22
*/
QList<FITKAbstractDataObject*>& _dataList;
/**
* @brief id
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-07
*/
int _parentDataID{ -1 };
};
}
#endif