WPILibC++  2019.1.1-beta-1-5-g9a1af13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
MotorSafety.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-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 #define DEFAULT_SAFETY_EXPIRATION 0.1
11 
12 #include <wpi/raw_ostream.h>
13 
14 namespace frc {
15 
16 class MotorSafety {
17  public:
18  MotorSafety() = default;
19  MotorSafety(MotorSafety&&) = default;
20  MotorSafety& operator=(MotorSafety&&) = default;
21 
22  virtual void SetExpiration(double timeout) = 0;
23  virtual double GetExpiration() const = 0;
24  virtual bool IsAlive() const = 0;
25  virtual void StopMotor() = 0;
26  virtual void SetSafetyEnabled(bool enabled) = 0;
27  virtual bool IsSafetyEnabled() const = 0;
28  virtual void GetDescription(wpi::raw_ostream& desc) const = 0;
29 };
30 
31 } // namespace frc
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Definition: MotorSafety.h:16