[wpilib] SendableChooser: implement Sendable instead of NTSendable (#5718)

This commit is contained in:
Gold856
2023-10-05 00:15:34 -04:00
committed by GitHub
parent a4030c670f
commit 6576d9b474
6 changed files with 12 additions and 56 deletions

View File

@@ -7,11 +7,8 @@
#include <atomic>
#include <string>
#include <networktables/IntegerTopic.h>
#include <networktables/NTSendable.h>
#include <networktables/StringTopic.h>
#include <wpi/SmallVector.h>
#include <wpi/mutex.h>
#include <wpi/sendable/Sendable.h>
#include <wpi/sendable/SendableHelper.h>
namespace frc {
@@ -22,7 +19,7 @@ namespace frc {
* It contains static, non-templated variables to avoid their duplication in the
* template class.
*/
class SendableChooserBase : public nt::NTSendable,
class SendableChooserBase : public wpi::Sendable,
public wpi::SendableHelper<SendableChooserBase> {
public:
SendableChooserBase();
@@ -41,8 +38,6 @@ class SendableChooserBase : public nt::NTSendable,
std::string m_defaultChoice;
std::string m_selected;
bool m_haveSelected = false;
wpi::SmallVector<nt::IntegerPublisher, 2> m_instancePubs;
wpi::SmallVector<nt::StringPublisher, 2> m_activePubs;
wpi::mutex m_mutex;
int m_instance;
std::string m_previousVal;