mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[commands] Remove EndlessCommand (#4483)
This commit is contained in:
@@ -200,19 +200,21 @@ class Command {
|
||||
* conditions. The decorated command can still be interrupted or canceled.
|
||||
*
|
||||
* @return the decorated command
|
||||
* @deprecated replace with EndlessCommand
|
||||
* @deprecated PerpetualCommand violates the assumption that execute() doesn't
|
||||
get called after isFinished() returns true -- an assumption that should be
|
||||
valid. This was unsafe/undefined behavior from the start, and RepeatCommand
|
||||
provides an easy way to achieve similar end results with slightly different (and
|
||||
safe) semantics.
|
||||
*/
|
||||
WPI_DEPRECATED("Replace with Endlessly()")
|
||||
WPI_DEPRECATED(
|
||||
"PerpetualCommand violates the assumption that execute() doesn't get "
|
||||
"called after isFinished() returns true -- an assumption that should be "
|
||||
"valid."
|
||||
"This was unsafe/undefined behavior from the start, and RepeatCommand "
|
||||
"provides an easy way to achieve similar end results with slightly "
|
||||
"different (and safe) semantics.")
|
||||
PerpetualCommand Perpetually() &&;
|
||||
|
||||
/**
|
||||
* Decorates this command to run endlessly, ignoring its ordinary end
|
||||
* conditions. The decorated command can still be interrupted or canceled.
|
||||
*
|
||||
* @return the decorated command
|
||||
*/
|
||||
[[nodiscard]] CommandPtr Endlessly() &&;
|
||||
|
||||
/**
|
||||
* Decorates this command to run repeatedly, restarting it when it ends, until
|
||||
* this command is interrupted. The decorated command can still be canceled.
|
||||
|
||||
Reference in New Issue
Block a user