28 #ifndef YSL_INC_Core_ystorage_hpp_
29 #define YSL_INC_Core_ystorage_hpp_ 1
32 #include YFM_YSLib_Core_YCoreUtilities
41 template<
typename _type>
53 template<
typename _type>
67 template<
typename _type>
83 template<
typename _type,
typename _tPo
inter = _type*>
86 static_assert(std::is_nothrow_constructible<_tPointer>::value,
87 "Invalid pointer type found");
116 return GetPointerRaw();
125 return *GetPointer();
139 template<
typename _type,
typename _tPo
inter>
140 typename GStaticCache<_type, _tPointer>::PointerType
141 GStaticCache<_type, _tPointer>::_ptr;
150 template<
typename _type,
typename _tPo
inter = _type*>
153 static_assert(std::is_nothrow_constructible<_tPointer>::value,
154 "Invalid pointer type found");
197 return GetPointerRaw();
206 return *GetPointer();
const _type & FetchPrototype()
取指定类型的静态原型对象。
static DefGetter(ynothrow, PointerType, PointerRaw, _ptr) static PointerType GetPointer()
取指针。
static PointerType & GetStaticPtrRef() ynothrow
取静态指针引用。
static void Release() ynothrow
删除对象并置指针为空值。
_type & FetchStaticRef()
取指定类型的静态默认对象。
static void Check()
检查是否已经初始化,否则构造新对象。
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
static _type & GetInstance()
取实例引用。
static DefGetter(ynothrow, PointerType, PointerRaw, GetStaticPtrRef()) static PointerType GetPointer()
取指针。
static void Release() ynothrow
删除对象并置指针为空值。
static void Check()
检查是否已经初始化,否则构造新对象。
_type FetchInstance()
取指定类型的无参数构造的对象。
static _type & GetInstance()
取实例引用。