WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
ScheduleCommand.hpp
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <span>
8
11#include "wpi/util/SmallSet.hpp"
12
13namespace wpi::cmd {
14/**
15 * Schedules the given commands when this command is initialized. Useful for
16 * forking off from CommandGroups. Note that if run from a composition, the
17 * composition will not know about the status of the scheduled commands, and
18 * will treat this command as finishing instantly.
19 *
20 * This class is provided by the NewCommands VendorDep
21 */
22class ScheduleCommand : public CommandHelper<Command, ScheduleCommand> {
23 public:
24 /**
25 * Creates a new ScheduleCommand that schedules the given commands when
26 * initialized.
27 *
28 * @param toSchedule the commands to schedule
29 */
30 explicit ScheduleCommand(std::span<Command* const> toSchedule);
31
32 explicit ScheduleCommand(Command* toSchedule);
33
34 ScheduleCommand(ScheduleCommand&& other) = default;
35
36 ScheduleCommand(const ScheduleCommand& other) = default;
37
38 void Initialize() override;
39
40 bool IsFinished() override;
41
42 bool RunsWhenDisabled() const override;
43
44 private:
46};
47} // namespace wpi::cmd
This file defines the SmallSet class.
A state machine representing a complete action to be performed by the robot.
Definition Command.hpp:41
ScheduleCommand(ScheduleCommand &&other)=default
ScheduleCommand(const ScheduleCommand &other)=default
bool RunsWhenDisabled() const override
bool IsFinished() override
ScheduleCommand(std::span< Command *const > toSchedule)
Creates a new ScheduleCommand that schedules the given commands when initialized.
void Initialize() override
ScheduleCommand(Command *toSchedule)
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
Definition SmallSet.hpp:132
Definition CommandNiDsStadiaController.hpp:15