Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::Command<> Class Reference

#include <command.hpp>

Public Types

using Action = std::function<void()>
using Predicate = std::function<bool()>
using CanExecuteSignal = detail::TypedSignal<bool>

Public Member Functions

template<std::invocable<> A>
 Command (A &&action)
template<std::invocable<> A, std::predicate<> P>
 Command (A &&action, P &&predicate)
 Command (const Command &)=delete
Commandoperator= (const Command &)=delete
 Command (Command &&)=delete
Commandoperator= (Command &&)=delete
 ~Command ()
void execute ()
void operator() ()
bool can_execute () const
void notify_can_execute_changed () const
 Force-emit a can_execute notification.
Subscription observe_can_execute (std::function< void(bool)> fn)

Friends

class binding::BindingEngine

Member Typedef Documentation

◆ Action

using aria::Command<>::Action = std::function<void()>

◆ Predicate

using aria::Command<>::Predicate = std::function<bool()>

◆ CanExecuteSignal

using aria::Command<>::CanExecuteSignal = detail::TypedSignal<bool>

Constructor & Destructor Documentation

◆ Command() [1/4]

template<std::invocable<> A>
aria::Command<>::Command ( A && action)
inlineexplicit

◆ Command() [2/4]

template<std::invocable<> A, std::predicate<> P>
aria::Command<>::Command ( A && action,
P && predicate )
inline

◆ Command() [3/4]

aria::Command<>::Command ( const Command<> & )
delete

◆ Command() [4/4]

aria::Command<>::Command ( Command<> && )
delete

◆ ~Command()

aria::Command<>::~Command ( )
inline

Member Function Documentation

◆ operator=() [1/2]

Command & aria::Command<>::operator= ( const Command<> & )
delete

◆ operator=() [2/2]

Command & aria::Command<>::operator= ( Command<> && )
delete

◆ execute()

void aria::Command<>::execute ( )
inline

◆ operator()()

void aria::Command<>::operator() ( )
inline

◆ can_execute()

bool aria::Command<>::can_execute ( ) const
inlinenodiscard

◆ notify_can_execute_changed()

void aria::Command<>::notify_can_execute_changed ( ) const
inline

Force-emit a can_execute notification.

Rarely needed for Command<> (the built-in Effect handles reactive state automatically); provided as an escape hatch when the predicate depends on non-reactive state.

◆ observe_can_execute()

Subscription aria::Command<>::observe_can_execute ( std::function< void(bool)> fn)
inlinenodiscard

◆ binding::BindingEngine

friend class binding::BindingEngine
friend

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