Navigation
API > API/Plugins > API/Plugins/ConcertSyncClient
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 exampleFConcertClientLocalDataStoreMyStore;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
| Type | Name | Description | |
|---|---|---|---|
| Constructs the data store map. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| TConcertDataStoreResult< T > | CompareExchange
(
const FName& Key, |
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. | |
| TConcertDataStoreResult< T > | Looks up the specified key, if found and type matches, fetches the corresponding value. | ||
| TConcertDataStoreResult< T > | FetchOrAdd
(
const FName& Key, |
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. | |
| TConcertDataStoreResult< T > | 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. |