[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

@@ -105,6 +105,11 @@ CommandPtr Command::HandleInterrupt(std::function<void(void)> handler) && {
return std::move(*this).ToPtr().HandleInterrupt(std::move(handler));
}
CommandPtr Command::WithName(std::string_view name) && {
SetName(name);
return std::move(*this).ToPtr();
}
void Command::Schedule() {
CommandScheduler::GetInstance().Schedule(this);
}
@@ -129,6 +134,8 @@ std::string Command::GetName() const {
return GetTypeName(*this);
}
void Command::SetName(std::string_view name) {}
bool Command::IsGrouped() const {
return m_isGrouped;
}