[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

@@ -219,6 +219,12 @@ CommandPtr CommandPtr::HandleInterrupt(std::function<void(void)> handler) && {
});
}
CommandPtr CommandPtr::WithName(std::string_view name) && {
AssertValid();
m_ptr->SetName(name);
return std::move(*this);
}
CommandBase* CommandPtr::get() const {
AssertValid();
return m_ptr.get();