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

Owning shortcut alternatives; one registration invokes at most once per completed event. More...

#include <shortcut.hpp>

Public Member Functions

 Shortcut ()
 Construct empty owning storage; debug-container allocation is allowed to throw.
 Shortcut (std::initializer_list< key::Chord > chords)
 Shortcut (const Shortcut &other)=default
 Shortcut (Shortcut &&other)
Shortcut & operator= (const Shortcut &other)=default
Shortcut & operator= (Shortcut &&other) noexcept

Public Attributes

std::vector< key::Chord > alternatives
 Owned values, never views into a caller string or initializer list.
std::vector< ShortcutSequence > sequences
 Owned sequences sharing the alternative budget with single chords.

Detailed Description

Owning shortcut alternatives; one registration invokes at most once per completed event.

Constructor & Destructor Documentation

◆ Shortcut() [1/3]

portals::Shortcut::Shortcut ( std::initializer_list< key::Chord > chords)
inlineexplicit
Parameters
chordsAlternatives copied from storage borrowed only during construction.

◆ Shortcut() [2/3]

portals::Shortcut::Shortcut ( const Shortcut & other)
default
Parameters
otherOwning alternatives copied without retaining a source view.

◆ Shortcut() [3/3]

portals::Shortcut::Shortcut ( Shortcut && other)
inline
Parameters
otherOwning alternatives transferred; moved-from storage remains empty. This potentially throwing construction deliberately avoids a noexcept vector move: some debug standard libraries allocate an iterator proxy in that move.

Member Function Documentation

◆ operator=() [1/2]

Shortcut & portals::Shortcut::operator= ( const Shortcut & other)
default
Parameters
otherAlternatives copied into this value.
Returns
This owning shortcut; allocation failures propagate to the checked caller.

◆ operator=() [2/2]

Shortcut & portals::Shortcut::operator= ( Shortcut && other)
inlinenoexcept
Parameters
otherAlternatives exchanged with this value; both objects remain valid.
Returns
This owning shortcut without allocating or invoking a vector move.

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