Kanzi Engine API
kanzi::ValueRange Class Referenceabstract

Value Range is an observable range implementation that provides a way to access values by index. More...

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

Inheritance diagram for kanzi::ValueRange:
[legend]

Public Member Functions

bool getValue (Variant &value, size_t index)
 Gets a value from the range by index. More...
 
 ValueRange (string_view name)
 Constructor. More...
 
- Public Member Functions inherited from kanzi::ObservableRange
void addNotification (void *data, NotificationFunction func)
 Sets the notification function. More...
 
string getName () const
 Gets the name of the iterator. More...
 
bool hasNotification (void *data, NotificationFunction func) const
 Tells if given notification exists. More...
 
void invalidate ()
 Invalidates the range. More...
 
bool isNamed (string_view name) const
 Checks whether the name of the iterator matches a given name. More...
 
bool isValid ()
 Checks whether the iterator is valid. More...
 
void notify ()
 Notifies the iterator about the iteration contents having changed. More...
 
 ObservableRange (string_view name)
 Constructor. More...
 
void removeNotification (void *data, NotificationFunction func)
 Removes a notification function. More...
 
void setRangeProducerReference (ObservableRangeProducerSharedPtr factory)
 Sets the factory reference for the observable range. More...
 
virtual ~ObservableRange ()=default
 Destructor. More...
 

Protected Member Functions

virtual bool getValueOverride (Variant &value, size_t index)=0
 Internal implementation of value acquisition. More...
 
- Protected Member Functions inherited from kanzi::ObservableRange
virtual void notifyOverride ()
 Implements default notification implementation. More...
 

Additional Inherited Members

- Protected Attributes inherited from kanzi::ObservableRange
ObservableRangeProducerWeakPtr m_factory
 Iterator factory that created this iterator. More...
 
string m_name
 Identifying iterator name. More...
 
vector< NotificationInfo > m_notifications
 Functions to call when notified. More...
 

Detailed Description

Value Range is an observable range implementation that provides a way to access values by index.

Use Value Range in iterators in bindings that need to retrieve values.

The range construction is responsible for determining the value to extract, the range interface only accesses by index.

Since
Kanzi 3.9.0

Constructor & Destructor Documentation

kanzi::ValueRange::ValueRange ( string_view  name)
inline

Constructor.

Parameters
nameName to create the iterator with.

Member Function Documentation

bool kanzi::ValueRange::getValue ( Variant value,
size_t  index 
)
inline

Gets a value from the range by index.

Parameters
valueVariant to write the acquired value to.
indexIndex of the value to access.
Returns
If the value was read successfully, true, otherwise false.
virtual bool kanzi::ValueRange::getValueOverride ( Variant value,
size_t  index 
)
protectedpure virtual

Internal implementation of value acquisition.

Parameters
valueVariant to write the acquired value to.
indexIndex of the value to access.
Returns
If the value was read successfully, true, otherwise false.

Implemented in kanzi::GatherLightsRenderPass::LightRange, and kanzi::GatherNearestLightsRenderPass::NearestLightRange.


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