11 #include <initializer_list>
13 #include <wpi/ArrayRef.h>
15 #include "frc2/command/CommandBase.h"
16 #include "frc2/command/CommandHelper.h"
36 StartEndCommand(std::function<
void()> onInit, std::function<
void()> onEnd,
37 std::initializer_list<Subsystem*> requirements);
47 StartEndCommand(std::function<
void()> onInit, std::function<
void()> onEnd,
56 void End(
bool interrupted)
override;
59 std::function<void()> m_onInit;
60 std::function<void()> m_onEnd;
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:42
void Initialize() override
The initial subroutine of a command.
CRTP implementation to allow polymorphic decorator functions in Command.
Definition: CommandHelper.h:26
void End(bool interrupted) override
The action to take when the command ends.
A command that runs a given runnable when it is initalized, and another runnable when it ends.
Definition: StartEndCommand.h:26
StartEndCommand(std::function< void()> onInit, std::function< void()> onEnd, std::initializer_list< Subsystem * > requirements)
Creates a new StartEndCommand.