Navigation
API > API/Plugins > API/Plugins/ModelingComponents
TValueWatcher is used to implement a common Tool pattern where it is necessary to essentially poll a value to see if it has changed, and if it has, call a function. For example UObject UProperties are frequently directly modified by (eg) DetailsView/etc, this results in PropertyChange events that can be used in the editor to respond to changes. However at Runtime no such events are generated and so the Tool has no way of knowing when UProperties change except by polling and comparing with a cached value. The purpose of this class is simply to encapsulate this common pattern/logic.
| Name | TValueWatcher |
| Type | class |
| Header File | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/Changes/ValueWatcher.h |
| Include Path | #include "Changes/ValueWatcher.h" |
Syntax
template<typename ValueType>
class TValueWatcher
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CachedValue | ValueType | Changes/ValueWatcher.h | ||
| GetValueFunc | TFunction< ValueType(void)> | Changes/ValueWatcher.h | ||
| OnValueChangedFunc | TFunction< void(ValueType)> | Changes/ValueWatcher.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CheckAndUpdate() |
Changes/ValueWatcher.h | ||
| Changes/ValueWatcher.h | |||
void SilentUpdate() |
Update known value without calling OnValueChangedFunc. Sometimes necessary during undo/redo. | Changes/ValueWatcher.h |