blob: b04616dcaec75bd50b62ea093806604724b958d5 [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;
34 Command *m_defaultCommand;
35 std::string m_name;
36 bool m_initializedDefaultCommand;
37
38public:
39 virtual std::string GetName();
40 virtual void InitTable(ITable* table);
41 virtual ITable* GetTable();
42 virtual std::string GetSmartDashboardType();
43protected:
44 ITable* m_table;
45};
46
47#endif