WPILibC++  2019.2.1-26-ge8b2471
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
TimedCommand.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2016-2018 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 <wpi/Twine.h>
11 
12 #include "frc/commands/Command.h"
13 
14 namespace frc {
15 
21 class TimedCommand : public Command {
22  public:
29  TimedCommand(const wpi::Twine& name, double timeout);
30 
36  explicit TimedCommand(double timeout);
37 
45  TimedCommand(const wpi::Twine& name, double timeout, Subsystem& subsystem);
46 
53  TimedCommand(double timeout, Subsystem& subsystem);
54 
55  virtual ~TimedCommand() = default;
56 
57  TimedCommand(TimedCommand&&) = default;
58  TimedCommand& operator=(TimedCommand&&) = default;
59 
60  protected:
64  bool IsFinished() override;
65 };
66 
67 } // namespace frc
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Definition: Subsystem.h:23
A TimedCommand will wait for a timeout before finishing.
Definition: TimedCommand.h:21
bool IsFinished() override
Ends command when timed out.
TimedCommand(const wpi::Twine &name, double timeout)
Creates a new TimedCommand with the given name and timeout.
The Command class is at the very core of the entire command framework.
Definition: Command.h:48
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:79