mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
A lot of these are breaking changes. frc::Timer was replaced with the contents of frc2::Timer. The others were in-place argument changes or removing deprecated non-unit overloads.
33 lines
772 B
C++
33 lines
772 B
C++
// Copyright (c) FIRST and other WPILib contributors.
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
#pragma once
|
|
|
|
#include <units/time.h>
|
|
|
|
namespace frc2 {
|
|
/**
|
|
* Class that holds scheduling state for a command. Used internally by the
|
|
* CommandScheduler
|
|
*/
|
|
class CommandState final {
|
|
public:
|
|
CommandState() = default;
|
|
|
|
explicit CommandState(bool interruptible);
|
|
|
|
bool IsInterruptible() const { return m_interruptible; }
|
|
|
|
// The time since this command was initialized.
|
|
units::second_t TimeSinceInitialized() const;
|
|
|
|
private:
|
|
units::second_t m_startTime = -1_s;
|
|
bool m_interruptible;
|
|
|
|
void StartTiming();
|
|
void StartRunning();
|
|
};
|
|
} // namespace frc2
|