KDBindings API Documentation  1.0.95
Classes | Public Member Functions | List of all members
KDBindings::BindingEvaluator Class Reference

A BindingEvaluator provides a mechanism to control the exact time when a KDBindings::Binding is reevaluated. More...

#include <binding_evaluator.h>

Public Member Functions

 BindingEvaluator ()=default
 
 BindingEvaluator (BindingEvaluator &&other) noexcept=delete
 
 BindingEvaluator (const BindingEvaluator &) noexcept=default
 
void evaluateAll () const
 
BindingEvaluatoroperator= (BindingEvaluator &&other) noexcept=delete
 
BindingEvaluatoroperator= (const BindingEvaluator &) noexcept=default
 

Detailed Description

A BindingEvaluator provides a mechanism to control the exact time when a KDBindings::Binding is reevaluated.

A BindingEvaluator represents a collection of Binding instances that can be selectively reevaluated.

If a Binding is created using KDBindings::makeBoundProperty with a BindingEvaluator, the Binding will only be evaluated if BindingEvaluator::evaluateAll is called on the given evaluator.

Note that instances of BindingEvaluator internally wrap their collection of Bindings in such a way that copying a BindingEvaluator does not actually copy the collection of Bindings. Therefore adding a Binding to a copy of a BindingEvaluator will also add it to the original. This is done for ease of use, so evaluators can be passed around easily throughout the codebase.

Examples:

Definition at line 41 of file binding_evaluator.h.

Constructor & Destructor Documentation

◆ BindingEvaluator() [1/3]

KDBindings::BindingEvaluator::BindingEvaluator ( )
default

A BindingEvaluator can be default constructed

◆ BindingEvaluator() [2/3]

KDBindings::BindingEvaluator::BindingEvaluator ( const BindingEvaluator )
defaultnoexcept

A BindingEvaluator can be copy constructed.

Note that copying the evaluator will NOT create a new collection of Binding instances, but the new evaluator will refer to the same collection, so creating a new Binding with this evaluator will also modify the previous one.

◆ BindingEvaluator() [3/3]

KDBindings::BindingEvaluator::BindingEvaluator ( BindingEvaluator &&  other)
deletenoexcept

A BindingEvaluator can not be move constructed.

Member Function Documentation

◆ evaluateAll()

void KDBindings::BindingEvaluator::evaluateAll ( ) const
inline

This function evaluates all Binding instances that were constructed with this evaluator, in the order they were inserted.

It will therefore update the associated Property instances as well.

Definition at line 89 of file binding_evaluator.h.

◆ operator=() [1/2]

BindingEvaluator& KDBindings::BindingEvaluator::operator= ( BindingEvaluator &&  other)
deletenoexcept

A BindingEvaluator can not be move assigned.

◆ operator=() [2/2]

BindingEvaluator& KDBindings::BindingEvaluator::operator= ( const BindingEvaluator )
defaultnoexcept

A BindingEvaluator can be copy assigned.

Note that copying the evaluator will NOT create a new collection of Binding instances, but the new evaluator will refer to the same collection, so creating a new Binding with this evaluator will also modify the previous one.


The documentation for this class was generated from the following file:

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDBindings
Reactive programming & data binding in C++
https://github.com/KDAB/KDBindings/
Generated by doxygen 1.9.1