kanzi::StateManager::TargetObject Class Reference

TargetObject. More...

#include <kanzi/core.ui/state_manager/state_manager.hpp>

Public Member Functions

 TargetObject (Node *rootNode, string_view objectPath)
 Constructor. More...
 
 ~TargetObject ()
 Destructor. More...
 
void registerStateObjectRuntime (StateObjectRuntime &stateObjectRuntime)
 Register state object runtime which should be notified when target is acquired or lost. More...
 
Objectget ()
 Gets acquired target. More...
 
void sync ()
 Refreshes target. More...
 
void destroy ()
 Destroys TargetObject. More...
 

Detailed Description

TargetObject.

TargetObject is responsible for keeping track of a target object (node or resource) to which state object runtimes apply their styles. TargetObject also notifies referencing state object runtimes when target becomes acquired or lost.

Constructor & Destructor Documentation

kanzi::StateManager::TargetObject::TargetObject ( Node rootNode,
string_view  objectPath 
)
explicit

Constructor.

Parameters
rootNodeRoot node for resolving target.
objectPathPath to target relative to root node.
kanzi::StateManager::TargetObject::~TargetObject ( )

Destructor.

Member Function Documentation

void kanzi::StateManager::TargetObject::registerStateObjectRuntime ( StateObjectRuntime stateObjectRuntime)

Register state object runtime which should be notified when target is acquired or lost.

Parameters
stateObjectRuntimeState object runtime which should be notified.
Object* kanzi::StateManager::TargetObject::get ( )

Gets acquired target.

If target is not found, null pointer is returned.

Returns
Acquired target or null pointer.
void kanzi::StateManager::TargetObject::sync ( )

Refreshes target.

Currently TargetObject is not able to automatically detect when target is acquired, so this function should be manually called. Calling this function might trigger notification about acquiring the target.

void kanzi::StateManager::TargetObject::destroy ( )

Destroys TargetObject.

After TargetObject is destroyed, it does not track its target and get() function always returns null pointer.


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