mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
Add dependency injection of Subsystem to Command (#1275)
This commit is contained in:
committed by
Peter Johnson
parent
6df500e726
commit
e28295fc7b
@@ -72,6 +72,13 @@ class Command : public ErrorBase, public SendableBase {
|
||||
*/
|
||||
explicit Command(double timeout);
|
||||
|
||||
/**
|
||||
* Creates a new command with the given timeout and a default name.
|
||||
*
|
||||
* @param requirement the subsystem that the command requires
|
||||
*/
|
||||
explicit Command(Subsystem& requirement);
|
||||
|
||||
/**
|
||||
* Creates a new command with the given name and timeout.
|
||||
*
|
||||
@@ -81,6 +88,33 @@ class Command : public ErrorBase, public SendableBase {
|
||||
*/
|
||||
Command(const wpi::Twine& name, double timeout);
|
||||
|
||||
/**
|
||||
* Creates a new command with the given name and timeout.
|
||||
*
|
||||
* @param name the name of the command
|
||||
* @param requirement the subsystem that the command requires
|
||||
*/
|
||||
Command(const wpi::Twine& name, Subsystem& requirement);
|
||||
|
||||
/**
|
||||
* Creates a new command with the given name and timeout.
|
||||
*
|
||||
* @param timeout the time (in seconds) before this command "times out"
|
||||
* @param requirement the subsystem that the command requires
|
||||
* @see IsTimedOut()
|
||||
*/
|
||||
Command(double timeout, Subsystem& requirement);
|
||||
|
||||
/**
|
||||
* Creates a new command with the given name and timeout.
|
||||
*
|
||||
* @param name the name of the command
|
||||
* @param timeout the time (in seconds) before this command "times out"
|
||||
* @param requirement the subsystem that the command requires
|
||||
* @see IsTimedOut()
|
||||
*/
|
||||
Command(const wpi::Twine& name, double timeout, Subsystem& requirement);
|
||||
|
||||
~Command() override = default;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user