mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[ntcore] Pass pub/sub options as a unified PubSubOptions struct (#4794)
In Java, PubSubOption is still used for passing options, but this simplifies C++ use substantially, as it allows aggregate construction.
This commit is contained in:
@@ -63,8 +63,7 @@ void bench() {
|
||||
// add "typical" set of subscribers on client and server
|
||||
nt::SubscribeMultiple(client, {{std::string_view{}}});
|
||||
nt::Subscribe(nt::GetTopic(client, "highrate"), NT_DOUBLE, "double",
|
||||
{{nt::PubSubOption::KeepDuplicates(true),
|
||||
nt::PubSubOption::SendAll(true)}});
|
||||
{.sendAll = true, .keepDuplicates = true});
|
||||
nt::SubscribeMultiple(server, {{std::string_view{}}});
|
||||
auto pub = nt::Publish(nt::GetTopic(server, "highrate"), NT_DOUBLE, "double");
|
||||
nt::SetDouble(pub, 0);
|
||||
|
||||
Reference in New Issue
Block a user