Kanzi Framework  3.9.0
Kanzi Engine API
kanzi::ValueSourceBindingTargetRuntime Class Reference

Base class for value source binding target runtimes. More...

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

Inheritance diagram for kanzi::ValueSourceBindingTargetRuntime:
[legend]

Public Member Functions

void clearValueSourceOwner ()
 Clears the value source owner. More...
 
PropertyValuePrecedence getPrecedence () const
 Gets value source precedence. More...
 
PropertyField getPropertyField () const
 Gets a property field. More...
 
AbstractPropertyType getPropertyType () const
 Gets a property type. More...
 
bool hasValueSourceOwner () const
 Indicates whether this target runtime still has a value source owner. More...
 
- Public Member Functions inherited from kanzi::BindingTargetRuntime
void attachForRead ()
 Attaches the binding target runtime for reading. More...
 
void attachForWrite ()
 Attaches the binding target runtime for writing. More...
 
BindingProcessorConstIterator beginProcessors () const
 Gets an iterator to the beginning of binding processors. More...
 
void copyBindingProcessors (const AbstractBinding &binding)
 Copies backward direction processors from a binding. More...
 
void detach ()
 Detaches binding target runtime. More...
 
BindingProcessorConstIterator endProcessors () const
 Gets an iterator to the end of binding processors. More...
 
AbstractBindingRuntimegetBindingRuntime () const
 Gets the binding runtime. More...
 
BindingLookupContextgetLookupContext () const
 Accesses target lookup context. More...
 
bool isConnected ()
 Indicates whether this source is connected. More...
 
bool read (Variant &value)
 Reads a value from the binding target. More...
 
void setBindingRuntime (AbstractBindingRuntime &bindingRuntime)
 Sets the binding runtime. More...
 
bool write (const Variant &value)
 Writes a value to the binding target. More...
 
virtual ~BindingTargetRuntime ()
 Destructor. More...
 

Static Public Member Functions

static BindingTargetRuntimePtr create (BindingLookupContextPtr lookupContext, AbstractPropertyType propertyType, PropertyField field, PropertyValuePrecedence precedence, bool reuseAllowed)
 Creates a value source binding target runtime without an actual binding target. More...
 

Protected Member Functions

 ValueSourceBindingTargetRuntime (BindingLookupContextPtr lookupContext, AbstractPropertyType propertyType, PropertyField field, PropertyValuePrecedence precedence)
 Constructor. More...
 
- Protected Member Functions inherited from kanzi::BindingTargetRuntime
virtual void attachForReadOverride ()
 Implementation-dependent attach. More...
 
virtual void attachForWriteOverride ()=0
 Implementation-dependent attach. More...
 
 BindingTargetRuntime (BindingLookupContextPtr lookupContext)
 Constructor. More...
 
virtual void detachOverride ()=0
 Implementation-dependent detach. More...
 
virtual bool isConnectedOverride ()=0
 Implementation-dependent connected check. More...
 
virtual bool readOverride (Variant &value)
 Implementation-dependent read. More...
 
virtual bool writeOverride (const Variant &value)=0
 Implementation-dependent write. More...
 

Protected Attributes

PropertyField m_field
 Property field to use. More...
 
bool m_localReadListenerRequested
 Indicates whether the local read listener is requested. More...
 
PropertyObjectm_object
 Object the value source is installed to. More...
 
PropertyValuePrecedence m_precedence
 Precedence to use. More...
 
AbstractPropertyType m_propertyType
 Property type to use. More...
 
AbstractPropertyTypeDescriptor::ValueSourceOwnerm_valueSourceOwner
 Owner for the binding value source this runtime installs. More...
 
- Protected Attributes inherited from kanzi::BindingTargetRuntime
AbstractBindingRuntimem_bindingRuntime
 Abstract binding runtime for this target. More...
 
BindingLookupContextPtr m_lookupContext
 Binding lookup context for wherever this binding target runtime is attached to. More...
 
BindingProcessorContainer m_processors
 Binding processors (for the target, backward direction). More...
 

Additional Inherited Members

- Public Types inherited from kanzi::BindingTargetRuntime
typedef BindingProcessorContainer::const_iterator BindingProcessorConstIterator
 Binding processor iterator type. More...
 
