|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
Type-erased Property surface. More...
#include <i_property.hpp>
Public Member Functions | |
| virtual | ~IProperty () noexcept=default |
| virtual std::any | get_any () const =0 |
| Read the current value as a std::any. | |
| virtual bool | set_any (const std::any &value)=0 |
| Try to set the property's value from a std::any. | |
| virtual Subscription | subscribe_any (std::function< void(const std::any &)> on_changed)=0 |
| Subscribe to value changes. | |
| virtual const std::type_info & | type () const noexcept=0 |
| The runtime type of the wrapped value. | |
Protected Member Functions | |
| IProperty () noexcept=default | |
| IProperty (const IProperty &)=delete | |
| IProperty & | operator= (const IProperty &)=delete |
| IProperty (IProperty &&)=delete | |
| IProperty & | operator= (IProperty &&)=delete |
Type-erased Property surface.
Stable, non-template, suitable for crossing a shared-library boundary.
Implementations:
|
virtualdefaultnoexcept |
|
protecteddefaultnoexcept |
|
protecteddelete |
|
protecteddelete |
|
nodiscardpure virtual |
Read the current value as a std::any.
The runtime type is guaranteed to equal type().
Implemented in aria::Property< T >, aria::reactive::Property< T >, aria::reactive::Property< aria::Loadable< T > >, aria::reactive::Property< aria::ValidationResult >, aria::reactive::Property< aria::ValidationState >, aria::reactive::Property< bool >, aria::reactive::Property< handle >, aria::reactive::Property< std::optional< aria::Error > >, aria::reactive::Property< std::optional< R > >, aria::reactive::Property< std::optional< T > >, aria::reactive::Property< std::shared_ptr< aria::binding::ViewModel > >, aria::reactive::Property< std::size_t >, aria::reactive::Property< std::string >, and aria::reactive::Property< std::vector< handle > >.
|
nodiscardpure virtual |
Try to set the property's value from a std::any.
Returns true on success, false when the runtime types don't match (in which case the property is left unchanged).
Implemented in aria::Property< T >, aria::reactive::Property< T >, aria::reactive::Property< aria::Loadable< T > >, aria::reactive::Property< aria::ValidationResult >, aria::reactive::Property< aria::ValidationState >, aria::reactive::Property< bool >, aria::reactive::Property< handle >, aria::reactive::Property< std::optional< aria::Error > >, aria::reactive::Property< std::optional< R > >, aria::reactive::Property< std::optional< T > >, aria::reactive::Property< std::shared_ptr< aria::binding::ViewModel > >, aria::reactive::Property< std::size_t >, aria::reactive::Property< std::string >, and aria::reactive::Property< std::vector< handle > >.
|
nodiscardpure virtual |
Subscribe to value changes.
The callback receives the new value as std::any of the same runtime type as type().
Implemented in aria::Property< T >, aria::reactive::Property< T >, aria::reactive::Property< aria::Loadable< T > >, aria::reactive::Property< aria::ValidationResult >, aria::reactive::Property< aria::ValidationState >, aria::reactive::Property< bool >, aria::reactive::Property< handle >, aria::reactive::Property< std::optional< aria::Error > >, aria::reactive::Property< std::optional< R > >, aria::reactive::Property< std::optional< T > >, aria::reactive::Property< std::shared_ptr< aria::binding::ViewModel > >, aria::reactive::Property< std::size_t >, aria::reactive::Property< std::string >, and aria::reactive::Property< std::vector< handle > >.
|
nodiscardpure virtualnoexcept |
The runtime type of the wrapped value.
Useful for callers that want to gate their std::any_cast on a name comparison before paying the cost of the cast.
Implemented in aria::Property< T >, aria::reactive::Property< T >, aria::reactive::Property< aria::Loadable< T > >, aria::reactive::Property< aria::ValidationResult >, aria::reactive::Property< aria::ValidationState >, aria::reactive::Property< bool >, aria::reactive::Property< handle >, aria::reactive::Property< std::optional< aria::Error > >, aria::reactive::Property< std::optional< R > >, aria::reactive::Property< std::optional< T > >, aria::reactive::Property< std::shared_ptr< aria::binding::ViewModel > >, aria::reactive::Property< std::size_t >, aria::reactive::Property< std::string >, and aria::reactive::Property< std::vector< handle > >.