35
testHasttable/loadmapping.h
Normal file
35
testHasttable/loadmapping.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef LOADMAPPING_H
|
||||
#define LOADMAPPING_H
|
||||
|
||||
#include <QString>
|
||||
#include <QHash>
|
||||
#include <QVector>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QStringList>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include "recursedir.h"
|
||||
//这是一个单例
|
||||
class LoadMapping
|
||||
{
|
||||
public:
|
||||
LoadMapping();
|
||||
~LoadMapping();
|
||||
bool load(const QString& dir);
|
||||
private:
|
||||
class CG // 它的唯一工作就是在析构函数中删除CSingleton的实例
|
||||
{
|
||||
public:
|
||||
~CG()
|
||||
{
|
||||
if (LoadMapping::ht)
|
||||
delete LoadMapping::ht;
|
||||
}
|
||||
};
|
||||
static CG Garbo; // 定义一个静态成员,在程序结束时,系统会调用它的析构函数
|
||||
static QHash<QString,QVector<double> > *ht;
|
||||
QHash<QString,QVector<QString> > loads;
|
||||
};
|
||||
|
||||
#endif // LOADMAPPING_H
|
||||
Reference in New Issue
Block a user