DtkCore
DTK Core module
Toggle main menu visibility
首页
相关页面
Topics
类
类列表
类索引
类继承关系
类成员
全部
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
函数
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
变量
枚举
枚举值
a
b
c
d
f
g
h
k
l
m
n
o
p
r
s
t
u
属性
相关函数
文件
文件列表
•
全部
类
文件
函数
变量
枚举
枚举值
属性
友元
组
页
载入中...
搜索中...
未找到
dsingleton.h
1
// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd.
2
//
3
// SPDX-License-Identifier: LGPL-3.0-or-later
4
5
#ifndef DSINGLETON_H
6
#define DSINGLETON_H
7
8
#include "dtkcore_global.h"
9
10
DCORE_BEGIN_NAMESPACE
11
44
template
<
class
T>
45
class
LIBDTKCORESHARED_EXPORT
DSingleton
46
{
47
public
:
48
#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
49
QT_DEPRECATED_X(
"Use ref"
)
50
static
inline
T *instance()
51
{
52
static
T *_instance =
new
T;
53
return
_instance;
54
}
55
#endif
56
static
T& ref()
57
{
58
static
T instance;
59
return
instance;
60
}
61
62
DSingleton
(T&&) =
delete
;
63
DSingleton
(
const
T&) =
delete
;
64
void
operator= (
const
T&) =
delete
;
65
66
protected
:
67
DSingleton
() =
default
;
68
virtual
~DSingleton
() =
default
;
69
};
45
class
LIBDTKCORESHARED_EXPORT
DSingleton
{
…
};
70
71
DCORE_END_NAMESPACE
72
73
#endif
// DSINGLETON_H
Dtk::Core::DSingleton
Definition
dsingleton.h:46
include
base
dsingleton.h
文档生成时间:2024-11-15-05:50 +00
Doxygen Version
1.9.8
制作者:deepin doc doc go SIG
文档使用CC-BY-4.0共享