engine
 
载入中...
搜索中...
未找到
静态 Public 成员函数 | Protected 成员函数 | 静态 Protected 成员函数 | Protected 属性 | 所有成员列表
TThreadSingleton< T > 模板类 参考

This a special version of singleton. 更多...

#include <ThreadSingleton.h>

+ 类 TThreadSingleton< T > 继承关系图:

静态 Public 成员函数

static FORCEINLINE T & Get ()
 
static FORCEINLINE T & Get (TFunctionRef< FTlsAutoCleanup *()> CreateInstance)
 
static FORCEINLINE T * TryGet ()
 

Protected 成员函数

 TThreadSingleton ()
 Default constructor.
 

静态 Protected 成员函数

static FTlsAutoCleanup * CreateInstance ()
 

Protected 属性

const uint32 ThreadId
 Thread ID of this thread singleton.
 

额外继承的成员函数

- Public 成员函数 继承自 FTlsAutoCleanup
void Register ()
 Register this instance to be auto-cleanup.
 
virtual ~FTlsAutoCleanup ()
 Virtual destructor.
 

详细描述

template<class T>
class TThreadSingleton< T >

This a special version of singleton.

It means that there is created only one instance for each thread. Calling Get() method is thread-safe.

成员函数说明

◆ CreateInstance()

template<class T >
static FTlsAutoCleanup * TThreadSingleton< T >::CreateInstance ( )
inlinestaticprotected
返回
a new instance of the thread singleton.

◆ Get() [1/2]

template<class T >
static FORCEINLINE T & TThreadSingleton< T >::Get ( )
inlinestatic
返回
an instance of a singleton for the current thread.

◆ Get() [2/2]

template<class T >
static FORCEINLINE T & TThreadSingleton< T >::Get ( TFunctionRef< FTlsAutoCleanup *()>  CreateInstance)
inlinestatic
参数
CreateInstanceFunction to call when a new instance must be created.
返回
an instance of a singleton for the current thread.

◆ TryGet()

template<class T >
static FORCEINLINE T * TThreadSingleton< T >::TryGet ( )
inlinestatic
返回
pointer to an instance of a singleton for the current thread. May be nullptr, prefer to use access by reference

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