Kanzi Framework  3.9.0
Kanzi Engine API
kanzi::BindingTargetRuntime Class Referenceabstract

Binding target runtime interface. More...

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

Inheritance diagram for kanzi::BindingTargetRuntime:
[legend]

Public Types

typedef BindingProcessorContainer::const_iterator BindingProcessorConstIterator
 Binding processor iterator type. More...
 
typedef vector< BindingProcessorSharedPtrBindingProcessorContainer
 Binding processor container type. More...
 

Public Member Functions

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...
 

Protected Member Functions

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

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...
 

Detailed Description

Binding target runtime interface.

Inherited by specialized binding target runtimes.

See also
AbstractBinding
Since
Kanzi 3.7.0

Member Typedef Documentation

◆ BindingProcessorContainer

◆ BindingProcessorConstIterator

typedef BindingProcessorContainer::const_iterator kanzi::BindingTargetRuntime::BindingProcessorConstIterator

Binding processor iterator type.

Constructor & Destructor Documentation

◆ ~BindingTargetRuntime()

virtual kanzi::BindingTargetRuntime::~BindingTargetRuntime ( )
inlinevirtual

Destructor.

◆ BindingTargetRuntime()

kanzi::BindingTargetRuntime::BindingTargetRuntime ( BindingLookupContextPtr  lookupContext)
inlineexplicitprotected

Constructor.

Parameters
lookupContextLookup context for this binding target runtime.

Member Function Documentation

◆ attachForRead()

void kanzi::BindingTargetRuntime::attachForRead ( )

Attaches the binding target runtime for reading.

After attaching the binding target runtime for reading, the binding target triggers calls to AbstractBindingRuntime::notifyTargetChanged(). Calling this function on binding targets is optional. The binding runtime calls this function if target write notifications are necessary. This is true mostly for two-way bindings. You must call attachForWrite() before calling this function.

◆ attachForWrite()

void kanzi::BindingTargetRuntime::attachForWrite ( )

Attaches the binding target runtime for writing.

After this function is called and the target is connected, you can call the write() function to write values to target. You must call this function before calling attachForRead().

◆ detach()

void kanzi::BindingTargetRuntime::detach ( )

Detaches binding target runtime.

◆ read()

bool kanzi::BindingTargetRuntime::read ( Variant value)

Reads a value from the binding target.

Parameters
valueOutput value for the read.
Returns
Read success status.

◆ write()

bool kanzi::BindingTargetRuntime::write ( const Variant value)

Writes a value to the binding target.

Internal function called by Kanzi to write the output value to the binding target. If multiple values are written, Kanzi calls spill() instead.

Parameters
valueValue to write.
Returns
Write success status.

◆ isConnected()

bool kanzi::BindingTargetRuntime::isConnected ( )

Indicates whether this source is connected.

Returns
If the source is connected, true, otherwise false.

◆ copyBindingProcessors()

void kanzi::BindingTargetRuntime::copyBindingProcessors ( const AbstractBinding binding)

Copies backward direction processors from a binding.

The processors are cloned inside the source runtime.

Parameters
bindingBinding to copy processors from.

◆ beginProcessors()

BindingProcessorConstIterator kanzi::BindingTargetRuntime::beginProcessors ( ) const
inline

Gets an iterator to the beginning of binding processors.

Returns
Iterator to beginning of processor array.

◆ endProcessors()

BindingProcessorConstIterator kanzi::BindingTargetRuntime::endProcessors ( ) const
inline

Gets an iterator to the end of binding processors.

Returns
Iterator to end of processor array.

◆ getLookupContext()

BindingLookupContext& kanzi::BindingTargetRuntime::getLookupContext ( ) const
inline

Accesses target lookup context.

◆ getBindingRuntime()

AbstractBindingRuntime* kanzi::BindingTargetRuntime::getBindingRuntime ( ) const
inline

Gets the binding runtime.

Returns
Pointer to owning binding runtime.

◆ setBindingRuntime()

void kanzi::BindingTargetRuntime::setBindingRuntime ( AbstractBindingRuntime bindingRuntime)
inline

Sets the binding runtime.

Called during construction, after target runtime has been set to binding runtime.

Parameters
bindingRuntimeBinding runtime to set.

◆ attachForReadOverride()

virtual void kanzi::BindingTargetRuntime::attachForReadOverride ( )
protectedvirtual

◆ attachForWriteOverride()

◆ detachOverride()

◆ readOverride()

virtual bool kanzi::BindingTargetRuntime::readOverride ( Variant value)
protectedvirtual

Implementation-dependent read.

Default implementation throws an error.

Parameters
valueValue to read.
Returns
If the reading succeeds, true, otherwise false.

Reimplemented in kanzi::TypedValueSourceBindingTargetRuntime< T >, kanzi::TypedPropertyModifierBindingTargetRuntime< T >, kanzi::VariableBindingTargetRuntime, kanzi::TypedManualBindingTargetRuntime< T >, and kanzi::TypedMessageBindingTargetRuntime< T >.

◆ writeOverride()

virtual bool kanzi::BindingTargetRuntime::writeOverride ( const Variant value)
protectedpure virtual

◆ isConnectedOverride()

virtual bool kanzi::BindingTargetRuntime::isConnectedOverride ( )
protectedpure virtual

Member Data Documentation

◆ m_processors

BindingProcessorContainer kanzi::BindingTargetRuntime::m_processors
protected

Binding processors (for the target, backward direction).

◆ m_bindingRuntime

AbstractBindingRuntime* kanzi::BindingTargetRuntime::m_bindingRuntime
protected

Abstract binding runtime for this target.

◆ m_lookupContext

BindingLookupContextPtr kanzi::BindingTargetRuntime::m_lookupContext
protected

Binding lookup context for wherever this binding target runtime is attached to.


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