KDBindings API Documentation
1.0.95
|
A PropertyUpdater defines the interface used to update a Property, e.g. from a binding expression. More...
#include <property_updater.h>
Public Member Functions | |
PropertyUpdater ()=default | |
PropertyUpdater (PropertyUpdater &&other)=default | |
PropertyUpdater (PropertyUpdater const &other)=default | |
virtual | ~PropertyUpdater ()=default |
virtual T | get () const =0 |
PropertyUpdater & | operator= (PropertyUpdater &&other)=default |
PropertyUpdater & | operator= (PropertyUpdater const &other)=default |
virtual void | setUpdateFunction (std::function< void(T &&)> const &updateFunction)=0 |
A PropertyUpdater defines the interface used to update a Property, e.g. from a binding expression.
An instance of this class (wrapped in a std::unique_ptr) can be passed to the Property constructor. The Property will then become read-only, meaning an instance of ReadOnlyProperty will be thrown if the Property's value is updated through any other means than through the PropertyUpdater.
The Property constructor will pass a function to setUpdateFunction() for this purpose. This function is then the only way to update the Property without encountering a ReadOnlyProperty error.
The most typical use of PropertyUpdater is in instances of Binding, which are created by makeBoundProperty().
Definition at line 31 of file property_updater.h.
|
default |
A PropertyUpdater can be default constructed.
|
virtualdefault |
A PropertyUpdater has a virtual destructor.
|
default |
A PropertyUpdater can be copy constructed.
|
default |
A PropertyUpdater can be move constructed.
|
pure virtual |
The get() function must return the current value the PropertyUpdater wants to assign to the Property.
It is called from the Property constructor.
Implemented in KDBindings::Binding< T, EvaluatorT >, and KDBindings::Binding< T, BindingEvaluator >.
|
default |
A PropertyUpdater can be move assigned.
|
default |
A PropertyUpdater can be copy assigned.
|
pure virtual |
The Property will call this function when it constructed and pass a std::function as argument that allows the PropertyUpdater to update the Property value.
A PropertyUpdater typically saves this function and calls it once the value it computes changes.
Implemented in KDBindings::Binding< T, EvaluatorT >, and KDBindings::Binding< T, BindingEvaluator >.