AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AProperty< T > Struct Template Reference

Basic easy-to-use property implementation containing T. More...

#include <AUI/Common/AProperty.h>

Public Types

using Underlying = T
 

Public Member Functions

template<aui::convertible_to< T > U>
 AProperty (U &&value) noexcept
 
AObjectBaseboundObject ()
 
template<aui::convertible_to< T > U>
APropertyoperator= (U &&value) noexcept
 
template<ASignalInvokable SignalInvokable>
void operator^ (SignalInvokable &&t)
 
const T & value () const noexcept
 
T & value () noexcept
 
 operator const T & () const noexcept
 
const T * operator-> () const noexcept
 
const T & operator* () const noexcept
 
T & operator* () noexcept
 
template<aui::invocable< const T & > Projection>
auto readProjected (Projection &&projection) noexcept
 Makes a readonly projection of this property.
 
template<aui::invocable< const T & > ProjectionRead, aui::invocable< const std::invoke_result_t< ProjectionRead, T > & > ProjectionWrite>
auto biProjected (ProjectionRead &&projectionRead, ProjectionWrite &&projectionWrite) noexcept
 Makes a bidirectional projection of this property.
 
template<aui::detail::property::ProjectionBidirectional< T > Projection>
auto biProjected (Projection &&projectionBidirectional) noexcept
 Makes a bidirectional projection of this property (by a single aui::lambda_overloaded).
 
- Public Member Functions inherited from AObjectBase
 AObjectBase (AObjectBase &&rhs) noexcept
 
void clearSignals () noexcept
 
- Public Member Functions inherited from aui::noncopyable
 noncopyable (const noncopyable &)=delete
 
noncopyableoperator= (const noncopyable &)=delete
 

Signals and public fields

raw
 
emits< T > changed
 

Detailed Description

template<typename T>
struct AProperty< T >

Basic easy-to-use property implementation containing T.

AProperty<T> is a container holding an instance of T. You can assign a value to it with operator= and read value with value() method or implicit conversion operator T().

See property system for more info.

struct User {
AProperty<AString> name;
AProperty<AString> surname;
};
// AProperty behaves like a class/struct data member:
User u;
u.name = "Hello";
EXPECT_EQ(u.name, "Hello");
Examples
/home/runner/work/aui/aui/aui.core/src/AUI/Common/APropertyPrecomputed.h.

The documentation for this struct was generated from the following file:
Inheritance diagram for AProperty< T >:
Collaboration diagram for AProperty< T >: