HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends
tt::observable< T > Class Template Reference

Public Types

using value_type = T
 
using callback_type = std::function<void(value_type const &)>
 
using time_point = hires_utc_clock::time_point
 
using duration = hires_utc_clock::duration
 

Public Member Functions

 observable (observable const &other) noexcept
 
observableoperator= (observable const &other) noexcept
 
 observable (value_type const &value) noexcept
 
template<typename Other >
 observable (observable< Other > const &other) noexcept
 
template<typename Other >
 observable (Other const &other) noexcept
 
observableoperator= (value_type const &value) noexcept
 
template<typename Other >
observableoperator= (observable< Other > const &other) noexcept
 
template<typename Other >
observableoperator= (Other const &other) noexcept
 
value_type previous_value () const noexcept
 
time_point time_when_last_modified () const noexcept
 Time when the value was modified last.
 
duration duration_since_last_modified () const noexcept
 Duration since the value was last modified.
 
float animation_progress (duration animation_duration) const noexcept
 The relative time since the start of the animation.
 
bool animating (duration animation_duration) const noexcept
 
value_type load () const noexcept
 
value_type operator* () const noexcept
 
value_type load (duration animation_duration) const noexcept
 
bool store (value_type const &new_value) noexcept
 
size_t add_callback (callback_type callback) noexcept
 
void remove_callback (size_t id) noexcept
 

Friends

observable< bool > operator! (observable const &rhs) noexcept
 
bool operator== (observable const &lhs, observable const &rhs) noexcept
 
bool operator== (observable const &lhs, value_type const &rhs) noexcept
 
bool operator== (value_type const &lhs, observable const &rhs) noexcept
 
bool operator!= (observable const &lhs, observable const &rhs) noexcept
 
bool operator!= (observable const &lhs, value_type const &rhs) noexcept
 
bool operator!= (value_type const &lhs, observable const &rhs) noexcept
 
float to_float (observable const &rhs) noexcept
 
float to_float (observable const &rhs, duration animation_duration) noexcept
 
std::string to_string (observable const &rhs) noexcept
 
std::ostreamoperator<< (std::ostream &lhs, observable const &rhs) noexcept
 

Member Function Documentation

◆ animation_progress()

template<typename T >
float tt::observable< T >::animation_progress ( duration animation_duration) const
inlinenoexcept

The relative time since the start of the animation.

The relative time since the start of the animation according to the duration of the animation.

Parameters
Arelative value between 0.0 and 1.0.

◆ duration_since_last_modified()

template<typename T >
duration tt::observable< T >::duration_since_last_modified ( ) const
inlinenoexcept

Duration since the value was last modified.

◆ time_when_last_modified()

template<typename T >
time_point tt::observable< T >::time_when_last_modified ( ) const
inlinenoexcept

Time when the value was modified last.


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