From 8cd42478e1e44b63b9d9d759ac02dea95a5b37a7 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 26 Oct 2020 00:15:21 -0700 Subject: [PATCH] [wpilib] SendableBuilder: Make GetTable() visible --- .../native/include/frc/smartdashboard/SendableBuilder.h | 9 ++++++++- .../include/frc/smartdashboard/SendableBuilderImpl.h | 2 +- .../first/wpilibj/smartdashboard/SendableBuilder.java | 9 ++++++++- .../wpilibj/smartdashboard/SendableBuilderImpl.java | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilder.h b/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilder.h index 3f5f8928fe..666d31efaa 100644 --- a/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilder.h +++ b/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilder.h @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */ +/* Copyright (c) 2017-2020 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -24,6 +25,12 @@ class SendableBuilder { public: virtual ~SendableBuilder() = default; + /** + * Get the network table. + * @return The network table + */ + virtual std::shared_ptr GetTable() = 0; + /** * Set the string representation of the named data type that will be used * by the smart dashboard for this sendable. diff --git a/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilderImpl.h b/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilderImpl.h index e5dea44b0b..25d438311c 100644 --- a/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilderImpl.h +++ b/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilderImpl.h @@ -43,7 +43,7 @@ class SendableBuilderImpl : public SendableBuilder { * Get the network table. * @return The network table */ - std::shared_ptr GetTable(); + std::shared_ptr GetTable() override; /** * Return whether this sendable has an associated table. diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilder.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilder.java index 35a8b54449..b84694952c 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilder.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilder.java @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */ +/* Copyright (c) 2017-2020 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -13,10 +13,17 @@ import java.util.function.DoubleConsumer; import java.util.function.DoubleSupplier; import java.util.function.Supplier; +import edu.wpi.first.networktables.NetworkTable; import edu.wpi.first.networktables.NetworkTableEntry; import edu.wpi.first.networktables.NetworkTableValue; public interface SendableBuilder { + /** + * Get the network table. + * @return The network table + */ + NetworkTable getTable(); + /** * Set the string representation of the named data type that will be used * by the smart dashboard for this sendable. diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilderImpl.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilderImpl.java index a82f26bb00..c644959a49 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilderImpl.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilderImpl.java @@ -74,6 +74,7 @@ public class SendableBuilderImpl implements SendableBuilder { * * @return The network table */ + @Override public NetworkTable getTable() { return m_table; }