From 17c1bd5a83094e0c1bc30075f401864f736e85fc Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 5 Nov 2023 09:55:40 -0800 Subject: [PATCH] [ntcore] Use json_fwd (#5881) Also fix ProtobufEntry construction. --- .../src/main/native/include/networktables/ProtobufTopic.h | 7 ++----- .../main/native/include/networktables/StructArrayTopic.h | 5 +---- ntcore/src/main/native/include/networktables/StructTopic.h | 5 +---- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/ntcore/src/main/native/include/networktables/ProtobufTopic.h b/ntcore/src/main/native/include/networktables/ProtobufTopic.h index 4c30bf7c4c..362d2cb5b5 100644 --- a/ntcore/src/main/native/include/networktables/ProtobufTopic.h +++ b/ntcore/src/main/native/include/networktables/ProtobufTopic.h @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -21,10 +22,6 @@ #include "networktables/Topic.h" #include "ntcore_cpp.h" -namespace wpi { -class json; -} // namespace wpi - namespace nt { template @@ -303,7 +300,7 @@ class ProtobufEntry final : public ProtobufSubscriber, */ ProtobufEntry(NT_Entry handle, wpi::ProtobufMessage msg, T defaultValue) : ProtobufSubscriber{handle, std::move(msg), std::move(defaultValue)}, - ProtobufPublisher{handle, {}} {} + ProtobufPublisher{handle, wpi::ProtobufMessage{}} {} /** * Determines if the native handle is valid. diff --git a/ntcore/src/main/native/include/networktables/StructArrayTopic.h b/ntcore/src/main/native/include/networktables/StructArrayTopic.h index 91f472147f..e27b8e462d 100644 --- a/ntcore/src/main/native/include/networktables/StructArrayTopic.h +++ b/ntcore/src/main/native/include/networktables/StructArrayTopic.h @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -21,10 +22,6 @@ #include "networktables/Topic.h" #include "ntcore_cpp.h" -namespace wpi { -class json; -} // namespace wpi - namespace nt { template diff --git a/ntcore/src/main/native/include/networktables/StructTopic.h b/ntcore/src/main/native/include/networktables/StructTopic.h index 88da9f39fc..619f94fa5a 100644 --- a/ntcore/src/main/native/include/networktables/StructTopic.h +++ b/ntcore/src/main/native/include/networktables/StructTopic.h @@ -14,16 +14,13 @@ #include #include +#include #include #include "networktables/NetworkTableInstance.h" #include "networktables/Topic.h" #include "ntcore_cpp.h" -namespace wpi { -class json; -} // namespace wpi - namespace nt { template