HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Data Fields | Static Public Attributes
tt::detail::observable_impl< T > Struct Template Reference

#include <ttauri/observable.hpp>

Public Types

using value_type = T
 
using atomic_value_type = std::conditional_t<is_atomic, std::atomic<value_type>, value_type>
 
using owner_type = observable<value_type>
 

Public Member Functions

 observable_impl (observable_impl const &)=delete
 
 observable_impl (observable_impl &&)=delete
 
observable_imploperator= (observable_impl const &)=delete
 
observable_imploperator= (observable_impl &&)=delete
 
 observable_impl (value_type const &value) noexcept
 
 observable_impl (value_type &&value) noexcept
 
observable_proxy< value_type, false > get () noexcept
 
observable_proxy< value_type, true > cget () noexcept
 
void add_owner (owner_type &owner) noexcept
 Add an observer as one of the owners of the shared-value.
 
void remove_owner (owner_type &owner) noexcept
 Remove an observer as one of the owners of the shared-value.
 
void notify_owners () const noexcept
 
void reseat_owners (std::shared_ptr< observable_impl > const &new_impl) noexcept
 

Data Fields

atomic_value_type value
 
std::vector< owner_type * > owners
 
unfair_mutex mutex
 The mutex is used to serialize state to the owners list and non-atomic value.
 

Static Public Attributes

static constexpr bool is_atomic = std::is_scalar_v<T>
 

Detailed Description

template<typename T>
struct tt::detail::observable_impl< T >

The shared value, shared between observers.

Member Function Documentation

◆ add_owner()

template<typename T >
void tt::detail::observable_impl< T >::add_owner ( owner_type & owner)
inlinenoexcept

Add an observer as one of the owners of the shared-value.

Parameters
ownerA reference to observer

◆ remove_owner()

template<typename T >
void tt::detail::observable_impl< T >::remove_owner ( owner_type & owner)
inlinenoexcept

Remove an observer as one of the owners of the shared-value.

Parameters
ownerA reference to observer

Field Documentation

◆ mutex

template<typename T >
unfair_mutex tt::detail::observable_impl< T >::mutex
mutable

The mutex is used to serialize state to the owners list and non-atomic value.


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