mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +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:
@@ -10,6 +10,8 @@
|
||||
#include "Buttons/Trigger.h"
|
||||
#include "Commands/Command.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
/**
|
||||
* This class provides an easy way to link commands to OI inputs.
|
||||
*
|
||||
@@ -30,3 +32,5 @@ class Button : public Trigger {
|
||||
virtual void CancelWhenPressed(Command* command);
|
||||
virtual void ToggleWhenPressed(Command* command);
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace frc {
|
||||
|
||||
class Trigger;
|
||||
class Command;
|
||||
|
||||
@@ -22,3 +24,5 @@ class ButtonScheduler {
|
||||
Trigger* m_button;
|
||||
Command* m_command;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "Buttons/ButtonScheduler.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class Trigger;
|
||||
class Command;
|
||||
|
||||
@@ -21,3 +23,5 @@ class CancelButtonScheduler : public ButtonScheduler {
|
||||
private:
|
||||
bool pressedLast;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "Buttons/ButtonScheduler.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class Trigger;
|
||||
class Command;
|
||||
|
||||
@@ -18,3 +20,5 @@ class HeldButtonScheduler : public ButtonScheduler {
|
||||
virtual ~HeldButtonScheduler() = default;
|
||||
virtual void Execute();
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "Buttons/Button.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class InternalButton : public Button {
|
||||
public:
|
||||
InternalButton() = default;
|
||||
@@ -24,3 +26,5 @@ class InternalButton : public Button {
|
||||
bool m_pressed = false;
|
||||
bool m_inverted = false;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "Buttons/Button.h"
|
||||
#include "GenericHID.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class JoystickButton : public Button {
|
||||
public:
|
||||
JoystickButton(GenericHID* joystick, int buttonNumber);
|
||||
@@ -21,3 +23,5 @@ class JoystickButton : public Button {
|
||||
GenericHID* m_joystick;
|
||||
int m_buttonNumber;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
#include "Buttons/Button.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class NetworkButton : public Button {
|
||||
public:
|
||||
NetworkButton(const std::string& tableName, const std::string& field);
|
||||
@@ -24,3 +26,5 @@ class NetworkButton : public Button {
|
||||
std::shared_ptr<ITable> m_netTable;
|
||||
std::string m_field;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "Buttons/ButtonScheduler.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class Trigger;
|
||||
class Command;
|
||||
|
||||
@@ -18,3 +20,5 @@ class PressedButtonScheduler : public ButtonScheduler {
|
||||
virtual ~PressedButtonScheduler() = default;
|
||||
virtual void Execute();
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "Buttons/ButtonScheduler.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class Trigger;
|
||||
class Command;
|
||||
|
||||
@@ -18,3 +20,5 @@ class ReleasedButtonScheduler : public ButtonScheduler {
|
||||
virtual ~ReleasedButtonScheduler() = default;
|
||||
virtual void Execute();
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "Buttons/ButtonScheduler.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class Trigger;
|
||||
class Command;
|
||||
|
||||
@@ -21,3 +23,5 @@ class ToggleButtonScheduler : public ButtonScheduler {
|
||||
private:
|
||||
bool pressedLast;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
#include "SmartDashboard/Sendable.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class Command;
|
||||
|
||||
/**
|
||||
@@ -48,3 +50,5 @@ class Trigger : public Sendable {
|
||||
protected:
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
Reference in New Issue
Block a user