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 
13  public:
14  virtual ~RobotStateInterface() = default;
15  virtual bool IsDisabled() const = 0;
16  virtual bool IsEnabled() const = 0;
17  virtual bool IsOperatorControl() const = 0;
18  virtual bool IsAutonomous() const = 0;
19  virtual bool IsTest() const = 0;
20 };
21 
22 class RobotState {
23  private:
24  static std::shared_ptr<RobotStateInterface> impl;
25 
26  public:
27  static void SetImplementation(RobotStateInterface& i);
28  static void SetImplementation(std::shared_ptr<RobotStateInterface> i);
29  static bool IsDisabled();
30  static bool IsEnabled();
31  static bool IsOperatorControl();
32  static bool IsAutonomous();
33  static bool IsTest();
34 };
Definition: RobotState.h:22
Definition: RobotState.h:12