Now you can download a copy of these docs so you can use them offline! Download now
InternalButton.cpp
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 #include "Buttons/InternalButton.h" 00008 00009 InternalButton::InternalButton() : 00010 m_pressed(false), 00011 m_inverted(false) 00012 { 00013 } 00014 00015 InternalButton::InternalButton(bool inverted) : 00016 m_pressed(inverted), 00017 m_inverted(inverted) 00018 { 00019 } 00020 00021 void InternalButton::SetInverted(bool inverted) 00022 { 00023 m_inverted = inverted; 00024 } 00025 00026 void InternalButton::SetPressed(bool pressed) 00027 { 00028 m_pressed = pressed; 00029 } 00030 00031 bool InternalButton::Get() 00032 { 00033 return m_pressed ^ m_inverted; 00034 }
Generated on Thu Jan 12 2012 22:35:20 for WPILibC++ by
1.7.1