mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[commands] Move GroupedCommands to CommandScheduler (#4728)
Move the command group checking functionality from CommandGroupBase into CommandScheduler. Update references to grouping as composition for clarity (because explicitly grouping isn't the only way to do it). Deprecate the static factory methods parallel, race, and deadline in CommandGroupBase in favor of the identical ones in Commands.
This commit is contained in:
@@ -302,9 +302,9 @@ safe) semantics.
|
||||
void Cancel();
|
||||
|
||||
/**
|
||||
* Whether or not the command is currently scheduled. Note that this does not
|
||||
* detect whether the command is being run by a CommandGroup, only whether it
|
||||
* is directly being run by the scheduler.
|
||||
* Whether or not the command is currently scheduled. Note that this does not
|
||||
* detect whether the command is in a composition, only whether it is directly
|
||||
* being run by the scheduler.
|
||||
*
|
||||
* @return Whether the command is scheduled.
|
||||
*/
|
||||
@@ -324,13 +324,32 @@ safe) semantics.
|
||||
* Whether the command is currently grouped in a command group. Used as extra
|
||||
* insurance to prevent accidental independent use of grouped commands.
|
||||
*/
|
||||
bool IsComposed() const;
|
||||
|
||||
/**
|
||||
* Sets whether the command is currently composed in a command composition.
|
||||
* Can be used to "reclaim" a command if a composition is no longer going to
|
||||
* use it. NOT ADVISED!
|
||||
*/
|
||||
void SetComposed(bool isComposed);
|
||||
|
||||
/**
|
||||
* Whether the command is currently grouped in a command group. Used as extra
|
||||
* insurance to prevent accidental independent use of grouped commands.
|
||||
*
|
||||
* @deprecated Moved to IsComposed()
|
||||
*/
|
||||
WPI_DEPRECATED("Moved to IsComposed()")
|
||||
bool IsGrouped() const;
|
||||
|
||||
/**
|
||||
* Sets whether the command is currently grouped in a command group. Can be
|
||||
* used to "reclaim" a command if a group is no longer going to use it. NOT
|
||||
* ADVISED!
|
||||
*
|
||||
* @deprecated Moved to SetComposed()
|
||||
*/
|
||||
WPI_DEPRECATED("Moved to SetComposed()")
|
||||
void SetGrouped(bool grouped);
|
||||
|
||||
/**
|
||||
@@ -379,7 +398,7 @@ safe) semantics.
|
||||
*/
|
||||
virtual std::unique_ptr<Command> TransferOwnership() && = 0;
|
||||
|
||||
bool m_isGrouped = false;
|
||||
bool m_isComposed = false;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user