TValueWatcher

[TValueWatcher](API\Plugins\ModelingComponents\Changes\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.

Windows
MacOS
Linux

References

Module

ModelingComponents

Header

/Engine/Plugins/Experimental/MeshModelingToolset/Source/ModelingComponents/Public/Changes/ValueWatcher.h

Include

#include "Changes/ValueWatcher.h"

Syntax

template<typename ValueType>
class TValueWatcher

Remarks

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.

Functions

Name Description

Public function

void

 

CheckAndUpdate()

Public function

void

 

Initialize

(
    TFunction< ValueType(void)> GetValu...,
    TFunction< void> OnValue...,
    ValueType InitialValue
)

Public function

void

 

SilentUpdate()

Update known value without calling OnValueChangedFunc. Sometimes necessary during undo/redo.

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