[commands] Add convenience factories (#4460)

Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
This commit is contained in:
Eli Barnett
2022-11-28 10:41:25 -05:00
committed by GitHub
parent 42b6d4e3f7
commit 1a59737f40
31 changed files with 1240 additions and 1 deletions

View File

@@ -8,6 +8,7 @@
#include <initializer_list>
#include <memory>
#include <span>
#include <string>
#include <utility>
#include <vector>
@@ -219,6 +220,15 @@ class CommandPtr final {
*/
[[nodiscard]] CommandPtr HandleInterrupt(std::function<void()> handler) &&;
/**
* Decorates this Command with a name. Is an inline function for
* Command::SetName(std::string_view);
*
* @param name name
* @return the decorated Command
*/
[[nodiscard]] CommandPtr WithName(std::string_view name) &&;
/**
* Get a raw pointer to the held command.
*/