Move deprecated message in C++ from class level to constructor (#1505)

This prevents deprecation messages when including a header but not
instantiating the class. SampleRobot was addressed by #1503.
This commit is contained in:
Tyler Veness
2018-12-24 23:14:24 -08:00
committed by Peter Johnson
parent 799c3ea8a6
commit f3864e9abb
4 changed files with 10 additions and 8 deletions

View File

@@ -16,9 +16,9 @@ namespace frc {
/**
* Gamepad Interface.
*/
class WPI_DEPRECATED("Inherit directly from GenericHID instead.") GamepadBase
: public GenericHID {
class GamepadBase : public GenericHID {
public:
WPI_DEPRECATED("Inherit directly from GenericHID instead.")
explicit GamepadBase(int port);
virtual ~GamepadBase() = default;

View File

@@ -16,9 +16,9 @@ namespace frc {
/**
* Joystick Interface.
*/
class WPI_DEPRECATED("Inherit directly from GenericHID instead.") JoystickBase
: public GenericHID {
class JoystickBase : public GenericHID {
public:
WPI_DEPRECATED("Inherit directly from GenericHID instead.")
explicit JoystickBase(int port);
virtual ~JoystickBase() = default;

View File

@@ -19,9 +19,9 @@ namespace frc {
* Live Window Sendable is a special type of object sendable to the live window.
* @deprecated Use Sendable directly instead
*/
class WPI_DEPRECATED("use Sendable directly instead") LiveWindowSendable
: public Sendable {
class LiveWindowSendable : public Sendable {
public:
WPI_DEPRECATED("use Sendable directly instead")
LiveWindowSendable() = default;
LiveWindowSendable(LiveWindowSendable&&) = default;
LiveWindowSendable& operator=(LiveWindowSendable&&) = default;

View File

@@ -20,9 +20,11 @@ namespace frc {
* the Smart Dashboard.
* @deprecated Use Sendable directly instead
*/
class WPI_DEPRECATED("use Sendable directly instead") NamedSendable
: public Sendable {
class NamedSendable : public Sendable {
public:
WPI_DEPRECATED("use Sendable directly instead")
NamedSendable() = default;
void SetName(const wpi::Twine& name) override;
std::string GetSubsystem() const override;
void SetSubsystem(const wpi::Twine& subsystem) override;