WPILibC++ 2024.3.2
PrintCommand.h
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 <string_view>
8
11
12namespace frc2 {
13/**
14 * A command that prints a string when initialized.
15 *
16 * This class is provided by the NewCommands VendorDep
17 */
18class PrintCommand : public CommandHelper<InstantCommand, PrintCommand> {
19 public:
20 /**
21 * Creates a new a PrintCommand.
22 *
23 * @param message the message to print
24 */
25 explicit PrintCommand(std::string_view message);
26
27 PrintCommand(PrintCommand&& other) = default;
28
29 PrintCommand(const PrintCommand& other) = default;
30
31 bool RunsWhenDisabled() const override;
32};
33} // namespace frc2
CRTP implementation to allow polymorphic decorator functions in Command.
Definition: CommandHelper.h:27
A command that prints a string when initialized.
Definition: PrintCommand.h:18
PrintCommand(PrintCommand &&other)=default
PrintCommand(const PrintCommand &other)=default
PrintCommand(std::string_view message)
Creates a new a PrintCommand.
bool RunsWhenDisabled() const override
basic_string_view< char > string_view
Definition: core.h:501
Definition: TrapezoidProfileSubsystem.h:12