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.
53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "iParameterGroup.h"
|
|
|
|
#include "iSysUtils_global.h"
|
|
|
|
class iParameter;
|
|
|
|
// 改为单例模式,进行参数的统一管理,支持多种参数大类的区分
|
|
class I_SYSUTILS_EXPORT iSysParaHelper
|
|
{
|
|
public:
|
|
|
|
// 获取对象,单例模式
|
|
static iSysParaHelper* getInstance();
|
|
|
|
// 关闭消耗
|
|
static void release();
|
|
|
|
// Para defines
|
|
bool loadParaDefines(QString sFile = "", QString sKey = s_Sys_Para_Default);
|
|
|
|
// sPara 参数名称,可以是 英文也可以是中文,软件会自动判断
|
|
iParameter* getPara(QString sPara, QString sKey = s_Sys_Para_Default);
|
|
|
|
// 获取参数数值
|
|
bool getParaValue(QString sPara, double& d, QString sKey = s_Sys_Para_Default);
|
|
|
|
// 返回指针
|
|
vecParameterGroupsPtr* getParameterGroupPtr(QString sKey = s_Sys_Para_Default);
|
|
|
|
private:
|
|
|
|
iSysParaHelper();
|
|
~iSysParaHelper();
|
|
|
|
// 释放内存
|
|
void releaseParaGroup(vecParameterGroupsPtr& vec);
|
|
|
|
// Para defines
|
|
bool _loadParaDefines(QString sFile = "", QString sKey = "Default");
|
|
|
|
private:
|
|
|
|
static iSysParaHelper* m_pSysInstance;
|
|
|
|
private:
|
|
|
|
QMap<QString, vecParameterGroupsPtr> m_mapAllParaGroups;
|
|
};
|
|
|
|
#define _paraHelper iSysParaHelper::getInstance()
|