Binding source runtime interface. More...
#include <kanzi/core.ui/binding/binding_source_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 source runtime for reading. More... | |
void | attachForWrite () |
Attaches the binding source runtime for writing. More... | |
BindingProcessorConstIterator | beginProcessors () const |
Gets an iterator to the beginning of binding processors. More... | |
void | copyBindingProcessors (const AbstractBinding &binding) |
Copies forward direction processors from a binding. More... | |
void | detach () |
Detaches the binding source runtime. More... | |
BindingProcessorConstIterator | endProcessors () const |
Gets an iterator to the end of binding processors. More... | |
BindingLookupContext & | getLookupContext () const |
Accesses source lookup context. More... | |
bool | isConnected () |
Indicates whether this source is connected. More... | |
bool | read (Variant &value) |
Reads a value from binding source. More... | |
void | setBindingRuntime (AbstractBindingRuntime &bindingRuntime) |
Sets the binding runtime. More... | |
bool | write (const Variant &value) |
Writes a value to binding source. More... | |
virtual | ~BindingSourceRuntime () |
Destructor. More... | |
Protected Member Functions | |
virtual void | attachForReadOverride ()=0 |
Implementation-dependent attach for read. More... | |
virtual void | attachForWriteOverride ()=0 |
Implementation-dependent attach for write. More... | |
BindingSourceRuntime (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)=0 |
Implementation-dependent read. More... | |
virtual bool | writeOverride (const Variant &value) |
Implementation-dependent write. More... | |
Protected Attributes | |
AbstractBindingRuntime * | m_bindingRuntime |
Abstract binding runtime for this source. More... | |
BindingLookupContextPtr | m_lookupContext |
Binding lookup context for wherever this binding source runtime is attached to. More... | |
BindingProcessorContainer | m_processors |
Binding processors (for the source, forward direction). More... | |
Binding source runtime interface.
Inherited by specialized binding source runtimes.
Binding processor container type.
typedef BindingProcessorContainer::const_iterator kanzi::BindingSourceRuntime::BindingProcessorConstIterator |
Binding processor iterator type.
|
inlinevirtual |
Destructor.
|
inlineexplicitprotected |
Constructor.
lookupContext | Lookup context for this binding source runtime. |
void kanzi::BindingSourceRuntime::attachForRead | ( | ) |
Attaches the binding source runtime for reading.
After attaching the binding source runtime for reading, the binding source triggers calls to AbstractBindingRuntime::notifySourceChanged(). Calling this function on binding sources is optional. Most bindings need source write notifications, and the binding runtime calls this function. You must call attachForWrite() before calling this function.
void kanzi::BindingSourceRuntime::attachForWrite | ( | ) |
Attaches the binding source runtime for writing.
After this function is called and the target is connected, you can call the write() function to write the values to the source. You must call this function before calling attachForRead().
void kanzi::BindingSourceRuntime::detach | ( | ) |
Detaches the binding source runtime.
bool kanzi::BindingSourceRuntime::read | ( | Variant & | value | ) |
Reads a value from binding source.
value | Output parameter for value read. |
bool kanzi::BindingSourceRuntime::write | ( | const Variant & | value | ) |
Writes a value to binding source.
value | Value to write. |
bool kanzi::BindingSourceRuntime::isConnected | ( | ) |
Indicates whether this source is connected.
void kanzi::BindingSourceRuntime::copyBindingProcessors | ( | const AbstractBinding & | binding | ) |
Copies forward direction processors from a binding.
The processors are cloned inside the source runtime.
binding | The binding from which to copy the processors. |
|
inline |
Gets an iterator to the beginning of binding processors.
|
inline |
Gets an iterator to the end of binding processors.
|
inline |
Accesses source lookup context.
|
inline |
Sets the binding runtime.
This function is called during construction, after setting the source runtime to the binding runtime.
bindingRuntime | Binding runtime to set. |
|
protectedpure virtual |
Implementation-dependent attach for read.
Implemented in kanzi::ExpressionBindingSourceRuntime, kanzi::TypedObjectPropertyBindingSourceRuntime< T >, kanzi::TypedVariableBindingSourceRuntime< T >, kanzi::ResourceBindingSourceRuntime, kanzi::TypedRenderPropertyBindingSourceRuntime< T >, kanzi::DataSourceBindingSourceRuntime, kanzi::ManualBindingSourceRuntime, kanzi::MessageBindingSourceRuntime, and kanzi::ValueBindingSourceRuntime.
|
protectedpure virtual |
Implementation-dependent attach for write.
Implemented in kanzi::ExpressionBindingSourceRuntime, kanzi::TypedObjectPropertyBindingSourceRuntime< T >, kanzi::ResourceBindingSourceRuntime, kanzi::DataSourceBindingSourceRuntime, kanzi::ManualBindingSourceRuntime, kanzi::MessageBindingSourceRuntime, kanzi::RenderPropertyBindingSourceRuntime, kanzi::VariableBindingSourceRuntime, and kanzi::ValueBindingSourceRuntime.
|
protectedpure virtual |
Implementation-dependent detach.
Implemented in kanzi::ExpressionBindingSourceRuntime, kanzi::TypedObjectPropertyBindingSourceRuntime< T >, kanzi::TypedRenderPropertyBindingSourceRuntime< T >, kanzi::ResourceBindingSourceRuntime, kanzi::DataSourceBindingSourceRuntime, kanzi::ManualBindingSourceRuntime, kanzi::MessageBindingSourceRuntime, kanzi::VariableBindingSourceRuntime, and kanzi::ValueBindingSourceRuntime.
|
protectedpure virtual |
Implementation-dependent read.
Implemented in kanzi::ExpressionBindingSourceRuntime, kanzi::TypedObjectPropertyBindingSourceRuntime< T >, kanzi::TypedRenderPropertyBindingSourceRuntime< T >, kanzi::TypedVariableBindingSourceRuntime< T >, kanzi::ResourceBindingSourceRuntime, kanzi::DataSourceBindingSourceRuntime, kanzi::TypedManualBindingSourceRuntime< T >, kanzi::ValueBindingSourceRuntime, and kanzi::TypedMessageBindingSourceRuntime< T >.
|
protectedvirtual |
Implementation-dependent write.
Reimplemented in kanzi::TypedObjectPropertyBindingSourceRuntime< T >, kanzi::ResourceBindingSourceRuntime, kanzi::DataSourceBindingSourceRuntime, kanzi::TypedManualBindingSourceRuntime< T >, kanzi::TypedMessageBindingSourceRuntime< T >, and kanzi::ValueBindingSourceRuntime.
|
protectedpure virtual |
Implementation-dependent connected check.
Implemented in kanzi::ExpressionBindingSourceRuntime, kanzi::TypedObjectPropertyBindingSourceRuntime< T >, kanzi::TypedRenderPropertyBindingSourceRuntime< T >, kanzi::TypedVariableBindingSourceRuntime< T >, kanzi::ResourceBindingSourceRuntime, kanzi::DataSourceBindingSourceRuntime, kanzi::ManualBindingSourceRuntime, kanzi::MessageBindingSourceRuntime, and kanzi::ValueBindingSourceRuntime.
|
protected |
Binding processors (for the source, forward direction).
|
protected |
Abstract binding runtime for this source.
|
protected |
Binding lookup context for wherever this binding source runtime is attached to.