mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[commands] Add withDeadline modifier (#7299)
Co-authored-by: Ryan Blue <ryanzblue@gmail.com>
This commit is contained in:
@@ -182,6 +182,16 @@ class CommandPtr final {
|
||||
[[nodiscard]]
|
||||
CommandPtr OnlyIf(std::function<bool()> condition) &&;
|
||||
|
||||
/**
|
||||
* Creates a new command that runs this command and the deadline in parallel,
|
||||
* finishing (and interrupting this command) when the deadline finishes.
|
||||
*
|
||||
* @param deadline the deadline of the command group
|
||||
* @return the decorated command
|
||||
* @see DeadlineFor
|
||||
*/
|
||||
CommandPtr WithDeadline(CommandPtr&& deadline) &&;
|
||||
|
||||
/**
|
||||
* Decorates this command with a set of commands to run parallel to it, ending
|
||||
* when the calling command ends and interrupting all the others. Often more
|
||||
|
||||
Reference in New Issue
Block a user