TThreadSingleton

This a special version of singleton.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/HAL/ThreadSingleton.h

Include

#include "HAL/ThreadSingleton.h"

Syntax

template<class T>
class TThreadSingleton : public FTlsAutoCleanup

Remarks

This a special version of singleton. It means that there is created only one instance for each thread. Calling Get() method is thread-safe.

Variables

Name Description

Protected variable

const uint32

 

ThreadId

Thread ID of this thread singleton.

Constructors

Name Description

Protected function

TThreadSingleton()

Default constructor.

Functions

Name Description

Protected function Static

FTlsAutoClea...

 

CreateInstance()

Public function Static

T &

 

Get()

Public function Static

T &

 

Get

(
    TFunctionRef< FTlsAutoCleanup*...
)

Public function Static

T *

 

TryGet()