AUI Framework
develop
Cross-platform base for C++ UI apps
|
Property implementation to use with custom getter/setter. More...
#include <AUI/Common/AProperty.h>
Public Types | |
using | Model = M |
using | GetterReturnT = decltype(std::invoke(get, base)) |
using | Underlying = std::decay_t<GetterReturnT> |
Public Member Functions | |
APropertyDef (const M *base, Getter get, Setter set, const emits< SignalArg > &changed) | |
template<aui::convertible_to< Underlying > U> | |
APropertyDef & | operator= (U &&u) |
GetterReturnT | value () const noexcept |
GetterReturnT | operator* () const noexcept |
const Underlying * | operator-> () const noexcept |
operator GetterReturnT () const noexcept | |
M * | boundObject () const |
template<aui::invocable< const Underlying & > Projection> | |
auto | readProjected (Projection &&projection) noexcept |
Makes a readonly projection of this property. | |
template<aui::invocable< const Underlying & > ProjectionRead, aui::invocable< const std::invoke_result_t< ProjectionRead, Underlying > & > ProjectionWrite> | |
auto | biProjected (ProjectionRead &&projectionRead, ProjectionWrite &&projectionWrite) noexcept |
Makes a bidirectional projection of this property. | |
template<aui::detail::property::ProjectionBidirectional< Underlying > Projection> | |
auto | biProjected (Projection &&projectionBidirectional) noexcept |
Makes a bidirectional projection of this property (by a single aui::lambda_overloaded). | |
Signals and public fields | |
const M * | base |
AObject which this property belongs to. | |
Getter | get |
Getter. Can be pointer-to-member(function or field) or lambda. | |
Setter | set |
Setter. Can be pointer-to-member(function or field) or lambda. | |
const emits< SignalArg > & | changed |
Reference to underlying signal emitting on value changes. | |
Property implementation to use with custom getter/setter.
See property system for more info.
APropertyDef does not involve extra runtime overhead between assignment and getter/setter.
Setter APropertyDef< M, Getter, Setter, SignalArg >::set |
Setter. Can be pointer-to-member(function or field) or lambda.
The setter implementation typically emits changed
signal. If it is, it must emit changes only if value is actually changed.