#include <Atomic.h>
◆ TAtomicBase_Basic() [1/2]
◆ TAtomicBase_Basic() [2/2]
◆ CompareExchange()
Compares the element with an expected value and, only if comparison succeeds, assigns the element to a new value. The previous value is copied into Expected in any case.
- Parameters
-
| Expected | The value to compare to the element, and will hold the existing value of the element after returning. |
| Value | The value to assign, only if Expected matches the element. |
- Returns
- Whether the element compared equal to Expected.
- Note
- It is equivalent to this in non-atomic terms:
bool CompareExchange(T& Expected, T Value) { bool bResult = this->Element == Expected; Expected = this->Element; if (bResult) { this->Element = Value; } return bResult; }
◆ Exchange()
Sets the element to a specific value, returning a copy of the previous value.
- Parameters
-
| Value | The value to set the element to. |
- Returns
- A copy of the previous value.
◆ Load()
Gets a copy of the current value of the element.
- Parameters
-
| Order | The memory ordering semantics to apply to the operation. |
- Returns
- The current value.
◆ Store()
Sets the element to a specific value.
- Parameters
-
| Value | The value to set the element to. |
| Order | The memory ordering semantics to apply to the operation. |
◆ Element
The documentation for this struct was generated from the following file:
- Engine/Source/Runtime/Core/Public/Templates/Atomic.h