|
HikoGUI
A low latency retained GUI
|
#include <ttauri/observable.hpp>
Public Types | |
| enum class | state_type : uint8_t { read , write , modified } |
| using | value_type = T |
Public Member Functions | |
| observable_proxy (observable_impl< T > &actual) | |
| observable_proxy (observable_proxy &&)=delete | |
| observable_proxy (observable_proxy const &)=delete | |
| void | prepare (state_type new_state) const noexcept |
| operator value_type () const noexcept | |
| operator value_type & () const noexcept | |
| operator value_type const & () const noexcept | |
| observable_proxy & | operator= (observable_proxy &&other) noexcept |
| Copy the value from a temporary proxy. | |
| observable_proxy & | operator= (observable_proxy const &other) noexcept |
| Copy the value from a proxy. | |
|
template<typename Arg = value_type> requires (is_variable and not is_atomic and not std::is_same_v<std::remove_cvref_t<Arg>, observable_proxy>) | |
| observable_proxy & | operator= (Arg &&arg) noexcept |
|
template<typename Arg = value_type> requires (is_variable and is_atomic and not std::is_same_v<std::remove_cvref_t<Arg>, observable_proxy>) | |
| observable_proxy & | operator= (Arg &&arg) noexcept |
| value_type | operator* () const noexcept |
| value_type const & | operator* () const noexcept |
| value_type & | operator* () const noexcept |
| value_type const * | operator-> () const noexcept |
| value_type * | operator-> () const noexcept |
| template<typename... Args> | |
| decltype(auto) | operator() (Args &&...args) const noexcept |
|
template<typename Arg > requires (is_variable and not is_atomic) | |
| decltype(auto) | operator[] (Arg &&arg) const noexcept |
|
template<typename Arg > requires (is_constant and not is_atomic) | |
| decltype(auto) | operator[] (Arg &&arg) const noexcept |
Data Fields | |
| observable_impl< value_type > * | _actual = nullptr |
| value_type | _original |
| state_type | _state = state_type::none |
Static Public Attributes | |
| static constexpr bool | is_atomic = std::is_scalar_v<T> |
| static constexpr bool | is_constant = Constant |
| static constexpr bool | is_variable = not Constant |
A proxy to the shared-value inside an observable.
This proxy object makes sure that updates to a value is atomic and that modifications causes notifications to be sent.
| T | The type of the observed value. |
| Constant | True when there is read-only access to the value. False if there is read-write access. |
|
inlinenoexcept |
Copy the value from a temporary proxy.
|
inlinenoexcept |
Copy the value from a proxy.