11 #include <initializer_list>
13 #include <wpi/ArrayRef.h>
15 #include "frc2/command/CommandBase.h"
16 #include "frc2/command/CommandHelper.h"
39 std::function<
void()> onExecute,
40 std::function<
void(
bool)> onEnd,
41 std::function<
bool()> isFinished,
42 std::initializer_list<Subsystem*> requirements);
55 std::function<
void()> onExecute,
56 std::function<
void(
bool)> onEnd,
57 std::function<
bool()> isFinished,
68 void End(
bool interrupted)
override;
73 std::function<void()> m_onInit;
74 std::function<void()> m_onExecute;
75 std::function<void(
bool)> m_onEnd;
76 std::function<bool()> m_isFinished;
void Initialize() override
The initial subroutine of a command.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:42
bool IsFinished() override
Whether the command has finished.
void Execute() override
The main body of a command.
void End(bool interrupted) override
The action to take when the command ends.
CRTP implementation to allow polymorphic decorator functions in Command.
Definition: CommandHelper.h:26
A command that allows the user to pass in functions for each of the basic command methods through the...
Definition: FunctionalCommand.h:26
FunctionalCommand(std::function< void()> onInit, std::function< void()> onExecute, std::function< void(bool)> onEnd, std::function< bool()> isFinished, std::initializer_list< Subsystem * > requirements)
Creates a new FunctionalCommand.