YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
YSLib::GStaticCache< _type, _tPointer > 模板类 参考

全局静态单态存储器。 更多...

#include <ystorage.hpp>

Public 类型

using PointerType = _tPointer
 

静态 Public 成员函数

static DefGetter (ynothrow, PointerType, PointerRaw, _ptr) static PointerType GetPointer()
 取指针。 更多...
 
static _type & GetInstance ()
 取实例引用。 更多...
 
static void Release () ynothrow
 删除对象并置指针为空值。 更多...
 

Private 成员函数

 GStaticCache ()
 

静态 Private 成员函数

static void Check ()
 检查是否已经初始化,否则构造新对象。 更多...
 

静态 Private 属性

static PointerType _ptr
 

详细描述

template<typename _type, typename _tPointer = _type*>
class YSLib::GStaticCache< _type, _tPointer >

全局静态单态存储器。

前置条件
std::is_nothrow_constructible<_tPointer>::value
警告
非线程安全。
自从
早于 build 132

在文件 ystorage.hpp84 行定义.

成员类型定义说明

template<typename _type , typename _tPointer = _type*>
using YSLib::GStaticCache< _type, _tPointer >::PointerType = _tPointer

在文件 ystorage.hpp90 行定义.

构造及析构函数说明

template<typename _type , typename _tPointer = _type*>
YSLib::GStaticCache< _type, _tPointer >::GStaticCache ( )
private

成员函数说明

template<typename _type , typename _tPointer = _type*>
static void YSLib::GStaticCache< _type, _tPointer >::Check ( )
inlinestaticprivate

检查是否已经初始化,否则构造新对象。

在文件 ystorage.hpp101 行定义.

参考 YSLib::GStaticCache< _type, _tPointer >::_ptr.

参考自 YSLib::GStaticCache< _type, _tPointer >::DefGetter() , 以及 YSLib::GStaticCache< _type, _tPointer >::GetInstance().

这是这个函数的调用关系图:

template<typename _type , typename _tPointer = _type*>
static YSLib::GStaticCache< _type, _tPointer >::DefGetter ( ynothrow  ,
PointerType  ,
PointerRaw  ,
_ptr   
)
inlinestatic

取指针。

在文件 ystorage.hpp108 行定义.

参考 YSLib::GStaticCache< _type, _tPointer >::Check().

函数调用图:

template<typename _type , typename _tPointer = _type*>
static _type& YSLib::GStaticCache< _type, _tPointer >::GetInstance ( )
inlinestatic

取实例引用。

在文件 ystorage.hpp122 行定义.

参考 YSLib::GStaticCache< _type, _tPointer >::Check().

函数调用图:

template<typename _type , typename _tPointer = _type*>
static void YSLib::GStaticCache< _type, _tPointer >::Release ( )
inlinestatic

删除对象并置指针为空值。

自从
build 319

在文件 ystorage.hpp133 行定义.

参考 YSLib::GStaticCache< _type, _tPointer >::_ptr.

类成员变量说明

template<typename _type , typename _tPointer = _type*>
GStaticCache< _type, _tPointer >::PointerType YSLib::GStaticCache< _type, _tPointer >::_ptr
staticprivate

该类的文档由以下文件生成: