Kanzi  3.9.4
Kanzi Engine API
kanzi::BindingHostConceptImpl< TDerivedClass > Class Template Reference

Implementation class for BindingHostConcept. More...

#include <kanzi/core.ui/binding/binding_host_concept_impl.hpp>

Inheritance diagram for kanzi::BindingHostConceptImpl< TDerivedClass >:
[legend]

Public Member Functions

void addBindingRuntime (AbstractBindingRuntimeSharedPtr entry, shared_ptr< void > owner)
 Adds an already-created binding runtime to this binding host. More...
 
AbstractBindingRuntimeSharedPtr setBinding (AbstractBindingSharedPtr binding, shared_ptr< TDerivedClass > templateRoot, AbstractPropertyType propertyType, PropertyField field, PropertyValuePrecedence precedence)
 Wrapper for setting a binding. More...
 
AbstractBindingRuntimeSharedPtr setBinding (AbstractBindingSharedPtr binding, shared_ptr< TDerivedClass > templateRoot, AbstractPropertyType propertyType, PropertyField field)
 Wrapper for setting a binding. More...
 
AbstractBindingRuntimeSharedPtr setBinding (AbstractBindingSharedPtr binding, shared_ptr< TDerivedClass > templateRoot, AbstractPropertyType propertyType, PropertyValuePrecedence precedence)
 Wrapper for setting a binding. More...
 
AbstractBindingRuntimeSharedPtr setBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType, PropertyField field, PropertyValuePrecedence precedence)
 Wrapper for setting a binding. More...
 
AbstractBindingRuntimeSharedPtr setBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType, PropertyField field)
 Wrapper for setting a binding. More...
 
AbstractBindingRuntimeSharedPtr setBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType, PropertyValuePrecedence precedence)
 Wrapper for setting a binding. More...
 
AbstractBindingRuntimeSharedPtr setBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType)
 Wrapper for setting a binding. More...
 
AbstractBindingRuntimeSharedPtr setBinding (AbstractBindingSharedPtr binding, shared_ptr< TDerivedClass > templateRoot)
 Sets a binding with no target. More...
 
AbstractBindingRuntimeSharedPtr setBinding (AbstractBindingSharedPtr binding)
 Wrapper for setting a binding with no target. More...
 
AbstractBindingRuntimeSharedPtr setBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, shared_ptr< TDerivedClass > templateRoot, AbstractPropertyType propertyType, PropertyField field, PropertyValuePrecedence precedence)
 Sets a binding to a certain property. More...
 
AbstractBindingRuntimeSharedPtr setBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, AbstractPropertyType propertyType, PropertyField field, PropertyValuePrecedence precedence)
 Wrapper for setting a binding with owner. More...
 
AbstractBindingRuntimeSharedPtr setBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, AbstractPropertyType propertyType)
 Wrapper for setting a binding with owner. More...
 
AbstractBindingRuntimeSharedPtr setBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, shared_ptr< TDerivedClass > templateRoot)
 Sets a binding with no target. More...
 
AbstractBindingRuntimeSharedPtr setBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner)
 Wrapper for setting a binding with no target. More...
 
AbstractBindingRuntimeSharedPtr setModifierBinding (AbstractBindingSharedPtr binding, shared_ptr< TDerivedClass > templateRoot, AbstractPropertyType propertyType, PropertyField field)
 Wrapper for setting a modifier binding. More...
 
AbstractBindingRuntimeSharedPtr setModifierBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType, PropertyField field)
 Wrapper for setting a modifier binding. More...
 
AbstractBindingRuntimeSharedPtr setModifierBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType)
 Wrapper for setting a modifier binding. More...
 
AbstractBindingRuntimeSharedPtr setModifierBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, shared_ptr< TDerivedClass > templateRoot, AbstractPropertyType propertyType, PropertyField field)
 Sets a modifier binding. More...
 
AbstractBindingRuntimeSharedPtr setModifierBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, AbstractPropertyType propertyType, PropertyField field)
 Wrapper for setting a modifier binding. More...
 
AbstractBindingRuntimeSharedPtr setModifierBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, AbstractPropertyType propertyType)
 Wrapper for setting a modifier binding. More...
 
- Public Member Functions inherited from kanzi::BindingHostConcept
BindingRuntimeConstIterator beginBindingRuntimes () const
 Returns an iterator to the beginning of binding runtimes. More...
 
BindingRuntimeConstIterator endBindingRuntimes () const
 Returns an iterator to the end of binding runtimes. More...
 
AbstractBindingRuntimeSharedPtr getBindingRuntime (size_t idx)
 Gets binding by index. More...
 
size_t getBindingRuntimeCount () const
 Gets the number of binding runtimes added to this node. More...
 
void removeAllBindings ()
 Removes all binding runtimes. More...
 
void removeBinding (AbstractBindingRuntime &bindingRuntime)
 Removes a binding runtime added earlier. More...
 
void removeBindingsWithOwner (shared_ptr< void > owner)
 Removes all binding runtimes with the specified owner. More...
 

Protected Member Functions

BindingTargetRuntimePtr createModifierBindingTarget (shared_ptr< TDerivedClass > templateRoot, AbstractPropertyType propertyType, PropertyField field)
 Creates a property modifier binding target for given combination of property type and field. More...
 
BindingTargetRuntimePtr createValueSourceBindingTarget (shared_ptr< TDerivedClass > templateRoot, AbstractPropertyType propertyType, PropertyField field, PropertyValuePrecedence precedence, bool reuseAllowed)
 Creates a value source binding target for given combination of property type and field. More...
 
TDerivedClass * getThisObject ()
 Internal accessor for the Curiously Recurring Template Pattern. More...
 
const TDerivedClass * getThisObject () const
 Internal accessor for the Curiously Recurring Template Pattern. More...
 
- Protected Member Functions inherited from kanzi::BindingHostConcept
void attachBindings ()
 Attach all bindings stored in this object. More...
 
void detachBindings ()
 Detach bindings. More...
 

Additional Inherited Members

- Public Types inherited from kanzi::BindingHostConcept
using BindingHostConceptSharedPtr = shared_ptr< BindingHostConcept >
 Binding host concept shared pointer type. More...
 
using BindingRuntimeConstIterator = BindingRuntimeContainer::const_iterator
 Const iterator for binding runtimes. More...
 
using BindingRuntimeContainer = vector< AbstractBindingRuntimeSharedPtr >
 Container for binding runtimes. More...
 
using BindingRuntimeIterator = BindingRuntimeContainer::iterator
 Iterator for binding runtimes. More...
 
- Protected Attributes inherited from kanzi::BindingHostConcept
BindingRuntimeContainer m_bindingRuntimes
 Bindings in this object. More...
 

Detailed Description

template<typename TDerivedClass>
class kanzi::BindingHostConceptImpl< TDerivedClass >

Implementation class for BindingHostConcept.

Specifies interface to set bindings to the properties while adding them to the binding host.

Classes using bindings must inherit this class while specializing with their class name.

Since
Kanzi 3.9.0

Member Function Documentation

◆ setBindingWithOwner() [1/5]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBindingWithOwner ( AbstractBindingSharedPtr  binding,
shared_ptr< void >  owner,
shared_ptr< TDerivedClass >  templateRoot,
AbstractPropertyType  propertyType,
PropertyField  field,
PropertyValuePrecedence  precedence 
)
inline

Sets a binding to a certain property.

Using PropertyValuePrecedenceLocal erases earlier local value or binding to the property.

Parameters
bindingBinding to set.
ownerOwner shared pointer for the binding.
templateRootOverriding template root for the binding.
propertyTypeTarget property type.
fieldProperty field.
precedencePrecedence of the value source binding.
Returns
Binding runtime created for the binding or nullptr if the creation failed.

◆ setBindingWithOwner() [2/5]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBindingWithOwner ( AbstractBindingSharedPtr  binding,
shared_ptr< void >  owner,
AbstractPropertyType  propertyType,
PropertyField  field,
PropertyValuePrecedence  precedence 
)
inline

Wrapper for setting a binding with owner.

Parameters
bindingBinding to set.
ownerOwner shared pointer for the binding.
propertyTypeTarget property type.
fieldProperty field.
precedencePrecedence of the value source binding.
Returns
Binding runtime created for the binding.

◆ setBindingWithOwner() [3/5]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBindingWithOwner ( AbstractBindingSharedPtr  binding,
shared_ptr< void >  owner,
AbstractPropertyType  propertyType 
)
inline

Wrapper for setting a binding with owner.

Parameters
bindingBinding to set.
ownerOwner shared pointer for the binding.
propertyTypeTarget property type.
Returns
Binding runtime created for the binding.

◆ setBinding() [1/9]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBinding ( AbstractBindingSharedPtr  binding,
shared_ptr< TDerivedClass >  templateRoot,
AbstractPropertyType  propertyType,
PropertyField  field,
PropertyValuePrecedence  precedence 
)
inline

Wrapper for setting a binding.

Parameters
bindingBinding to set.
templateRootOverriding template root for the binding.
propertyTypeTarget property type.
fieldProperty field.
precedencePrecedence of the value source binding.
Returns
Binding runtime created for the binding.

◆ setBinding() [2/9]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBinding ( AbstractBindingSharedPtr  binding,
shared_ptr< TDerivedClass >  templateRoot,
AbstractPropertyType  propertyType,
PropertyField  field 
)
inline

