@@ -6,13 +6,23 @@
|
||||
class NodeToTerminal
|
||||
{
|
||||
public:
|
||||
explicit NodeToTerminal();
|
||||
NodeToTerminal();
|
||||
~NodeToTerminal();
|
||||
void add(const QString& key,const QString& value);
|
||||
bool contains(const QString& key);
|
||||
QString value(const QString& key);
|
||||
private:
|
||||
static QHash<QString,QString> *ht;
|
||||
class CG // 它的唯一工作就是在析构函数中删除CSingleton的实例
|
||||
{
|
||||
public:
|
||||
~CG()
|
||||
{
|
||||
if (NodeToTerminal::ht)
|
||||
delete NodeToTerminal::ht;
|
||||
}
|
||||
};
|
||||
static CG Garbo; // 定义一个静态成员,在程序结束时,系统会调用它的析构函数
|
||||
static QHash<QString,QString> *ht;
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user