9#pragma warning(disable : 4521)
33 :
public CommandHelper<CommandGroupBase, ParallelDeadlineGroup> {
46 std::vector<std::unique_ptr<Command>>&& commands);
57 template <
class T,
class... Types,
59 std::is_base_of_v<Command, std::remove_reference_t<T>>>,
61 std::is_base_of<Command, std::remove_reference_t<Types>>...>>>
63 SetDeadline(std::make_unique<std::remove_reference_t<T>>(
64 std::forward<T>(deadline)));
76 template <
class... Types,
78 std::is_base_of<Command, std::remove_reference_t<Types>>...>>>
80 std::vector<std::unique_ptr<Command>> foo;
81 ((void)foo.emplace_back(std::make_unique<std::remove_reference_t<Types>>(
82 std::forward<Types>(commands))),
91 void End(
bool interrupted) final;
104 void SetDeadline(
std::unique_ptr<
Command>&& deadline);
108 bool m_runWhenDisabled{
true};
111 bool m_finished{
true};
CRTP implementation to allow polymorphic decorator functions in Command.
Definition: CommandHelper.h:26
A state machine representing a complete action to be performed by the robot.
Definition: Command.h:47
InterruptionBehavior
An enum describing the command's behavior when another command with a shared requirement is scheduled...
Definition: Command.h:104
@ kCancelIncoming
This command continues, and the incoming command is not scheduled.
A command composition that runs a set of commands in parallel, ending only when a specific command (t...
Definition: ParallelDeadlineGroup.h:33
ParallelDeadlineGroup(T &&deadline, Types &&... commands)
Creates a new ParallelDeadlineGroup.
Definition: ParallelDeadlineGroup.h:62
ParallelDeadlineGroup(ParallelDeadlineGroup &)=delete
void Initialize() final
The initial subroutine of a command.
void AddCommands(Types &&... commands)
Definition: ParallelDeadlineGroup.h:79
bool IsFinished() final
Whether the command has finished.
void Execute() final
The main body of a command.
ParallelDeadlineGroup(ParallelDeadlineGroup &&other)=default
ParallelDeadlineGroup(std::unique_ptr< Command > &&deadline, std::vector< std::unique_ptr< Command > > &&commands)
Creates a new ParallelDeadlineGroup.
Command::InterruptionBehavior GetInterruptionBehavior() const override
How the command behaves when another command with a shared requirement is scheduled.
void InitSendable(wpi::SendableBuilder &builder) override
Initializes this Sendable object.
ParallelDeadlineGroup(const ParallelDeadlineGroup &)=delete
bool RunsWhenDisabled() const override
Whether the given command should run when the robot is disabled.
void End(bool interrupted) final
The action to take when the command ends.
typename std::enable_if< B, T >::type enable_if_t
Definition: core.h:298
Definition: InstantCommand.h:14
Definition: StdDeque.h:50
/file This file defines the SmallVector class.
Definition: AprilTagFieldLayout.h:18