WPILibC++  2020.3.2-60-g3011ebe
CommandGroupBase.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2019 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <initializer_list>
11 #include <memory>
12 #include <vector>
13 
14 #include <wpi/ArrayRef.h>
15 
16 #include "frc2/command/CommandBase.h"
17 
18 namespace frc2 {
19 
25 class CommandGroupBase : public CommandBase {
26  public:
34  static bool RequireUngrouped(Command& command);
35 
43  static bool RequireUngrouped(wpi::ArrayRef<std::unique_ptr<Command>>);
44 
52  static bool RequireUngrouped(std::initializer_list<Command*>);
53 
59  virtual void AddCommands(
60  std::vector<std::unique_ptr<Command>>&& commands) = 0;
61 };
62 } // namespace frc2
frc2::CommandGroupBase::AddCommands
virtual void AddCommands(std::vector< std::unique_ptr< Command >> &&commands)=0
Adds the given commands to the command group.
wpi::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:42
frc2::CommandGroupBase::RequireUngrouped
static bool RequireUngrouped(Command &command)
Requires that the specified command not have been already allocated to a CommandGroup.
frc2::Command
A state machine representing a complete action to be performed by the robot.
Definition: Command.h:52
frc2::CommandGroupBase
A base for CommandGroups.
Definition: CommandGroupBase.h:25
frc2::CommandBase
A Sendable base class for Commands.
Definition: CommandBase.h:25