Split Sendable into NT and non-NT portions (#3432)

The non-NT portion has been moved to wpiutil.
The NT portion has been moved to ntcore (as NTSendable).

SendableBuilder similarly split and moved.

SendableRegistry moved to wpiutil.

In C++, SendableHelper also moved to wpiutil.

This enables use of Sendable from wpimath and also enables
moving several classes from wpilib to wpimath.
This commit is contained in:
Peter Johnson
2021-06-13 16:38:05 -07:00
committed by GitHub
parent ef4ea84cb5
commit b417d961ec
196 changed files with 1147 additions and 891 deletions

View File

@@ -11,17 +11,16 @@
#include <utility>
#include <vector>
#include <networktables/NTSendableBuilder.h>
#include <networktables/NetworkTable.h>
#include <networktables/NetworkTableEntry.h>
#include <networktables/NetworkTableValue.h>
#include <wpi/SmallVector.h>
#include <wpi/span.h>
#include "frc/smartdashboard/SendableBuilder.h"
namespace frc {
class SendableBuilderImpl : public SendableBuilder {
class SendableBuilderImpl : public nt::NTSendableBuilder {
public:
SendableBuilderImpl() = default;
~SendableBuilderImpl() override = default;
@@ -46,7 +45,7 @@ class SendableBuilderImpl : public SendableBuilder {
* Return whether this sendable has an associated table.
* @return True if it has a table, false if not.
*/
bool HasTable() const;
bool IsPublished() const override;
/**
* Return whether this sendable should be treated as an actuator.
@@ -57,7 +56,7 @@ class SendableBuilderImpl : public SendableBuilder {
/**
* Update the network table values by calling the getters for all properties.
*/
void UpdateTable();
void Update() override;
/**
* Hook setters for all properties.
@@ -84,7 +83,7 @@ class SendableBuilderImpl : public SendableBuilder {
/**
* Clear properties.
*/
void ClearProperties();
void ClearProperties() override;
void SetSmartDashboardType(std::string_view type) override;
void SetActuator(bool value) override;