mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
Namespace all wpilibc functions/classes into "frc" namespace. (#311)
Base.h provides a backwards compatibility shim (enabled unless NAMESPACED_WPILIB is defined) that does a "using namespace frc". However, as some header files do not include Base.h, this may be a breaking change in some corner cases (with an easy fix). Fixes #218.
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "Buttons/Button.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
/**
|
||||
* Specifies the command to run when a button is first pressed.
|
||||
*
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "Commands/Scheduler.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
ButtonScheduler::ButtonScheduler(bool last, Trigger* button, Command* orders)
|
||||
: m_pressedLast(last), m_button(button), m_command(orders) {}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "Buttons/Button.h"
|
||||
#include "Commands/Command.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
CancelButtonScheduler::CancelButtonScheduler(bool last, Trigger* button,
|
||||
Command* orders)
|
||||
: ButtonScheduler(last, button, orders) {
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "Buttons/Button.h"
|
||||
#include "Commands/Command.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
HeldButtonScheduler::HeldButtonScheduler(bool last, Trigger* button,
|
||||
Command* orders)
|
||||
: ButtonScheduler(last, button, orders) {}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "Buttons/InternalButton.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
InternalButton::InternalButton(bool inverted)
|
||||
: m_pressed(inverted), m_inverted(inverted) {}
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "Buttons/JoystickButton.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
JoystickButton::JoystickButton(GenericHID* joystick, int buttonNumber)
|
||||
: m_joystick(joystick), m_buttonNumber(buttonNumber) {}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "networktables/NetworkTable.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
NetworkButton::NetworkButton(const std::string& tableName,
|
||||
const std::string& field)
|
||||
: // TODO how is this supposed to work???
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "Buttons/Button.h"
|
||||
#include "Commands/Command.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
PressedButtonScheduler::PressedButtonScheduler(bool last, Trigger* button,
|
||||
Command* orders)
|
||||
: ButtonScheduler(last, button, orders) {}
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "Buttons/Button.h"
|
||||
#include "Commands/Command.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
ReleasedButtonScheduler::ReleasedButtonScheduler(bool last, Trigger* button,
|
||||
Command* orders)
|
||||
: ButtonScheduler(last, button, orders) {}
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "Buttons/Button.h"
|
||||
#include "Commands/Command.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
ToggleButtonScheduler::ToggleButtonScheduler(bool last, Trigger* button,
|
||||
Command* orders)
|
||||
: ButtonScheduler(last, button, orders) {
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "Buttons/ReleasedButtonScheduler.h"
|
||||
#include "Buttons/ToggleButtonScheduler.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
bool Trigger::Grab() {
|
||||
if (Get()) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user