Kanzi  3.9.4
Kanzi Engine API
kanzi::ExpressionBindingSourceRuntime Class Reference

Runtime for expression binding source. More...

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

Inheritance diagram for kanzi::ExpressionBindingSourceRuntime:
[legend]

Public Types

using ExpressionValueSourceRuntimeContainer = vector< AbstractExpressionValueSourceRuntimePtr >
 Container for expression value sources. More...
 
- Public Types inherited from kanzi::BindingSourceRuntime
using BindingProcessorRuntimeConstIterator = BindingProcessorRuntimeContainer::const_iterator
 Binding processor runtime constant iterator type. More...
 
using BindingProcessorRuntimeContainer = vector< BindingProcessorRuntimePtr >
 Binding processor runtime container type. More...
 

Public Member Functions

const BindingProcessorRuntimeConstIterator beginOperationProcessors ()
 Gets an iterator to the beginning of operation binding processors vector. More...
 
const BindingProcessorRuntimeConstIterator endOperationProcessors ()
 Gets an iterator to the end of operation binding processors vector. More...
 
AbstractExpressionValueSourceRuntimegetDataSourceValueSourceRuntime (size_t idx)
 Gets data source value source runtime by index. More...
 
const AbstractExpressionValueSourceRuntimegetDataSourceValueSourceRuntime (size_t idx) const
 Gets data source value source runtime by index. More...
 
AbstractExpressionValueSourceRuntimegetExpressionValueSourceRuntime (size_t idx)
 Gets expression value source runtime by index. More...
 
const AbstractExpressionValueSourceRuntimegetExpressionValueSourceRuntime (size_t idx) const
 Gets expression value source runtime by index. More...
 
VariantgetTemporaryRegister (size_t idx)
 Accesses temporary register. More...
 
const VariantgetTemporaryRegister (size_t idx) const
 Accesses temporary register. More...
 
VariantresolveRegister (BindingExpressionArgumentType argumentType)
 Resolves a register based on argument type. More...
 
template<typename T >
void setCurrentValue (T &value)
 Templated function for setting the current value. More...
 
void sourceConnected ()
 Called by expression value sources when a source connects. More...
 
void sourceDisconnected ()
 Called by expression value sources when a source disconnects. More...
 
void sourceValueChanged ()
 Called by expression value sources when a source value changes. More...
 
- Public Member Functions inherited from kanzi::BindingSourceRuntime
void attachForRead ()
 Attaches the binding source runtime for reading. More...
 
void attachForWrite ()
 Attaches the binding source runtime for writing. More...
 
BindingProcessorRuntimeConstIterator beginProcessorRuntimes () const
 Gets an iterator to the beginning of binding processors. More...
 
void createBindingProcessorRuntimes (const AbstractBinding &binding)
 Creates a processor runtime for each BindingProcessor held by the binding parameter. More...
 
void detach ()
 Detaches the binding source runtime. More...
 
BindingProcessorRuntimeConstIterator endProcessorRuntimes () const
 Gets an iterator to the end of binding processors. More...
 
AbstractBindingRuntimegetBindingRuntime () const
 Returns the source lookup context. More...
 
BindingLookupContextgetLookupContext () const
 Returns the 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 ()=default
 Destructor. More...
 

Static Public Member Functions

static BindingSourceRuntimePtr create (ExpressionBindingSource &bindingSource, BindingLookupContextPtr lookupContext)
 Creates an expression binding source runtime. More...
 

Protected Member Functions

void attachForReadOverride () override
 BindingSourceRuntime::attachForReadOverride() implementation. More...
 
void attachForWriteOverride () override
 BindingSourceRuntime::attachForWriteOverride() implementation. More...
 
void detachOverride () override
 BindingSourceRuntime::detachOverride() implementation. More...
 
bool executeOpCodeDefault (const BindingExpressionOpCode &opCode)
 Perform typical operation. More...
 
bool executeOpCodeGetCurrentValue (const BindingExpressionOpCode &opCode)
 Perform getCurrentValue() operation. More...
 
bool executeProcessorOperation (const BindingExpressionOpCode &opCode)
 Performs a binding processor operation. More...
 
 ExpressionBindingSourceRuntime (ExpressionBindingSource &bindingSource, BindingLookupContextPtr lookupContext)
 Constructor. More...
 
bool isConnectedOverride () override
 BindingSourceRuntime::isConnectedOverride() implementation. More...
 
