WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
RobotState.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2008-2016. 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 <memory>
11 
12 namespace frc {
13 
15  public:
16  virtual ~RobotStateInterface() = default;
17  virtual bool IsDisabled() const = 0;
18  virtual bool IsEnabled() const = 0;
19  virtual bool IsOperatorControl() const = 0;
20  virtual bool IsAutonomous() const = 0;
21  virtual bool IsTest() const = 0;
22 };
23 
24 class RobotState {
25  private:
26  static std::shared_ptr<RobotStateInterface> impl;
27 
28  public:
29  static void SetImplementation(RobotStateInterface& i);
30  static void SetImplementation(std::shared_ptr<RobotStateInterface> i);
31  static bool IsDisabled();
32  static bool IsEnabled();
33  static bool IsOperatorControl();
34  static bool IsAutonomous();
35  static bool IsTest();
36 };
37 
38 } // namespace frc
Definition: RobotState.h:14
Definition: RobotState.h:24