HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions
tt::detail::observable_chain< T > Class Template Referencefinal
Inheritance diagram for tt::detail::observable_chain< T >:
tt::detail::observable_base< T >

Public Types

using super = observable_base<T>
 
using base = observable_base<T>
 
using value_type = typename super::value_type
 
- Public Types inherited from tt::detail::observable_base< T >
using value_type = T
 
using notifier_type = notifier<void()>
 
using callback_type = typename notifier_type::callback_type
 
using callback_ptr_type = typename notifier_type::callback_ptr_type
 

Public Member Functions

 observable_chain (observable< value_type > *owner, base *operand) noexcept
 
virtual value_type load () const noexcept override
 Get the current value.
 
virtual bool store (value_type const &new_value) noexcept override
 Set the value.
 
void replace_operand (base *from, base *to) noexcept override
 Replace the operand.
 
- Public Member Functions inherited from tt::detail::observable_base< T >
 observable_base (observable_base const &)=delete
 
 observable_base (observable_base &&)=delete
 
observable_baseoperator= (observable_base const &)=delete
 
observable_baseoperator= (observable_base &&)=delete
 
 observable_base (observable< value_type > *owner) noexcept
 Constructor.
 
void notify () noexcept
 
void replace_with (observable_base *other) noexcept
 Let other take over the listeners and owner.
 
void add_listener (observable_base *listener)
 
void remove_listener (observable_base *listener)
 

Member Function Documentation

◆ load()

template<typename T >
virtual value_type tt::detail::observable_chain< T >::load ( ) const
inlineoverridevirtualnoexcept

Get the current value.

The value is often calculated directly from the cached values retrieved from notifications down the chain.

Implements tt::detail::observable_base< T >.

◆ replace_operand()

template<typename T >
void tt::detail::observable_chain< T >::replace_operand ( base * from,
base * to )
inlineoverridevirtualnoexcept

Replace the operand.

Parameters
toThe observer to replace the operand with. Maybe be nullptr.

Reimplemented from tt::detail::observable_base< T >.

◆ store()

template<typename T >
virtual bool tt::detail::observable_chain< T >::store ( value_type const & new_value)
inlineoverridevirtualnoexcept

Set the value.

The value is often not directly stored, but instead forwarded up the chain of observables. And then let the notifications flowing backward updated the cached values so that loads() will be quick.

Parameters
new_valueThe new value
Returns
true if the value was different from before.

Implements tt::detail::observable_base< T >.


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