KDDockWidgets API Documentation 2.1
|
A combination of a root Node with an evaluator. More...
#include <binding.h>
Public Member Functions | |
Binding ()=delete | |
Binding (Binding &&other)=delete | |
Binding (Binding const &other)=delete | |
Binding (Private::Node< T > &&rootNode, EvaluatorT const &evaluator) | |
Construct a new Binding with a specific evaluator. | |
~Binding () override | |
void | evaluate () |
T | get () const override |
Binding & | operator= (Binding &&other)=delete |
Binding & | operator= (Binding const &other)=delete |
void | setUpdateFunction (std::function< void(T &&)> const &updateFunction) override |
Public Member Functions inherited from KDBindings::PropertyUpdater< T > | |
PropertyUpdater ()=default | |
PropertyUpdater (PropertyUpdater &&other)=default | |
PropertyUpdater (PropertyUpdater const &other)=default | |
virtual | ~PropertyUpdater ()=default |
PropertyUpdater & | operator= (PropertyUpdater &&other)=default |
PropertyUpdater & | operator= (PropertyUpdater const &other)=default |
Public Member Functions inherited from KDBindings::Private::Dirtyable | |
Dirtyable ()=default | |
virtual | ~Dirtyable ()=default |
bool | isDirty () const |
virtual void | markDirty () |
void | setParent (Dirtyable *newParent) |
Protected Member Functions | |
const bool * | dirtyVariable () const override |
Private::Dirtyable ** | parentVariable () override |
Protected Attributes | |
int | m_bindingId = -1 |
EvaluatorT | m_evaluator |
std::function< void(T &&)> | m_propertyUpdateFunction = [](T &&) {} |
Private::Node< T > | m_rootNode |
A combination of a root Node with an evaluator.
A root Node is formed whenever multiple properties are combined inside a expression and an evaluator is responsible for re-evaluating such an expression whenever any of the constituent properties change.
|
inlineexplicit |
Construct a new Binding with a specific evaluator.
rootNode | Represents that expression contained in the Binding. |
evaluator | Used to evaluate the expression contained in the Binding. |
Definition at line 47 of file binding.h.
References KDBindings::Binding< T, EvaluatorT >::m_bindingId, KDBindings::Binding< T, EvaluatorT >::m_evaluator, KDBindings::Binding< T, EvaluatorT >::m_rootNode, and KDBindings::Private::Node< ResultType >::setParent().
|
inlineoverride |
Destructs the Binding by deregistering it from its evaluator.
Definition at line 56 of file binding.h.
References KDBindings::Binding< T, EvaluatorT >::m_bindingId, and KDBindings::Binding< T, EvaluatorT >::m_evaluator.
|
delete |
A Binding is not default constructible.
|
delete |
A Binding cannot be copy constructed.
|
delete |
A Binding can not be move constructed.
|
inlineoverrideprotectedvirtual |
Implements KDBindings::Private::Dirtyable.
|
inline |
Re-evaluates the value of the Binding and notifies all dependants of the change.
Definition at line 88 of file binding.h.
References KDBindings::Private::Node< ResultType >::evaluate(), KDBindings::Binding< T, EvaluatorT >::m_propertyUpdateFunction, and KDBindings::Binding< T, EvaluatorT >::m_rootNode.
Referenced by KDBindings::Binding< T, ImmediateBindingEvaluator >::markDirty().
|
inlineoverridevirtual |
Returns the current value of the Binding.
Implements KDBindings::PropertyUpdater< T >.
Definition at line 85 of file binding.h.
References KDBindings::Private::Node< ResultType >::evaluate(), and KDBindings::Binding< T, EvaluatorT >::m_rootNode.
|
delete |
A Binding can not be move assigned.
|
delete |
A Binding cannot be copy assigned.
|
inlineoverrideprotectedvirtual |
Implements KDBindings::Private::Dirtyable.
|
inlineoverridevirtual |
Set the function that should be used to notify associated properties when the Binding re-evaluates.
Implements KDBindings::PropertyUpdater< T >.
Definition at line 79 of file binding.h.
References KDBindings::Binding< T, EvaluatorT >::m_propertyUpdateFunction.
|
protected |
The id of the Binding, used for keeping track of the Binding in its evaluator.
Definition at line 107 of file binding.h.
Referenced by KDBindings::Binding< T, EvaluatorT >::Binding(), and KDBindings::Binding< T, EvaluatorT >::~Binding().
|
protected |
The evaluator responsible for evaluating this Binding.
Definition at line 103 of file binding.h.
Referenced by KDBindings::Binding< T, EvaluatorT >::Binding(), and KDBindings::Binding< T, EvaluatorT >::~Binding().
|
protected |
The function used to notify associated properties when the Binding re-evaluates
Definition at line 105 of file binding.h.
Referenced by KDBindings::Binding< T, EvaluatorT >::evaluate(), and KDBindings::Binding< T, EvaluatorT >::setUpdateFunction().
|
protected |
The root Node of the Binding represents the expression contained by the Binding.
Definition at line 101 of file binding.h.
Referenced by KDBindings::Binding< T, EvaluatorT >::Binding(), KDBindings::Binding< T, EvaluatorT >::evaluate(), and KDBindings::Binding< T, EvaluatorT >::get().