Kanzi  3.9.6
Kanzi Engine API
kanzi::BindingLookupContext Class Referenceabstract

Lookup context for bindings. More...

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

Inheritance diagram for kanzi::BindingLookupContext:
[legend]

Public Member Functions

virtual unique_ptr< BindingLookupContextclone ()
 Creates a clone of this binding lookup context. More...
 
virtual AbstractPropertyTypeDescriptor::ValueSourceOwnercreateValueSourceOwner (ValueSourceBindingTargetRuntime &targetRuntime, bool reuseAllowed)
 Creates an owner for the specific type of object with which this binding lookup context is associated. More...
 
virtual ObjectSharedPtr lookup (string_view path)=0
 Looks up object by path. More...
 
virtual void * lookupRaw (string_view path)
 Looks up object by path. More...
 
virtual void registerGlobalNotification (string_view path, BindingLookupNotificationBase &notificationObject)
 Registers for a notification regarding global change. More...
 
virtual void registerLocalNotification (PropertyObject *object, string_view path, BindingLookupNotificationBase &notificationObject)
 Registers for a notification regarding global change. More...
 
virtual void unregisterGlobalNotification (string_view path, BindingLookupNotificationBase &notificationObject)
 De-registers a notification regarding global change. More...
 
virtual void unregisterLocalNotification (PropertyObject *object, string_view path, BindingLookupNotificationBase &notificationObject)
 De-registers a notification regarding global change. More...
 
virtual ~BindingLookupContext ()=default
 Destructor. More...
 

Protected Member Functions

 BindingLookupContext ()=default
 Constructor. More...
 

Detailed Description

Lookup context for bindings.

Binding sources and targets use the lookup contexts to resolve objects based on paths. A lookup context specific to a Node or a RenderPass is created when the binding is set to that node or render pass.

Since
Kanzi 3.7.0

Constructor & Destructor Documentation

◆ ~BindingLookupContext()

virtual kanzi::BindingLookupContext::~BindingLookupContext ( )
virtualdefault

Destructor.

◆ BindingLookupContext()

kanzi::BindingLookupContext::BindingLookupContext ( )
explicitprotecteddefault

Constructor.

Member Function Documentation

◆ clone()

virtual unique_ptr<BindingLookupContext> kanzi::BindingLookupContext::clone ( )
virtual

Creates a clone of this binding lookup context.

Returns
New binding lookup context targeting the same context.

Reimplemented in kanzi::BindingRenderValueLookupContext, kanzi::BindingRenderPassLookupContext, and kanzi::BindingNodeLookupContext.

◆ lookup()

virtual ObjectSharedPtr kanzi::BindingLookupContext::lookup ( string_view  path)
pure virtual

Looks up object by path.

For some implementations of BindingLookupContext, lookupRaw() might return valid pointers for non-objects, in which case lookupObject() returns nullptr.

Parameters
pathPath used for lookup.
Returns
Object identified by path from the current object. If not found, returns empty.

Implemented in kanzi::BindingRenderValueLookupContext, kanzi::BindingRenderPassLookupContext, kanzi::BindingNodeLookupContext, and kanzi::BindingTriggerLookupContext.

◆ lookupRaw()

virtual void* kanzi::BindingLookupContext::lookupRaw ( string_view  path)
virtual

Looks up object by path.

Default implementation internally calls lookup().

Parameters
pathPath used for lookup.
Returns
Object identified by path from the current object or nullptr if not found.

Reimplemented in kanzi::BindingRenderValueLookupContext.

◆ createValueSourceOwner()

virtual AbstractPropertyTypeDescriptor::ValueSourceOwner* kanzi::BindingLookupContext::createValueSourceOwner ( ValueSourceBindingTargetRuntime targetRuntime,
bool  reuseAllowed 
)
virtual

Creates an owner for the specific type of object with which this binding lookup context is associated.

Default implementation of this function throws an exception.

Parameters
targetRuntimeBinding target runtime for the value source.
reuseAllowedSet to true if the value source created can be reused by other functionality, such as setProperty.
Returns
Value source owner pointer to be installed to an object.

Reimplemented in kanzi::BindingRenderPassLookupContext, and kanzi::BindingNodeLookupContext.

◆ registerGlobalNotification()

virtual void kanzi::BindingLookupContext::registerGlobalNotification ( string_view  path,
BindingLookupNotificationBase notificationObject 
)
virtual

Registers for a notification regarding global change.

When a change happens that could make target object available, a notification is invoked on the target object. Default implementation of this function throws an exception.

Parameters
pathPath associated with lookup.
notificationObjectObject to register notification for.

Reimplemented in kanzi::BindingRenderValueLookupContext, kanzi::BindingRenderPassLookupContext, and kanzi::BindingNodeLookupContext.

◆ unregisterGlobalNotification()

virtual void kanzi::BindingLookupContext::unregisterGlobalNotification ( string_view  path,
BindingLookupNotificationBase notificationObject 
)
virtual

De-registers a notification regarding global change.

Default implementation of this function throws an exception.

Parameters
pathPath associated with lookup.
notificationObjectObject to register notification for.

Reimplemented in kanzi::BindingRenderValueLookupContext, kanzi::BindingRenderPassLookupContext, and kanzi::BindingNodeLookupContext.

◆ registerLocalNotification()

virtual void kanzi::BindingLookupContext::registerLocalNotification ( PropertyObject object,
string_view  path,
BindingLookupNotificationBase notificationObject 
)
virtual

Registers for a notification regarding global change.

When a change happens that could make target object no longer available, a notification is invoked on the registered notification object. Object parameter may only be nullptr if path points to a local resource. Default implementation of this function throws an exception.

Parameters
objectPointer to object.
pathPath associated with lookup.
notificationObjectObject to register notification for.

Reimplemented in kanzi::BindingRenderValueLookupContext, kanzi::BindingRenderPassLookupContext, and kanzi::BindingNodeLookupContext.

◆ unregisterLocalNotification()

virtual void kanzi::BindingLookupContext::unregisterLocalNotification ( PropertyObject object,
string_view  path,
BindingLookupNotificationBase notificationObject 
)
virtual

De-registers a notification regarding global change.

Object parameter may only be nullptr if path points to a local resource. Default implementation of this function throws an exception.

Parameters
objectPointer to object.
pathPath associated with lookup.
notificationObjectObject to register notification for.

Reimplemented in kanzi::BindingRenderValueLookupContext, kanzi::BindingRenderPassLookupContext, and kanzi::BindingNodeLookupContext.


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