blob: 9ef4f76331d84b4d4488fbe8ac07e5a732b93ca2 [file] [log] [blame]
jerrymf1579332013-02-07 01:56:28 +00001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2011. 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 $(WIND_BASE)/WPILib. */
5/*----------------------------------------------------------------------------*/
6
7#ifndef __SUBSYSTEM_H__
8#define __SUBSYSTEM_H__
9
10#include "ErrorBase.h"
11#include "SmartDashboard/NamedSendable.h"
12#include <string>
13
14
15class Command;
16
17class Subsystem : public ErrorBase, public NamedSendable
18{
19 friend class Scheduler;
20public:
21 Subsystem(const char *name);
22 virtual ~Subsystem() {}
23
24 void SetDefaultCommand(Command *command);
25 Command *GetDefaultCommand();
26 void SetCurrentCommand(Command *command);
27 Command *GetCurrentCommand();
28 virtual void InitDefaultCommand();
29
30private:
31 void ConfirmCommand();
32
33 Command *m_currentCommand;
jerrym42dedc02013-02-25 01:59:14 +000034 bool m_currentCommandChanged;
jerrymf1579332013-02-07 01:56:28 +000035 Command *m_defaultCommand;
36 std::string m_name;
37 bool m_initializedDefaultCommand;
38
39public:
40 virtual std::string GetName();
41 virtual void InitTable(ITable* table);
42 virtual ITable* GetTable();
43 virtual std::string GetSmartDashboardType();
44protected:
45 ITable* m_table;
46};
47
48#endif