bool readOverride (Variant &value) override
 BindingSourceRuntime::readOverride() implementation. More...
 
- Protected Member Functions inherited from kanzi::BindingSourceRuntime
 BindingSourceRuntime (BindingLookupContextPtr lookupContext)
 Constructor. More...
 
virtual bool writeOverride (const Variant &value)
 Implementation-dependent write. More...
 

Protected Attributes

size_t m_connectedSourceCount
 Number of connected sources. More...
 
Variant m_currentValueVariant
 Generated variant. More...
 
BindingSourceRuntime::BindingProcessorRuntimeContainer m_operationProcessorRuntimes
 Binding sources copied from expression binding source. More...
 
ExpressionBindingSourcem_source
 Host expression binding source. More...
 
ExpressionValueSourceRuntimeContainer m_sources [2]
 Sources for data sources and other value sources. More...
 
bool m_sourceValueChangeListenerRequested
 Indicates whether source value changes trigger the binding. More...
 
- Protected Attributes inherited from kanzi::BindingSourceRuntime
AbstractBindingRuntimem_bindingRuntime
 Abstract binding runtime for this source. More...
 
BindingLookupContextPtr m_lookupContext
 Binding lookup context for wherever this binding source runtime is attached to. More...
 
BindingProcessorRuntimeContainer m_processorRuntimes
 Binding processors (for the source, forward direction). More...
 

Detailed Description

Runtime for expression binding source.

Since
Kanzi 3.7.0

Member Typedef Documentation

◆ ExpressionValueSourceRuntimeContainer

Constructor & Destructor Documentation

◆ ExpressionBindingSourceRuntime()

kanzi::ExpressionBindingSourceRuntime::ExpressionBindingSourceRuntime ( ExpressionBindingSource bindingSource,
BindingLookupContextPtr  lookupContext 
)
explicitprotected

Constructor.

Parameters
bindingSourceHost expression binding source.
lookupContextBinding lookup context for this source.

Member Function Documentation

◆ create()

static BindingSourceRuntimePtr kanzi::ExpressionBindingSourceRuntime::create ( ExpressionBindingSource bindingSource,
BindingLookupContextPtr  lookupContext 
)
static

Creates an expression binding source runtime.

Parameters
bindingSourceParent binding source.
lookupContextLookup context for this binding source.
Returns
The created expression binding source runtime.

◆ sourceConnected()

void kanzi::ExpressionBindingSourceRuntime::sourceConnected ( )

Called by expression value sources when a source connects.

◆ sourceDisconnected()

void kanzi::ExpressionBindingSourceRuntime::sourceDisconnected ( )

Called by expression value sources when a source disconnects.

◆ sourceValueChanged()

void kanzi::ExpressionBindingSourceRuntime::sourceValueChanged ( )

Called by expression value sources when a source value changes.

◆ resolveRegister()

Variant* kanzi::ExpressionBindingSourceRuntime::resolveRegister ( BindingExpressionArgumentType  argumentType)

Resolves a register based on argument type.

Parameters
argumentTypeRegister identifier.
Returns
Reference to the register.

◆ setCurrentValue()

template<typename T >
void kanzi::ExpressionBindingSourceRuntime::setCurrentValue ( T value)
inline

Templated function for setting the current value.

Stores the pointer and conversion function to generate the variant for given type. If current value is not used, the variant is never created.

Parameters
valueValue that should be set to the register.

◆ getExpressionValueSourceRuntime() [1/2]

AbstractExpressionValueSourceRuntime* kanzi::ExpressionBindingSourceRuntime::getExpressionValueSourceRuntime ( size_t  idx)
inline

Gets expression value source runtime by index.

Parameters
idxIndex.
Returns
Pointer to expression value source runtime.

◆ getExpressionValueSourceRuntime() [2/2]

const AbstractExpressionValueSourceRuntime* kanzi::ExpressionBindingSourceRuntime::getExpressionValueSourceRuntime ( size_t  idx) const
inline

Gets expression value source runtime by index.

Parameters
idxIndex.
Returns
Pointer to expression value source runtime.

◆ getDataSourceValueSourceRuntime() [1/2]

AbstractExpressionValueSourceRuntime* kanzi::ExpressionBindingSourceRuntime::getDataSourceValueSourceRuntime ( size_t  idx)
inline

