mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
SendableChooser: Rename addDefault and addObject for clarity (#1239)
Rename addDefault to setDefaultOption and addObject to addOption. The old names are still available but are marked as deprecated.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <wpi/StringMap.h>
|
||||
#include <wpi/StringRef.h>
|
||||
#include <wpi/deprecated.h>
|
||||
|
||||
#include "frc/smartdashboard/SendableBuilder.h"
|
||||
#include "frc/smartdashboard/SendableChooserBase.h"
|
||||
@@ -46,8 +47,16 @@ class SendableChooser : public SendableChooserBase {
|
||||
public:
|
||||
~SendableChooser() override = default;
|
||||
|
||||
void AddObject(wpi::StringRef name, T object);
|
||||
void AddDefault(wpi::StringRef name, T object);
|
||||
void AddOption(wpi::StringRef name, T object);
|
||||
void SetDefaultOption(wpi::StringRef name, T object);
|
||||
|
||||
WPI_DEPRECATED("use AddOption() instead")
|
||||
void AddObject(wpi::StringRef name, T object) { AddOption(name, object); }
|
||||
|
||||
WPI_DEPRECATED("use SetDefaultOption() instead")
|
||||
void AddDefault(wpi::StringRef name, T object) {
|
||||
SetDefaultOption(name, object);
|
||||
}
|
||||
|
||||
auto GetSelected() -> decltype(_unwrap_smart_ptr(m_choices[""]));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user