[ntcore] Use json_fwd (#5881)

Also fix ProtobufEntry construction.
This commit is contained in:
Peter Johnson
2023-11-05 09:55:40 -08:00
committed by GitHub
parent e69a9efeba
commit 17c1bd5a83
3 changed files with 4 additions and 13 deletions

View File

@@ -14,6 +14,7 @@
#include <vector>
#include <wpi/SmallVector.h>
#include <wpi/json_fwd.h>
#include <wpi/mutex.h>
#include <wpi/protobuf/Protobuf.h>
@@ -21,10 +22,6 @@
#include "networktables/Topic.h"
#include "ntcore_cpp.h"
namespace wpi {
class json;
} // namespace wpi
namespace nt {
template <wpi::ProtobufSerializable T>
@@ -303,7 +300,7 @@ class ProtobufEntry final : public ProtobufSubscriber<T>,
*/
ProtobufEntry(NT_Entry handle, wpi::ProtobufMessage<T> msg, T defaultValue)
: ProtobufSubscriber<T>{handle, std::move(msg), std::move(defaultValue)},
ProtobufPublisher<T>{handle, {}} {}
ProtobufPublisher<T>{handle, wpi::ProtobufMessage<T>{}} {}
/**
* Determines if the native handle is valid.

View File

@@ -14,6 +14,7 @@
#include <vector>
#include <wpi/SmallVector.h>
#include <wpi/json_fwd.h>
#include <wpi/mutex.h>
#include <wpi/struct/Struct.h>
@@ -21,10 +22,6 @@
#include "networktables/Topic.h"
#include "ntcore_cpp.h"
namespace wpi {
class json;
} // namespace wpi
namespace nt {
template <wpi::StructSerializable T>

View File

@@ -14,16 +14,13 @@
#include <vector>
#include <wpi/SmallVector.h>
#include <wpi/json_fwd.h>
#include <wpi/struct/Struct.h>
#include "networktables/NetworkTableInstance.h"
#include "networktables/Topic.h"
#include "ntcore_cpp.h"
namespace wpi {
class json;
} // namespace wpi
namespace nt {
template <wpi::StructSerializable T>