Kanzi Engine API
kanzi::ObservableRange Class Reference

Observable range. More...

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

Inheritance diagram for kanzi::ObservableRange:
[legend]

Public Member Functions

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 void notifyOverride ()
 Implements default notification implementation. More...
 

Protected Attributes

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

Observable range.

Provides an interface for listening and notification on the range.

Inheriting classes should provide a way to access elements from the range by index or iteration.

Since
Kanzi 3.9.0

Constructor & Destructor Documentation

kanzi::ObservableRange::ObservableRange ( string_view  name)
inline

Constructor.

Parameters
nameRange name.
virtual kanzi::ObservableRange::~ObservableRange ( )
virtualdefault

Destructor.

Member Function Documentation

string kanzi::ObservableRange::getName ( ) const
inline

Gets the name of the iterator.

Returns
Name of the iterator.
bool kanzi::ObservableRange::isNamed ( string_view  name) const
inline

Checks whether the name of the iterator matches a given name.

Parameters
nameName to compare against.
Returns
If the names match, true, otherwise false.
void kanzi::ObservableRange::invalidate ( )
inline

Invalidates the range.

This removes the reference to the factory that created the iterator.

bool kanzi::ObservableRange::isValid ( )
inline

Checks whether the iterator is valid.

Returns
If the iterator is valid, true, otherwise false.
void kanzi::ObservableRange::setRangeProducerReference ( ObservableRangeProducerSharedPtr  factory)
inline

Sets the factory reference for the observable range.

Used to check if the range is valid.

Parameters
factoryFactory that produced the range.
void kanzi::ObservableRange::notify ( )
inline

Notifies the iterator about the iteration contents having changed.

void kanzi::ObservableRange::addNotification ( void *  data,
NotificationFunction  func 
)

Sets the notification function.

Parameters
dataNotification function data.
funcFunction to invoke when the iterator is notified.
bool kanzi::ObservableRange::hasNotification ( void *  data,
NotificationFunction  func 
) const

Tells if given notification exists.

Parameters
dataNotification function data.
funcFunction to invoke when the iterator is notified.
void kanzi::ObservableRange::removeNotification ( void *  data,
NotificationFunction  func 
)

Removes a notification function.

Parameters
dataNotification function data.
funcFunction to invoke when the iterator is notified.
virtual void kanzi::ObservableRange::notifyOverride ( )
protectedvirtual

Implements default notification implementation.

Can be overridden by successive classes.

Reimplemented in kanzi::GatherNearestLightsRenderPass::NearestLightRange.

Member Data Documentation

string kanzi::ObservableRange::m_name
protected

Identifying iterator name.

vector<NotificationInfo> kanzi::ObservableRange::m_notifications
protected

Functions to call when notified.

ObservableRangeProducerWeakPtr kanzi::ObservableRange::m_factory
protected

Iterator factory that created this iterator.


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