WPILibC++  2020.3.2
CommandState.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 namespace frc2 {
15 class CommandState final {
16  public:
17  CommandState() = default;
18 
19  explicit CommandState(bool interruptible);
20 
21  bool IsInterruptible() const { return m_interruptible; }
22 
23  // The time since this command was initialized.
24  double TimeSinceInitialized() const;
25 
26  private:
27  double m_startTime = -1;
28  bool m_interruptible;
29 
30  void StartTiming();
31  void StartRunning();
32 };
33 } // namespace frc2
frc2::CommandState
Class that holds scheduling state for a command.
Definition: CommandState.h:15