Wrapper for setting a binding.

Parameters
bindingBinding to set.
templateRootOverriding template root for the binding.
propertyTypeTarget property type.
fieldProperty field.
Returns
Binding runtime created for the binding.

◆ setBinding() [3/9]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBinding ( AbstractBindingSharedPtr  binding,
shared_ptr< TDerivedClass >  templateRoot,
AbstractPropertyType  propertyType,
PropertyValuePrecedence  precedence 
)
inline

Wrapper for setting a binding.

Whole property is used.

Parameters
bindingBinding to set.
templateRootOverriding template root for the binding.
propertyTypeTarget property type.
precedencePrecedence of the value source binding.
Returns
Binding runtime created for the binding.

◆ setBinding() [4/9]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBinding ( AbstractBindingSharedPtr  binding,
AbstractPropertyType  propertyType,
PropertyField  field,
PropertyValuePrecedence  precedence 
)
inline

Wrapper for setting a binding.

Parameters
bindingBinding to set.
propertyTypeTarget property type.
fieldProperty field.
precedencePrecedence of the value source binding.
Returns
Binding runtime created for the binding.

◆ setBinding() [5/9]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBinding ( AbstractBindingSharedPtr  binding,
AbstractPropertyType  propertyType,
PropertyField  field 
)
inline

Wrapper for setting a binding.

Local precedence is used.

Parameters
bindingBinding to set.
propertyTypeTarget property type.
fieldProperty field.
Returns
Binding runtime created for the binding.

◆ setBinding() [6/9]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBinding ( AbstractBindingSharedPtr  binding,
AbstractPropertyType  propertyType,
PropertyValuePrecedence  precedence 
)
inline

Wrapper for setting a binding.

Whole property is used.

Parameters
bindingBinding to set.
propertyTypeTarget property type.
precedencePrecedence of the value source binding.
Returns
Binding runtime created for the binding.

◆ setBinding() [7/9]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBinding ( AbstractBindingSharedPtr  binding,
AbstractPropertyType  propertyType 
)
inline

Wrapper for setting a binding.

Whole property is used. Local precedence is used.

Parameters
bindingBinding to set.
propertyTypeTarget property type.
Returns
Binding runtime created for the binding.

◆ setBindingWithOwner() [4/5]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBindingWithOwner ( AbstractBindingSharedPtr  binding,
shared_ptr< void >  owner,
shared_ptr< TDerivedClass >  templateRoot 
)
inline

Sets a binding with no target.

The binding has no target. You can use the binding to execute binding processors.

Parameters
bindingBinding to set.
ownerOwner shared pointer for the binding.
templateRootOverriding template root for the binding.
Returns
Binding runtime created for the binding.

◆ setBindingWithOwner() [5/5]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBindingWithOwner ( AbstractBindingSharedPtr  binding,
shared_ptr< void >  owner 
)
inline

Wrapper for setting a binding with no target.

The binding has no target. You can use the binding to execute binding processors.

Parameters
bindingBinding to set.
ownerOwner shared pointer for the binding.
Returns
Binding runtime created for the binding.

◆ setBinding() [8/9]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBinding ( AbstractBindingSharedPtr  binding,
shared_ptr< TDerivedClass >  templateRoot 
)
inline

Sets a binding with no target.

The binding has no target. You can use the binding to execute binding processors.

Parameters
bindingBinding to set.
templateRootOverriding template root for the binding.
Returns
Binding runtime created for the binding.

◆ setBinding() [9/9]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setBinding ( AbstractBindingSharedPtr  binding)
inline

Wrapper for setting a binding with no target.

The binding has no target. You can use the binding to execute binding processors.

Parameters
bindingBinding to set.
Returns
Binding runtime created for the binding.

◆ setModifierBindingWithOwner() [1/3]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setModifierBindingWithOwner ( AbstractBindingSharedPtr  binding,
shared_ptr< void >  owner,
shared_ptr< TDerivedClass >  templateRoot,
AbstractPropertyType  propertyType,
PropertyField  field 
)
inline

Sets a modifier binding.

As opposed to value source created by setBinding(), creates a property modifier binding.

Parameters
bindingBinding to set.
ownerOwner shared pointer for the binding.
templateRootOverriding template root for the binding.
propertyTypeTarget property type.
fieldProperty field.
Returns
Binding runtime created for the binding.

◆ setModifierBindingWithOwner() [2/3]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setModifierBindingWithOwner ( AbstractBindingSharedPtr  binding,
shared_ptr< void >  owner,
AbstractPropertyType  propertyType,
PropertyField  field 
)
inline

Wrapper for setting a modifier binding.

