blob: ce48ca016e480e683c88ad4f906f544430650e9e [file] [log] [blame]
Brian Silverman26e4e522015-12-17 01:56:40 -05001/*----------------------------------------------------------------------------*/
Brian Silverman1a675112016-02-20 20:42:49 -05002/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */
Brian Silverman26e4e522015-12-17 01:56:40 -05003/* Open Source Software - may be modified and shared by FRC teams. The code */
Brian Silverman1a675112016-02-20 20:42:49 -05004/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
Brian Silverman26e4e522015-12-17 01:56:40 -05006/*----------------------------------------------------------------------------*/
Brian Silverman1a675112016-02-20 20:42:49 -05007
Brian Silverman26e4e522015-12-17 01:56:40 -05008#pragma once
9
10#include <memory>
11
12class RobotStateInterface {
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
22class 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};