KDBindings API Documentation
1.0.95
|
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. More... | |
~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 |
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, and KDBindings::Binding< T, EvaluatorT >::m_rootNode.
|
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.
|
inlineoverrideprotected |
|
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::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::Binding< T, EvaluatorT >::m_rootNode.
|
delete |
A Binding can not be move assigned.
|
delete |
A Binding cannot be copy assigned.
|
inlineoverrideprotected |
|
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().