Gets data source value source runtime by index.

Parameters
idxIndex.
Returns
Pointer to data source value source runtime.

◆ getDataSourceValueSourceRuntime() [2/2]

const AbstractExpressionValueSourceRuntime* kanzi::ExpressionBindingSourceRuntime::getDataSourceValueSourceRuntime ( size_t  idx) const
inline

Gets data source value source runtime by index.

Parameters
idxIndex.
Returns
Pointer to data source value source runtime.

◆ getTemporaryRegister() [1/2]

Variant* kanzi::ExpressionBindingSourceRuntime::getTemporaryRegister ( size_t  idx)
inline

Accesses temporary register.

Parameters
idxIndex.
Returns
Reference to the temporary register.

◆ getTemporaryRegister() [2/2]

const Variant* kanzi::ExpressionBindingSourceRuntime::getTemporaryRegister ( size_t  idx) const
inline

Accesses temporary register.

Parameters
idxIndex.
Returns
Reference to the temporary register.

◆ beginOperationProcessors()

const BindingProcessorRuntimeConstIterator kanzi::ExpressionBindingSourceRuntime::beginOperationProcessors ( )
inline

Gets an iterator to the beginning of operation binding processors vector.

Returns
iterator to the beginning of operation binding processors vector.

◆ endOperationProcessors()

const BindingProcessorRuntimeConstIterator kanzi::ExpressionBindingSourceRuntime::endOperationProcessors ( )
inline

Gets an iterator to the end of operation binding processors vector.

Returns
iterator to the end of operation binding processors vector.

◆ attachForReadOverride()

void kanzi::ExpressionBindingSourceRuntime::attachForReadOverride ( )
overrideprotectedvirtual

◆ attachForWriteOverride()

void kanzi::ExpressionBindingSourceRuntime::attachForWriteOverride ( )
overrideprotectedvirtual

◆ detachOverride()

void kanzi::ExpressionBindingSourceRuntime::detachOverride ( )
overrideprotectedvirtual

◆ readOverride()

bool kanzi::ExpressionBindingSourceRuntime::readOverride ( Variant value)
overrideprotectedvirtual

◆ isConnectedOverride()

bool kanzi::ExpressionBindingSourceRuntime::isConnectedOverride ( )
overrideprotectedvirtual

◆ executeProcessorOperation()

bool kanzi::ExpressionBindingSourceRuntime::executeProcessorOperation ( const BindingExpressionOpCode opCode)
protected

Performs a binding processor operation.

Parameters
opCodeOperation code.
Returns
If the operation executes without errors, true, otherwise false.

◆ executeOpCodeDefault()

bool kanzi::ExpressionBindingSourceRuntime::executeOpCodeDefault ( const BindingExpressionOpCode opCode)
protected

Perform typical operation.

Parameters
opCodeOperation code.
Returns
True if the operation executed without errors, otherwise false.

◆ executeOpCodeGetCurrentValue()

bool kanzi::ExpressionBindingSourceRuntime::executeOpCodeGetCurrentValue ( const BindingExpressionOpCode opCode)
protected

Perform getCurrentValue() operation.

Parameters
opCodeOperation code.
Returns
True if the operation executed without errors, otherwise false.

Member Data Documentation

◆ m_sources

ExpressionValueSourceRuntimeContainer kanzi::ExpressionBindingSourceRuntime::m_sources[2]
protected

Sources for data sources and other value sources.

Value sources are index 0, data sources are index 1.

◆ m_connectedSourceCount

size_t kanzi::ExpressionBindingSourceRuntime::m_connectedSourceCount
protected

Number of connected sources.

◆ m_sourceValueChangeListenerRequested

bool kanzi::ExpressionBindingSourceRuntime::m_sourceValueChangeListenerRequested
protected

Indicates whether source value changes trigger the binding.

◆ m_operationProcessorRuntimes

BindingSourceRuntime::BindingProcessorRuntimeContainer kanzi::ExpressionBindingSourceRuntime::m_operationProcessorRuntimes
protected

Binding sources copied from expression binding source.

◆ m_currentValueVariant

Variant kanzi::ExpressionBindingSourceRuntime::m_currentValueVariant
protected

Generated variant.

Cleared at the end of execution.

◆ m_source

ExpressionBindingSource& kanzi::ExpressionBindingSourceRuntime::m_source
protected

Host expression binding source.


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