Navigation
Unreal Engine C++ API Reference > Runtime > Core > HAL
Inheritance Hierarchy
- FThreadSafeCounter
- FThreadSafeBool
References
Module | Core |
Header | /Engine/Source/Runtime/Core/Public/HAL/ThreadSafeCounter.h |
Include | #include "HAL/ThreadSafeCounter.h" |
Syntax
class FThreadSafeCounter
Remarks
Thread safe counter
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
Default constructor.Initializes the counter to 0. | ||
![]() |
FThreadSafeCounter
(
const FThreadSafeCounter& Other |
Copy Constructor. | |
![]() |
FThreadSafeCounter
(
int32 Value |
Constructor, initializing counter to passed in value. |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
int32 | Add
(
int32 Amount |
Adds an amount and returns the old value. |
![]() |
int32 | Decrement () |
Decrement and return new value. |
![]() ![]() |
int32 | GetValue () |
Gets the current value. |
![]() |
int32 | Increment () |
Increment and return new value. |
![]() |
int32 | Reset () |
Resets the counter's value to zero. |
![]() |
int32 | Set
(
int32 Value |
Sets the counter to a specific value and returns the old value. |
![]() |
int32 | Subtract
(
int32 Amount |
Subtracts an amount and returns the old value. |
Typedefs
Name | Description |
---|---|
IntegerType |