Module |
|
Header |
/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Public/IConcertClientDataStore.h |
Include |
#include "IConcertClientDataStore.h" |
template<typename T>
TFuture< TConcertDataStoreResult< T > > CompareExchange
(
const FName & Key,
const T & Expected,
const T & Desired
)
Exchanges the stored value to Desired if a stored value corresponding to Key exists, has the same type and its value is equal to Expected, otherwise, the operation fails.
Whether or not the key value was exchanged, as a future. The result code can be:
EConcertDataStoreResultCode::Exchanged if the desired value was sucessfully exchanged and stored.
EConcertDataStoreResultCode::Fetched if the stored value was not the expected one. The stored value was fetched instead.
EConcertDataStoreResultCode::NotFound if the key could not be found.
EConcertDataStoreResultCode::TypeMismatch if the stored data type did not match the expected/desired type.
Parameter |
Description |
---|---|
T |
Any USTRUCT() struct or a supported basic types (int8, uint8, int16, uint16, int32, uint32, int64, uint64, float, double, bool, FName, FText, FString). |
Key |
The value name. |
Expected |
The value the caller expects to be stored. |
Desired |
The value the caller wants to store. |