#include <ThreadSafeCounter.h>
◆ IntegerType
◆ FThreadSafeCounter() [1/2]
| FThreadSafeCounter::FThreadSafeCounter |
( |
int32 |
Value = 0 | ) |
|
|
inline |
Constructor, initializing counter to passed in value.
- Parameters
-
| Value | Value to initialize counter to |
◆ FThreadSafeCounter() [2/2]
Copy Constructor.
If the counter in the Other parameter is changing from other threads, there are no guarantees as to which values you will get up to the caller to not care, synchronize or other way to make those guarantees.
- Parameters
-
| Other | The other thread safe counter to copy |
◆ Add()
◆ Decrement()
| int32 FThreadSafeCounter::Decrement |
( |
| ) |
|
|
inline |
◆ GetValue()
| int32 FThreadSafeCounter::GetValue |
( |
| ) |
const |
|
inline |
Gets the current value.
- Returns
- the current value
◆ Increment()
| int32 FThreadSafeCounter::Increment |
( |
| ) |
|
|
inline |
◆ Reset()
| int32 FThreadSafeCounter::Reset |
( |
| ) |
|
|
inline |
◆ Set()
Sets the counter to a specific value and returns the old value.
- Parameters
-
| Value | Value to set the counter to |
- Returns
- The old value
- See also
- Add, Decrement, Increment, Reset, Subtract
◆ Subtract()
| int32 FThreadSafeCounter::Subtract |
( |
int32 |
Amount | ) |
|
|
inline |
Subtracts an amount and returns the old value.
- Parameters
-
| Amount | Amount to decrease the counter by |
- Returns
- the old value
- See also
- Add, Decrement, Increment, Reset, Set
The documentation for this class was generated from the following file: