WPILib 2012
WPILibRoboticsLibraryforFRC
|
00001 /*----------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2011. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*----------------------------------------------------------------------------*/ 00006 00007 #ifndef __SUBSYSTEM_H__ 00008 #define __SUBSYSTEM_H__ 00009 00010 #include "ErrorBase.h" 00011 #include "SmartDashboard/SmartDashboardNamedData.h" 00012 #include <string> 00013 00014 class NetworkTable; 00015 class Command; 00016 00017 class Subsystem : public SmartDashboardNamedData, public ErrorBase 00018 { 00019 friend class Scheduler; 00020 public: 00021 Subsystem(const char *name); 00022 virtual ~Subsystem() {} 00023 00024 virtual std::string GetName(); 00025 virtual std::string GetType(); 00026 virtual NetworkTable *GetTable(); 00027 00028 void SetDefaultCommand(Command *command); 00029 Command *GetDefaultCommand(); 00030 void SetCurrentCommand(Command *command); 00031 Command *GetCurrentCommand(); 00032 virtual void InitDefaultCommand(); 00033 00034 private: 00035 void ConfirmCommand(); 00036 00037 NetworkTable *m_table; 00038 Command *m_currentCommand; 00039 Command *m_defaultCommand; 00040 std::string m_name; 00041 bool m_initializedDefaultCommand; 00042 }; 00043 00044 #endif