mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[command] Make cancel safe to call from initialize (#2440)
Fixes #2388.
This commit is contained in:
@@ -209,30 +209,36 @@ class CommandScheduler final : public frc::Sendable,
|
||||
Command* GetDefaultCommand(const Subsystem* subsystem) const;
|
||||
|
||||
/**
|
||||
* Cancels a command. The scheduler will only call the interrupted method of
|
||||
* a canceled command, not the end method (though the interrupted method may
|
||||
* itself call the end method). Commands will be canceled even if they are
|
||||
* not scheduled as interruptible.
|
||||
* Cancels commands. The scheduler will only call Command::End()
|
||||
* method of the canceled command with true, indicating they were
|
||||
* canceled (as opposed to finishing normally).
|
||||
*
|
||||
* @param command the command to cancel
|
||||
* <p>Commands will be canceled even if they are not scheduled as
|
||||
* interruptible.
|
||||
*
|
||||
* @param commands the commands to cancel
|
||||
*/
|
||||
void Cancel(Command* command);
|
||||
|
||||
/**
|
||||
* Cancels commands. The scheduler will only call the interrupted method of a
|
||||
* canceled command, not the end method (though the interrupted method may
|
||||
* itself call the end method). Commands will be canceled even if they are
|
||||
* not scheduled as interruptible.
|
||||
* Cancels commands. The scheduler will only call Command::End()
|
||||
* method of the canceled command with true, indicating they were
|
||||
* canceled (as opposed to finishing normally).
|
||||
*
|
||||
* <p>Commands will be canceled even if they are not scheduled as
|
||||
* interruptible.
|
||||
*
|
||||
* @param commands the commands to cancel
|
||||
*/
|
||||
void Cancel(wpi::ArrayRef<Command*> commands);
|
||||
|
||||
/**
|
||||
* Cancels commands. The scheduler will only call the interrupted method of a
|
||||
* canceled command, not the end method (though the interrupted method may
|
||||
* itself call the end method). Commands will be canceled even if they are
|
||||
* not scheduled as interruptible.
|
||||
* Cancels commands. The scheduler will only call Command::End()
|
||||
* method of the canceled command with true, indicating they were
|
||||
* canceled (as opposed to finishing normally).
|
||||
*
|
||||
* <p>Commands will be canceled even if they are not scheduled as
|
||||
* interruptible.
|
||||
*
|
||||
* @param commands the commands to cancel
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user