engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FThreadSafeCounter类 参考

Thread safe counter 更多...

#include <ThreadSafeCounter.h>

+ 类 FThreadSafeCounter 继承关系图:

Public 成员函数

int32 Add (int32 Amount)
 Adds an amount and returns the old value. 更多...
 
int32 Decrement ()
 Decrement and return new value. 更多...
 
 FThreadSafeCounter ()
 Default constructor. 更多...
 
 FThreadSafeCounter (const FThreadSafeCounter &Other)
 Copy Constructor. 更多...
 
 FThreadSafeCounter (int32 Value)
 Constructor, initializing counter to passed in value. 更多...
 
int32 GetValue () const
 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. 更多...
 

详细描述

Thread safe counter

构造及析构函数说明

◆ FThreadSafeCounter() [1/3]

FThreadSafeCounter::FThreadSafeCounter ( )
inline

Default constructor.

Initializes the counter to 0.

◆ FThreadSafeCounter() [2/3]

FThreadSafeCounter::FThreadSafeCounter ( const FThreadSafeCounter &  Other)
inline

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.

参数
OtherThe other thread safe counter to copy

◆ FThreadSafeCounter() [3/3]

FThreadSafeCounter::FThreadSafeCounter ( int32  Value)
inline

Constructor, initializing counter to passed in value.

参数
ValueValue to initialize counter to

成员函数说明

◆ Add()

int32 FThreadSafeCounter::Add ( int32  Amount)
inline

Adds an amount and returns the old value.


参数
AmountAmount to increase the counter by
返回
the old value
参见
Decrement, Increment, Reset, Set, Subtract

◆ Decrement()

int32 FThreadSafeCounter::Decrement ( )
inline

Decrement and return new value.

返回
the new, decremented value
参见
Add, Increment, Reset, Set, Subtract

◆ GetValue()

int32 FThreadSafeCounter::GetValue ( ) const
inline

Gets the current value.

返回
the current value

◆ Increment()

int32 FThreadSafeCounter::Increment ( )
inline

Increment and return new value.

返回
the new, incremented value
参见
Add, Decrement, Reset, Set, Subtract

◆ Reset()

int32 FThreadSafeCounter::Reset ( )
inline

Resets the counter's value to zero.

返回
the old value.
参见
Add, Decrement, Increment, Set, Subtract

◆ Set()

int32 FThreadSafeCounter::Set ( int32  Value)
inline

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

参数
ValueValue to set the counter to
返回
The old value
参见
Add, Decrement, Increment, Reset, Subtract

◆ Subtract()

int32 FThreadSafeCounter::Subtract ( int32  Amount)
inline

Subtracts an amount and returns the old value.


参数
AmountAmount to decrease the counter by
返回
the old value
参见
Add, Decrement, Increment, Reset, Set

该类的文档由以下文件生成: