mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[commands] Add convenience factories (#4460)
Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user