Binding target runtime interface. More...
#include <kanzi/core.ui/binding/binding_target_runtime.hpp>
Public Types | |
typedef BindingProcessorContainer::const_iterator | BindingProcessorConstIterator |
Binding processor iterator type. More... | |
typedef vector< BindingProcessorSharedPtr > | BindingProcessorContainer |
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... | |
AbstractBindingRuntime * | getBindingRuntime () const |
Gets the binding runtime. More... | |
BindingLookupContext & | getLookupContext () 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 | |
AbstractBindingRuntime * | m_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... | |
Binding target runtime interface.
Inherited by specialized binding target runtimes.
Binding processor container type.
typedef BindingProcessorContainer::const_iterator kanzi::BindingTargetRuntime::BindingProcessorConstIterator |
Binding processor iterator type.
|
inlinevirtual |
Destructor.
|
inlineexplicitprotected |
Constructor.
lookupContext | Lookup context for this binding target runtime. |
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.
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().
void kanzi::BindingTargetRuntime::detach | ( | ) |
Detaches binding target runtime.
bool kanzi::BindingTargetRuntime::read | ( | Variant & | value | ) |
Reads a value from the binding target.
value | Output value for the read. |
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.
value | Value to write. |
bool kanzi::BindingTargetRuntime::isConnected | ( | ) |
Indicates whether this source is connected.
void kanzi::BindingTargetRuntime::copyBindingProcessors | ( | const AbstractBinding & | binding | ) |
Copies backward direction processors from a binding.
The processors are cloned inside the source runtime.
binding | Binding to copy processors from. |
|
inline |
Gets an iterator to the beginning of binding processors.
|
inline |
Gets an iterator to the end of binding processors.
|
inline |
Accesses target lookup context.
|
inline |
Gets the binding runtime.
|
inline |
Sets the binding runtime.
Called during construction, after target runtime has been set to binding runtime.
bindingRuntime | Binding runtime to set. |
|
protectedvirtual |
Implementation-dependent attach.
Default implementation throws an error.
Reimplemented in kanzi::TypedValueSourceBindingTargetRuntime< T >, kanzi::VariableBindingTargetRuntime, kanzi::ManualBindingTargetRuntime, kanzi::TypedPropertyModifierBindingTargetRuntime< T >, kanzi::RenderValueBindingTargetRuntime, and kanzi::MessageBindingTargetRuntime.
|
protectedpure virtual |
Implementation-dependent attach.
Implemented in kanzi::TypedValueSourceBindingTargetRuntime< T >, kanzi::VariableBindingTargetRuntime, kanzi::ManualBindingTargetRuntime, kanzi::TypedPropertyModifierBindingTargetRuntime< T >, kanzi::RenderValueBindingTargetRuntime, kanzi::MessageBindingTargetRuntime, and kanzi::DummyBindingTargetRuntime.
|
protectedpure virtual |
Implementation-dependent detach.
Implemented in kanzi::TypedValueSourceBindingTargetRuntime< T >, kanzi::VariableBindingTargetRuntime, kanzi::TypedPropertyModifierBindingTargetRuntime< T >, kanzi::ManualBindingTargetRuntime, kanzi::RenderValueBindingTargetRuntime, kanzi::MessageBindingTargetRuntime, and kanzi::DummyBindingTargetRuntime.
|
protectedvirtual |
Implementation-dependent read.
Default implementation throws an error.
value | Value to read. |
Reimplemented in kanzi::TypedValueSourceBindingTargetRuntime< T >, kanzi::TypedPropertyModifierBindingTargetRuntime< T >, kanzi::VariableBindingTargetRuntime, kanzi::TypedManualBindingTargetRuntime< T >, and kanzi::TypedMessageBindingTargetRuntime< T >.
|
protectedpure virtual |
Implementation-dependent write.
value | Value to write. |
Implemented in kanzi::TypedRenderValueBindingTargetRuntime< T >, kanzi::TypedValueSourceBindingTargetRuntime< T >, kanzi::TypedPropertyModifierBindingTargetRuntime< T >, kanzi::TypedVariableBindingTargetRuntime< T >, kanzi::TypedManualBindingTargetRuntime< T >, kanzi::TypedMessageBindingTargetRuntime< T >, and kanzi::DummyBindingTargetRuntime.
|
protectedpure virtual |
Implementation-dependent connected check.
Implemented in kanzi::TypedValueSourceBindingTargetRuntime< T >, kanzi::VariableBindingTargetRuntime, kanzi::TypedPropertyModifierBindingTargetRuntime< T >, kanzi::ManualBindingTargetRuntime, kanzi::RenderValueBindingTargetRuntime, kanzi::MessageBindingTargetRuntime, and kanzi::DummyBindingTargetRuntime.
|
protected |
Binding processors (for the target, backward direction).
|
protected |
Abstract binding runtime for this target.
|
protected |
Binding lookup context for wherever this binding target runtime is attached to.