jerrym | f157933 | 2013-02-07 01:56:28 +0000 | [diff] [blame^] | 1 | /*----------------------------------------------------------------------------*/
|
| 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 |
|
| 15 | class Command;
|
| 16 |
|
| 17 | class Subsystem : public ErrorBase, public NamedSendable
|
| 18 | {
|
| 19 | friend class Scheduler;
|
| 20 | public:
|
| 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 |
|
| 30 | private:
|
| 31 | void ConfirmCommand();
|
| 32 |
|
| 33 | Command *m_currentCommand;
|
| 34 | Command *m_defaultCommand;
|
| 35 | std::string m_name;
|
| 36 | bool m_initializedDefaultCommand;
|
| 37 |
|
| 38 | public:
|
| 39 | virtual std::string GetName();
|
| 40 | virtual void InitTable(ITable* table);
|
| 41 | virtual ITable* GetTable();
|
| 42 | virtual std::string GetSmartDashboardType();
|
| 43 | protected:
|
| 44 | ITable* m_table;
|
| 45 | };
|
| 46 |
|
| 47 | #endif
|