Skip to content

Commit

Permalink
[ntcore] Use json_fwd
Browse files Browse the repository at this point in the history
Also fix ProtobufEntry construction.
  • Loading branch information
PeterJohnson committed Nov 5, 2023
1 parent 63dbf5c commit 167091c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
7 changes: 2 additions & 5 deletions ntcore/src/main/native/include/networktables/ProtobufTopic.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@
#include <vector>

#include <wpi/SmallVector.h>
#include <wpi/json_fwd.h>
#include <wpi/mutex.h>
#include <wpi/protobuf/Protobuf.h>

#include "networktables/NetworkTableInstance.h"
#include "networktables/Topic.h"
#include "ntcore_cpp.h"

namespace wpi {
class json;
} // namespace wpi

namespace nt {

template <wpi::ProtobufSerializable T>
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@
#include <vector>

#include <wpi/SmallVector.h>
#include <wpi/json_fwd.h>
#include <wpi/mutex.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>
Expand Down
5 changes: 1 addition & 4 deletions ntcore/src/main/native/include/networktables/StructTopic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 167091c

Please sign in to comment.