WPILib 2012
WPILibRoboticsLibraryforFRC
Buttons/Button.h
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 __BUTTON_H__
00008 #define __BUTTON_H__
00009 
00010 #include "SmartDashboard/SmartDashboardData.h"
00011 
00012 class Command;
00013 
00014 class Button : public SmartDashboardData
00015 {
00016 public:
00017         Button();
00018         virtual ~Button() {}
00019         bool Grab();
00020         virtual bool Get() = 0;
00021         void WhenPressed(Command *command);
00022         void WhileHeld(Command *command);
00023         void WhenReleased(Command *command);
00024 
00025         virtual std::string GetType() {return "Button";}
00026         virtual NetworkTable *GetTable();
00027 
00028 protected:
00029         NetworkTable* m_table;
00030 };
00031 
00032 #endif
 All Classes Functions Variables