Navigation
API > API/Runtime > API/Runtime/Analytics > API/Runtime/Analytics/FAnalyticsPropertyStore > API/Runtime/Analytics/FAnalyticsPropertyStore/Set
- IAnalyticsPropertyStore::Set()
- FAnalyticsPropertyStore::Set()
References
| Module | Analytics |
| Header | /Engine/Source/Runtime/Analytics/Analytics/Public/AnalyticsPropertyStore.h |
| Include | #include "AnalyticsPropertyStore.h" |
| Source | /Engine/Source/Runtime/Analytics/Analytics/Private/AnalyticsPropertyStore.cpp |
virtual EStatusCode Set
&40;
const FString & Key,
int32 Value,
const TFunction< bool(const int32 &42;, const int32 &)> & ConditionFn
&41;
Remarks
Conditionnnaly adds or updates the specified key/value pair. The operation is atomic from the caller perspective. The function reads the actual value (if it exists), invoke the ConditionFn callback and write the value back if the condition function returns true. If the key doesn't exist, the actual value passed back to the condition function is null. If the condition function returns true, the proposed value is set, otherwise, the operation is declined and the store remains unchanged. One of the following code
- EStatusCode::Success if the entire operation succeeded.
- EStatusCode::BadType if the key/value pair exists, but the proposed value did not match the actual value type.
- EStatusCode::Declined if the callback ConditionFn returned false and the operation was declined.
Parameters
| Name | Description |
|---|---|
| Key | The name of the property to add or update. |
| Value | The value proposed. This value is passed as the second parameter to the ConditionFn callback. |
| ConditionFn | Function invoked back with the actual value and the proposed value to let the caller decide whether the proposed value should be set or not. If the callback function returns true, the proposed value is added/updated, otherwise, nothing changes. |