33 template<
typename T,
typename EvaluatorT = BindingEvaluator>
37 std::is_base_of<BindingEvaluator, EvaluatorT>::value,
38 "The EvaluatorT type must inherit from BindingEvaluator.");
47 explicit Binding(Private::Node<T> &&rootNode, EvaluatorT
const &evaluator)
122 template<
typename T,
typename EvaluatorT>
125 return std::make_unique<Binding<T, EvaluatorT>>(Private::makeNode(property), evaluator);
140 template<
typename T,
typename EvaluatorT>
143 return std::make_unique<Binding<T, EvaluatorT>>(Private::makeNode(property), evaluator);
158 template<
typename T,
typename EvaluatorT>
159 inline std::unique_ptr<Binding<T, EvaluatorT>>
makeBinding(EvaluatorT &evaluator, Private::Node<T> &&rootNode)
161 return std::make_unique<Binding<T, EvaluatorT>>(std::move(rootNode), evaluator);
180 template<
typename EvaluatorT,
typename Func,
typename... Args,
typename = std::enable_if_t<
sizeof...(Args) != 0>,
typename ResultType = Private::operator_node_result_t<Func, Args...>>
183 return std::make_unique<Binding<ResultType, EvaluatorT>>(Private::makeNode(std::forward<Func>(func), std::forward<Args>(args)...), evaluator);
245 return std::make_unique<Binding<T, ImmediateBindingEvaluator>>(Private::makeNode(property));
263 return std::make_unique<Binding<T, ImmediateBindingEvaluator>>(Private::makeNode(property));
278 inline std::unique_ptr<Binding<T, ImmediateBindingEvaluator>>
makeBinding(Private::Node<T> &&rootNode)
280 return std::make_unique<Binding<T, ImmediateBindingEvaluator>>(std::move(rootNode));
297 template<
typename Func,
typename... Args,
typename = std::enable_if_t<
sizeof...(Args) != 0>,
typename ResultType = Private::operator_node_result_t<Func, Args...>>
300 return std::make_unique<Binding<ResultType, ImmediateBindingEvaluator>>(Private::makeNode(std::forward<Func>(func), std::forward<Args>(args)...));
327 template<
typename... T>
330 auto binding =
makeBinding(std::forward<T>(args)...);
331 return Property<decltype(binding->get())>(std::move(binding));
A BindingEvaluator provides a mechanism to control the exact time when a KDBindings::Binding is reeva...
A combination of a root Node with an evaluator.
void setUpdateFunction(std::function< void(T &&)> const &updateFunction) override
Binding & operator=(Binding &&other)=delete
Private::Dirtyable ** parentVariable() override
std::function< void(T &&)> m_propertyUpdateFunction
Binding(Binding &&other)=delete
const bool * dirtyVariable() const override
Binding(Private::Node< T > &&rootNode, EvaluatorT const &evaluator)
Construct a new Binding with a specific evaluator.
Binding(Binding const &other)=delete
Binding & operator=(Binding const &other)=delete
Private::Node< T > m_rootNode
A PropertyUpdater defines the interface used to update a Property, e.g. from a binding expression.
A property represents a value that can be part of or the result of data binding.
The main namespace of the KDBindings library.
std::unique_ptr< Binding< T, EvaluatorT > > makeBinding(EvaluatorT &evaluator, Property< T > &property)
Helper function to create a Binding from a Property.
auto makeBoundProperty(T &&...args)
Helper function to create a Property with a Binding.