Module |
|
Header |
/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Public/IConcertClientDataStore.h |
Include |
#include "IConcertClientDataStore.h" |
template<typename T>
TFuture< TConcertDataStoreResult< T > > FetchOrAdd
(
const FName & Key,
const T & InitialValue
)
Searches the store for the specified key, if not found, adds a new key/value pair, otherwise, if the stored value type matches the initial value type, fetches the stored value. The function accepts a USTRUCT() type or a supported basic type directly. To store complex types such as TArray<> TMap<> or TSet<>, wrap the type(s) in a USTRUCT().
Whether or not the key/value pair was added, fetched or the operation failed. The result code can be:
EConcertDataStoreResultCode::Added if the key/value was inserted.
EConcertDataStoreResultCode::Fetched if the key was already taken and type matched.
EConcertDataStoreResultCode::TypeMismatch if the key was already taken but the value types did not match.
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 to fetch or add. |
InitialValue |
The property value to store if the key doesn't already exist. |