TAtomic

Atomic object wrapper class which wraps an element of T.

Windows
MacOS
Linux

Inheritance Hierarchy

UE4Atomic_Private::TAtomicBaseType_T< T >

TAtomic

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Templates/Atomic.h

Include

#include "Templates/Atomic.h"

Syntax

template<typename T>
class TAtomic : public UE4Atomic_Private::TAtomicBaseType_T< T >

Remarks

Atomic object wrapper class which wraps an element of T. This allows the following benefits:

  • Changes made to the element on one thread can never be observed as a partial state by other threads. (atomicity)

  • Memory accesses within a thread are not reordered across any access of the element. (acquire/release semantics)

  • There is a single, visible, global order of atomic accesses throughout the system. (sequential consistency)

Constructors

Name Description

Public function

TAtomic()

Default initializes the element type.

Public function

TAtomic

(
    T Arg
)

Initializes the element type with the given argument types.

This constructor is not atomic.

Operators

Name Description

Public function Const

 

operator T()

Gets a copy of the current value of the element.

Public function

T

 

operator=

(
    T Value
)

Sets the element to a specific value, returning a copy of the value.

Typedefs

Name

Description

ElementType

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss