FThreadSafeCounter

Thread safe counter

Windows
MacOS
Linux

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

Name Description

Public function

FThreadSafeCounter()

Default constructor.

Initializes the counter to 0.

Public function

FThreadSafeCounter

(
    const FThreadSafeCounter& Other
)

Copy Constructor.

Public function

FThreadSafeCounter

(
    int32 Value
)

Constructor, initializing counter to passed in value.

Functions

Name Description

Public function

int32

 

Add

(
    int32 Amount
)

Adds an amount and returns the old value.

Public function

int32

 

Decrement()

Decrement and return new value.

Public function Const

int32

 

GetValue()

Gets the current value.

Public function

int32

 

Increment()

Increment and return new value.

Public function

int32

 

Reset()

Resets the counter's value to zero.

Public function

int32

 

Set

(
    int32 Value
)

Sets the counter to a specific value and returns the old value.

Public function

int32

 

Subtract

(
    int32 Amount
)

Subtracts an amount and returns the old value.

Typedefs

Name

Description

IntegerType

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