Kanzi  3.9.7
Kanzi Engine API
kanzi::RelativeNodeResolver Class Reference

Enables you to get the current node in relative path. More...

#include <kanzi/core.ui/node/relative_node_resolver.hpp>

Public Types

enum  State { State::Inactive, State::Local, State::Global }
 Observing states. More...
 

Public Member Functions

void attach (Node *baseNode, string_view relativePath)
 Attaches a resolver. More...
 
void detach ()
 Detaches a resolver. More...
 
NodeSharedPtr get () const
 Returns the node to which the relative path points. More...
 
RelativeNodeResolver::State getState () const
 Returns the current observing state. More...
 
 RelativeNodeResolver ()=default
 Constructor. More...
 
void resolve ()
 Execute resolving. More...
 

Detailed Description

Enables you to get the current node in relative path.

The functions in this class track the node changes in relative path by observing the changes in the Node::PathProperty properties. To get a node to which a relative path points, attach a resolver, and then get the node.

Member Enumeration Documentation

Observing states.

Enumerator
Inactive 

Inactive. Resolver is not attached.

Local 

Observing the path changes of the node in the relative path.

Global 

Observing changes to any path of any node.

A resolver is in this state when there is no node in the relative path.

Constructor & Destructor Documentation

kanzi::RelativeNodeResolver::RelativeNodeResolver ( )
explicitdefault

Constructor.

Member Function Documentation

void kanzi::RelativeNodeResolver::attach ( Node baseNode,
string_view  relativePath 
)

Attaches a resolver.

When you attach a resolver, Kanzi starts observing the node changes in the node tree location to which the relative path points.

Parameters
baseNodeNode from which you want relative path to start.
relativePathRelative path to the node tree location of which the resolver starts observing the changes.
void kanzi::RelativeNodeResolver::detach ( )

Detaches a resolver.

When you detach a resolver, Kanzi stops observing the node changes in the node tree location to which the relative path points.

NodeSharedPtr kanzi::RelativeNodeResolver::get ( ) const

Returns the node to which the relative path points.

Returns
The node to which the relative path points.
void kanzi::RelativeNodeResolver::resolve ( )

Execute resolving.

RelativeNodeResolver::State kanzi::RelativeNodeResolver::getState ( ) const
inline

Returns the current observing state.

Returns
Current observing state.

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