typedef vector< BindingProcessorSharedPtrBindingProcessorContainer
 Binding processor container type. More...
 

Detailed Description

Base class for value source binding target runtimes.

Inherited by type-specialized version.

Kanzi creates a value source binding target runtime when you add a binding to a Node or RenderPass using the setBinding() function.

To create a ValueSourceBindingTargetRuntime for a binding runtime when adding the binding to a Node or RenderPass:

// Calling setBinding() will install the binding runtime as a property value source.
AbstractBindingRuntimeSharedPtr runtime = node->setBinding(binding, Node2D::OpacityProperty);

ValueSourceBindingTargetRuntime creates a property value source, that owns the binding runtime that was created. If the property value source in Node or RenderPass is removed, the binding runtime is removed as well. As bindings are usually set with local precedence, setting a local value with setProperty() removes the binding.

Since
Kanzi 3.7.0

Constructor & Destructor Documentation

◆ ValueSourceBindingTargetRuntime()

kanzi::ValueSourceBindingTargetRuntime::ValueSourceBindingTargetRuntime ( BindingLookupContextPtr  lookupContext,
AbstractPropertyType  propertyType,
PropertyField  field,
PropertyValuePrecedence  precedence 
)
protected

Constructor.

Parameters
lookupContextBinding lookup context to use.
propertyTypeProperty type to use.
fieldProperty field to use.
precedenceProperty value precedence.

Member Function Documentation

◆ create()

static BindingTargetRuntimePtr kanzi::ValueSourceBindingTargetRuntime::create ( BindingLookupContextPtr  lookupContext,
AbstractPropertyType  propertyType,
PropertyField  field,
PropertyValuePrecedence  precedence,
bool  reuseAllowed 
)
static

Creates a value source binding target runtime without an actual binding target.

Parameters
lookupContextBinding lookup context to use.
propertyTypeProperty type to use.
fieldProperty field to use.
precedenceProperty value precedence.
reuseAllowedWhether reuse of the installed value source is allowed by other functionality, such as setProperty.
Returns
The value source binding target runtime.

◆ getPropertyType()

AbstractPropertyType kanzi::ValueSourceBindingTargetRuntime::getPropertyType ( ) const
inline

Gets a property type.

Required by the inheriting classes.

Returns
Property type for this target.

◆ getPropertyField()

PropertyField kanzi::ValueSourceBindingTargetRuntime::getPropertyField ( ) const
inline

Gets a property field.

Returns
Property field.

◆ getPrecedence()

PropertyValuePrecedence kanzi::ValueSourceBindingTargetRuntime::getPrecedence ( ) const
inline

Gets value source precedence.

Required by the inheriting classes.

Returns
Precedence for this target.

◆ hasValueSourceOwner()

bool kanzi::ValueSourceBindingTargetRuntime::hasValueSourceOwner ( ) const
inline

Indicates whether this target runtime still has a value source owner.

Returns
If the value source owner exists, true, otherwise false.

◆ clearValueSourceOwner()

void kanzi::ValueSourceBindingTargetRuntime::clearValueSourceOwner ( )
inline

Clears the value source owner.

To be called by the owner upon destruction to prevent recursive destruction.

Member Data Documentation

◆ m_object

PropertyObject& kanzi::ValueSourceBindingTargetRuntime::m_object
protected

Object the value source is installed to.

◆ m_propertyType

AbstractPropertyType kanzi::ValueSourceBindingTargetRuntime::m_propertyType
protected

Property type to use.

◆ m_field

PropertyField kanzi::ValueSourceBindingTargetRuntime::m_field
protected

Property field to use.

◆ m_precedence

PropertyValuePrecedence kanzi::ValueSourceBindingTargetRuntime::m_precedence
protected

Precedence to use.

◆ m_localReadListenerRequested

bool kanzi::ValueSourceBindingTargetRuntime::m_localReadListenerRequested
protected

Indicates whether the local read listener is requested.

◆ m_valueSourceOwner

AbstractPropertyTypeDescriptor::ValueSourceOwner* kanzi::ValueSourceBindingTargetRuntime::m_valueSourceOwner
protected

Owner for the binding value source this runtime installs.

Not created before the binding has been executed once.


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