FThreadSafeCounter

Inheritance Hierarchy

FThreadSafeCounter

FThreadSafeBool

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

References

Module

Core

Header

Runtime/Core/Public/HAL/ThreadSafeCounter.h