IConcertClientDataStore::FetchOrAdd

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.

Windows
MacOS
Linux

References

Module

ConcertSyncClient

Header

/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Public/IConcertClientDataStore.h

Include

#include "IConcertClientDataStore.h"

Syntax

template<typename T>
TFuture< TConcertDataStoreResult< T > > FetchOrAdd
(
    const FName & Key,
    const T & InitialValue
)

Remarks

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().

Returns

Whether or not the key/value pair was added, fetched or the operation failed. The result code can be:

Parameters

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.

See Also

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss