25 _value(value), _func(func) {}
48 _observers.push_back(observer);
58 for (
auto obs: _observers) {
59 obs->observe(_value, value);
Callback-on-change property.
Property(const T &value)
Create an observable property with value.
T & operator=(const T &value)
Set the value and start the callback.
T & operator=(const T &value)
Set the value and call the observers.
void addObserver(PropertyObserver< T > *observer)
Add an observer.
Property observer (Observer pattern)
CallbackProperty(const T &value, std::function< void(const T &, const T &)> func)
Create a callback property with value and function.