Module |
|
Header |
/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Public/ConcertClientLocalDataStore.h |
Include |
#include "ConcertClientLocalDataStore.h" |
class 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, 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);
Name | Description | |
---|---|---|
|
FConcertClientLocalDataStore() |
Constructs the data store map. |
Name | Description | ||
---|---|---|---|
|
TConcertData... |
CompareExchange ( |
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. |
|
TConcertData... |
FetchAs ( |
Looks up the specified key, if found and type matches, fetches the corresponding value. |
|
TConcertData... |
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. |
|
TConcertData... |
Store ( |
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. |