Skip to content

KDBindings::BindingEvaluator

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

#include <binding_evaluator.h>

Inherited by KDBindings::ImmediateBindingEvaluator

Public Functions

Name
BindingEvaluator() =default
BindingEvaluator(BindingEvaluator && other) =delete
BindingEvaluator(const BindingEvaluator & ) =default
void evaluateAll() const
BindingEvaluator & operator=(BindingEvaluator && other) =delete
BindingEvaluator & operator=(const BindingEvaluator & ) =default

Friends

Name
class Binding

Detailed Description

1
class KDBindings::BindingEvaluator;

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:

Public Functions Documentation

function BindingEvaluator

1
BindingEvaluator() =default

A BindingEvaluator can be default constructed

function BindingEvaluator

1
2
3
BindingEvaluator(
    BindingEvaluator && other
) =delete

A BindingEvaluator can not be move constructed.

function BindingEvaluator

1
2
3
BindingEvaluator(
    const BindingEvaluator & 
) =default

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.

function evaluateAll

1
inline void evaluateAll() const

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.

function operator=

1
2
3
BindingEvaluator & operator=(
    BindingEvaluator && other
) =delete

A BindingEvaluator can not be move assigned.

function operator=

1
2
3
BindingEvaluator & operator=(
    const BindingEvaluator & 
) =default

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.

Friends

friend Binding

1
2
3
friend class Binding(
    Binding 
);

Updated on 2024-07-13 at 00:00:32 +0000