FConcertClientLocalDataStore

Maintains a type-safe key/value local map where the values are USTRUCT() struct or a supported basic types (int8, uint8, int16, uint16, int32, uint32, int64, uint64, float, double, bool, [FName](API\Runtime\Core\UObject\FName), [FText](API\Runtime\Core\Internationalization\FText), [FString](API\Runtime\Core\Containers\FString)).

Windows
MacOS
Linux

References

Module

ConcertSyncClient

Header

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

Include

#include "ConcertClientLocalDataStore.h"

Syntax

class FConcertClientLocalDataStore

Remarks

Maintains a type-safe key/value local map where the values are USTRUCT() struct or a supported basic types (int8, uint8, int16, uint16, int32, uint32, int64, uint64, float, double, bool, FName, FText, FString). This class is meant to be used as a local/private client store where the IConcertClientDataStore interface is meant to be used in a client(s)/server scenario.

**Usage example**FConcertClientLocalDataStoreMyStore;FNameMyKey(TEXT("MyKey1"));uint64MyValue=100ull;if(autoStored=MyStore.FetchOrAdd(MyKey,MyValue)){if(Stored=MyStore.Store(MyKey,Stored.GetValue()+10)){check(MyStore.FetchAs<uint64>(MyKey).GetValue()==MyValue+10);if(Stored=MyStore.CompareExchange(MyKey,MyValue+10,MyValue+20)){check(MyStore.FetchAs<uint64>(MyKey).GetValue()==MyValue+20);}}}check(MyStore.FetchAs<uint64>(MyKey).GetValue()==MyValue+20);

Constructors

Name Description

Public function

FConcertClientLocalDataStore()

Constructs the data store map.

Functions

Name Description

Public function

TConcertData...

 

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.

Public function Const

TConcertData...

 

FetchAs

(
    const FName& Key
)

Looks up the specified key, if found and type matches, fetches the corresponding value.

Public function

TConcertData...

 

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.

Public function

TConcertData...

 

Store

(
    const FName& Key,
    const T& Value
)

Looks up the specified key, if it doesn't exist yet, adds new key/value pair at version 1, else if the stored value type matched the specified value type, overwrites the value and increment its version by one, otherwise, the operation fails.

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