50 lines
1.5 KiB
C++
50 lines
1.5 KiB
C++
#ifndef LOADMAPPING_H
|
|
#define LOADMAPPING_H
|
|
|
|
#include <QString>
|
|
#include <QHash>
|
|
#include <QVector>
|
|
#include <QDir>
|
|
#include <QFileInfo>
|
|
#include <QStringList>
|
|
#include <QFile>
|
|
#include <QTextStream>
|
|
#include <QRegExp>
|
|
#include <QSharedPointer>
|
|
#include <QTime>
|
|
#include <QList>
|
|
|
|
#include "recursedir.h"
|
|
#include "loadinfo.h"
|
|
#include "loadmatchexception.h"
|
|
//这是一个单例
|
|
class LoadMapping
|
|
{
|
|
public:
|
|
LoadMapping();
|
|
~LoadMapping();
|
|
bool broadcastUpdateByTime(const QTime& time);
|
|
bool load(const QString& loadDir, const QString &matchdDir, const QString &exceptionFile);
|
|
bool readLoads(const QString& dir);
|
|
bool readMatch(const QString& dir);
|
|
private:
|
|
class CG // 它的唯一工作就是在析构函数中删除CSingleton的实例
|
|
{
|
|
public:
|
|
~CG()
|
|
{
|
|
if (LoadMapping::loadsToLoadInfo)
|
|
delete LoadMapping::loadsToLoadInfo;
|
|
if (LoadMapping::loads)
|
|
delete LoadMapping::loads;
|
|
}
|
|
};
|
|
static CG Garbo; // 定义一个静态成员,在程序结束时,系统会调用它的析构函数
|
|
// static QHash<QString,QVector<double> > *ht;//
|
|
static QHash<QString,QVector<QSharedPointer<LoadInfo> > > *loads;//保存的是一个Substation下面的所有负荷信息
|
|
static QHash<QString,QSharedPointer<LoadInfo> > *loadsToLoadInfo;
|
|
LoadMatchException loadMatchException;
|
|
};
|
|
|
|
#endif // LOADMAPPING_H
|