mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[commands] Add FinallyDo and HandleInterrupt decorators (#4412)
This commit is contained in:
@@ -108,6 +108,16 @@ CommandPtr Command::Unless(std::function<bool()> condition) && {
|
||||
.Unless(std::move(condition));
|
||||
}
|
||||
|
||||
CommandPtr Command::FinallyDo(std::function<void(bool)> end) && {
|
||||
return CommandPtr(std::move(*this).TransferOwnership())
|
||||
.FinallyDo(std::move(end));
|
||||
}
|
||||
|
||||
CommandPtr Command::HandleInterrupt(std::function<void(void)> handler) && {
|
||||
return CommandPtr(std::move(*this).TransferOwnership())
|
||||
.HandleInterrupt(std::move(handler));
|
||||
}
|
||||
|
||||
void Command::Schedule() {
|
||||
CommandScheduler::GetInstance().Schedule(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user