Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ui::ActionSet Class Reference

Cold owning declarations, transferred to one managed scene on first button/menu/key binding. UI-affine. Cold recipes and key stages retain declarations until managed attachment. Scene close clears callbacks and invalidates refs even when this descriptor survives. Construction may throw; no router, scheduler, resource executable or binding token is created here. More...

#include <ui_action.hpp>

Public Member Functions

 ActionSet (ActionSetOptions options={})
 ActionSet (ActionSet &&other) noexcept
ActionSet & operator= (ActionSet &&other) noexcept
 ActionSet (const ActionSet &)=delete
ActionSet & operator= (const ActionSet &)=delete
 ~ActionSet ()
 Release cold declarations on UI; attached scenes/recipes retain their own ownership.
std::expected< ActionRef, TreeError > add (std::string_view key, Action action)
ActionRef action (std::string_view key, Action action)
template<class Callback = detail::QuitCommand>
requires (std::copy_constructible<Callback> && portals::detail::ManagedAction<Callback, ActionInvocation>)
ActionRef action (std::string_view key, std::string_view caption, Callback callback)
template<class Callback = detail::QuitCommand>
requires (std::copy_constructible<Callback> && portals::detail::ManagedAction<Callback, ActionInvocation>)
std::expected< ActionRef, TreeError > add (std::string_view key, std::string_view caption, Callback callback)

Detailed Description

Cold owning declarations, transferred to one managed scene on first button/menu/key binding. UI-affine. Cold recipes and key stages retain declarations until managed attachment. Scene close clears callbacks and invalidates refs even when this descriptor survives. Construction may throw; no router, scheduler, resource executable or binding token is created here.

Constructor & Destructor Documentation

◆ ActionSet() [1/2]

portals::ui::ActionSet::ActionSet ( ActionSetOptions options = {})
explicit
Parameters
optionsPositive finite admission budgets, checked when admitting an action.

◆ ActionSet() [2/2]

portals::ui::ActionSet::ActionSet ( ActionSet && other)
noexcept
Parameters
otherUI-affine declaration owner, left empty; foreign-thread moves terminate.

Member Function Documentation

◆ action() [1/2]

ActionRef portals::ui::ActionSet::action ( std::string_view key,
Action action )
Parameters
keyUnique organizational key.
actionOwning callback and metadata.
Returns
Compact weak ref; admission failure is delivered at its later scene binding.

◆ action() [2/2]

template<class Callback = detail::QuitCommand>
requires (std::copy_constructible<Callback> && portals::detail::ManagedAction<Callback, ActionInvocation>)
ActionRef portals::ui::ActionSet::action ( std::string_view key,
std::string_view caption,
Callback callback )
inline
Parameters
keyUnique organizational key.
captionShared owning caption copied inside admission.
callbackCompact callback.
Returns
Weak ref with sticky typed failure on rejected admission.

◆ add() [1/2]

std::expected< ActionRef, TreeError > portals::ui::ActionSet::add ( std::string_view key,
Action action )
Parameters
keyNonempty unique organizational key, independent of exclusiveGroup.
actionOwning callback and metadata.
Returns
Weak action or typed failure without partial entry publication.

◆ add() [2/2]

template<class Callback = detail::QuitCommand>
requires (std::copy_constructible<Callback> && portals::detail::ManagedAction<Callback, ActionInvocation>)
std::expected< ActionRef, TreeError > portals::ui::ActionSet::add ( std::string_view key,
std::string_view caption,
Callback callback )
inline
Parameters
keyUnique organizational key.
captionShared caption.
callbackCompact callback.
Returns
Checked admission without a partial entry.

◆ operator=()

ActionSet & portals::ui::ActionSet::operator= ( ActionSet && other)
noexcept
Parameters
otherUI-affine declaration owner.
Returns
This owner; foreign-thread assignment terminates.

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