As opposed to value source created by setBinding(), creates a property modifier binding.

Parameters
bindingBinding to set.
ownerOwner shared pointer for the binding.
propertyTypeTarget property type.
fieldProperty field.
Returns
Binding runtime created for the binding.

◆ setModifierBindingWithOwner() [3/3]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setModifierBindingWithOwner ( AbstractBindingSharedPtr  binding,
shared_ptr< void >  owner,
AbstractPropertyType  propertyType 
)
inline

Wrapper for setting a modifier binding.

As opposed to value source created by setBinding(), creates a property modifier binding.

Parameters
bindingBinding to set.
ownerOwner shared pointer for the binding.
propertyTypeTarget property type.
Returns
Binding runtime created for the binding.

◆ setModifierBinding() [1/3]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setModifierBinding ( AbstractBindingSharedPtr  binding,
shared_ptr< TDerivedClass >  templateRoot,
AbstractPropertyType  propertyType,
PropertyField  field 
)
inline

Wrapper for setting a modifier binding.

As opposed to value source created by setBinding(), creates a property modifier binding.

Parameters
bindingBinding to set.
templateRootOverriding template root for the binding.
propertyTypeTarget property type.
fieldProperty field.
Returns
Binding runtime created for the binding.

◆ setModifierBinding() [2/3]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setModifierBinding ( AbstractBindingSharedPtr  binding,
AbstractPropertyType  propertyType,
PropertyField  field 
)
inline

Wrapper for setting a modifier binding.

As opposed to value source created by setBinding(), creates a property modifier binding.

Parameters
bindingBinding to set.
propertyTypeTarget property type.
fieldProperty field.
Returns
Binding runtime created for the binding.

◆ setModifierBinding() [3/3]

template<typename TDerivedClass>
AbstractBindingRuntimeSharedPtr kanzi::BindingHostConceptImpl< TDerivedClass >::setModifierBinding ( AbstractBindingSharedPtr  binding,
AbstractPropertyType  propertyType 
)
inline

Wrapper for setting a modifier binding.

As opposed to value source created by setBinding(), creates a property modifier binding. Whole property is used.

Parameters
bindingBinding to set.
propertyTypeTarget property type.
Returns
Binding runtime created for the binding.

◆ addBindingRuntime()

template<typename TDerivedClass>
void kanzi::BindingHostConceptImpl< TDerivedClass >::addBindingRuntime ( AbstractBindingRuntimeSharedPtr  entry,
shared_ptr< void >  owner 
)
inline

Adds an already-created binding runtime to this binding host.

This is an internal function that is only exposed in the public interface for use in tests. Do not call this function. Use setBinding() or setModifierBinding() instead.

Parameters
entryBinding runtime to add.
ownerOwner shared pointer for the binding.

◆ getThisObject() [1/2]

template<typename TDerivedClass>
TDerivedClass* kanzi::BindingHostConceptImpl< TDerivedClass >::getThisObject ( )
inlineprotected

Internal accessor for the Curiously Recurring Template Pattern.

Returns
Derived instance of this.

◆ getThisObject() [2/2]

template<typename TDerivedClass>
const TDerivedClass* kanzi::BindingHostConceptImpl< TDerivedClass >::getThisObject ( ) const
inlineprotected

Internal accessor for the Curiously Recurring Template Pattern.

Returns
Const derived instance of this.

◆ createModifierBindingTarget()

template<typename TDerivedClass>
BindingTargetRuntimePtr kanzi::BindingHostConceptImpl< TDerivedClass >::createModifierBindingTarget ( shared_ptr< TDerivedClass >  templateRoot,
AbstractPropertyType  propertyType,
PropertyField  field 
)
inlineprotected

Creates a property modifier binding target for given combination of property type and field.

Parameters
templateRootOverriding template root for the binding.
propertyTypeTarget property type.
fieldProperty field.
Returns
Binding target runtime to be used with an abstract binding runtime.

◆ createValueSourceBindingTarget()

template<typename TDerivedClass>
BindingTargetRuntimePtr kanzi::BindingHostConceptImpl< TDerivedClass >::createValueSourceBindingTarget ( shared_ptr< TDerivedClass >  templateRoot,
AbstractPropertyType  propertyType,
PropertyField  field,
PropertyValuePrecedence  precedence,
bool  reuseAllowed 
)
inlineprotected

Creates a value source binding target for given combination of property type and field.

Parameters
templateRootOverriding template root for the binding.
propertyTypeTarget property type.
fieldProperty field.
precedenceProperty value precedence for value source binding target.
reuseAllowedWhether reuse of the installed value source is allowed by other functionality, such as setProperty.
Returns
Binding target runtime to be used with an abstract binding runtime.

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