mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00

后端服务数据变化有快有慢,可能导致任务栏不正确时间进行响应,从而导致显示异常,对应的单元测试代码已添加 Log: 重构显示逻辑,保障任务栏显示正常 Change-Id: I62f06c133945a625c2c2ec2b2e21809be27543b6
32 lines
666 B
C++
32 lines
666 B
C++
/**
|
|
* Copyright (C) 2016 Deepin Technology Co., Ltd.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
**/
|
|
|
|
#pragma once
|
|
#include <memory>
|
|
|
|
using namespace std;
|
|
|
|
template <class T>
|
|
class Singleton
|
|
{
|
|
public:
|
|
static inline T *instance() {
|
|
static T* _instance = new T;
|
|
return _instance;
|
|
}
|
|
|
|
protected:
|
|
Singleton(void) {}
|
|
~Singleton(void) {}
|
|
Singleton(const Singleton &) {}
|
|
Singleton &operator= (const Singleton &) {}
|
|
};
|
|
|
|
|