52 m_defaultValue{defaultValue.begin(), defaultValue.end()} {}
61 return Get(m_defaultValue);
72 return ::wpi::nt::GetStringArray(
m_subHandle, defaultValue);
95 return ::wpi::nt::GetAtomicStringArray(
m_subHandle, defaultValue);
109 return ::wpi::nt::ReadQueueStringArray(
m_subHandle);
303 std::string_view typeString,
ParamType defaultValue,
Publisher(const Publisher &)=delete
NT_Publisher m_pubHandle
NetworkTables handle.
Definition Topic.hpp:443
NetworkTables StringArray entry.
Definition StringArrayTopic.hpp:179
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition StringArrayTopic.hpp:214
StringArrayTopic TopicType
Definition StringArrayTopic.hpp:183
std::vector< std::string > ValueType
Definition StringArrayTopic.hpp:184
StringArrayEntry()=default
TopicType GetTopic() const
Get the corresponding topic.
Definition StringArrayTopic.hpp:422
TimestampedStringArray TimestampedValueType
Definition StringArrayTopic.hpp:187
std::span< const std::string > ParamType
Definition StringArrayTopic.hpp:185
void Unpublish()
Stops publishing the entry if it's published.
Definition StringArrayTopic.hpp:226
StringArraySubscriber SubscriberType
Definition StringArrayTopic.hpp:181
StringArrayPublisher PublisherType
Definition StringArrayTopic.hpp:182
StringArrayEntry(NT_Entry handle, ParamType defaultValue)
Construct from an entry handle; recommended to use StringArrayTopic::GetEntry() instead.
Definition StringArrayTopic.hpp:198
NetworkTables StringArray publisher.
Definition StringArrayTopic.hpp:126
TimestampedStringArray TimestampedValueType
Definition StringArrayTopic.hpp:132
TopicType GetTopic() const
Get the corresponding topic.
Definition StringArrayTopic.hpp:418
void SetDefault(ParamType value)
Publish a default value.
Definition StringArrayTopic.hpp:161
std::span< const std::string > ParamType
Definition StringArrayTopic.hpp:130
StringArrayPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use StringArrayTopic::Publish() instead.
Definition StringArrayTopic.hpp:142
StringArrayPublisher()=default
std::vector< std::string > ValueType
Definition StringArrayTopic.hpp:129
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition StringArrayTopic.hpp:150
StringArrayTopic TopicType
Definition StringArrayTopic.hpp:128
NetworkTables StringArray subscriber.
Definition StringArrayTopic.hpp:33
TopicType GetTopic() const
Get the corresponding topic.
Definition StringArrayTopic.hpp:414
std::span< const std::string > ParamType
Definition StringArrayTopic.hpp:37
TimestampedStringArray TimestampedValueType
Definition StringArrayTopic.hpp:38
ValueType Get(ParamType defaultValue) const
Get the last published value.
Definition StringArrayTopic.hpp:71
TimestampedValueType GetAtomic(ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition StringArrayTopic.hpp:94
StringArraySubscriber(NT_Subscriber handle, ParamType defaultValue)
Construct from a subscriber handle; recommended to use StringArrayTopic::Subscribe() instead.
Definition StringArrayTopic.hpp:50
StringArrayTopic TopicType
Definition StringArrayTopic.hpp:35
StringArraySubscriber()=default
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition StringArrayTopic.hpp:108
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition StringArrayTopic.hpp:82
std::vector< std::string > ValueType
Definition StringArrayTopic.hpp:36
ValueType Get() const
Get the last published value.
Definition StringArrayTopic.hpp:60
NetworkTables StringArray topic.
Definition StringArrayTopic.hpp:234
StringArrayTopic(Topic topic)
Construct from a generic topic.
Definition StringArrayTopic.hpp:260
StringArrayEntry EntryType
Definition StringArrayTopic.hpp:238
StringArraySubscriber SubscriberType
Definition StringArrayTopic.hpp:236
PublisherType PublishEx(std::string_view typeString, const wpi::util::json &properties, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new publisher to the topic, with type string and initial properties.
Definition StringArrayTopic.hpp:350
PublisherType Publish(const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new publisher to the topic.
Definition StringArrayTopic.hpp:326
SubscriberType SubscribeEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new subscriber to the topic, with specific type string.
Definition StringArrayTopic.hpp:302
EntryType GetEntry(ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new entry for the topic.
Definition StringArrayTopic.hpp:377
StringArrayTopic()=default
StringArrayPublisher PublisherType
Definition StringArrayTopic.hpp:237
std::vector< std::string > ValueType
Definition StringArrayTopic.hpp:239
TimestampedStringArray TimestampedValueType
Definition StringArrayTopic.hpp:241
SubscriberType Subscribe(ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new subscriber to the topic.
Definition StringArrayTopic.hpp:278
StringArrayTopic(NT_Topic handle)
Construct from a topic handle; recommended to use NetworkTableInstance::GetStringArrayTopic() instead...
Definition StringArrayTopic.hpp:253
static constexpr std::string_view TYPE_STRING
The default type string for this topic type.
Definition StringArrayTopic.hpp:243
std::span< const std::string > ParamType
Definition StringArrayTopic.hpp:240
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new entry for the topic, with specific type string.
Definition StringArrayTopic.hpp:405
Subscriber(const Subscriber &)=delete
NT_Subscriber m_subHandle
Definition Topic.hpp:388
NT_Topic m_handle
Definition Topic.hpp:319
Definition BooleanTopic.hpp:22
bool SetDefaultStringArray(NT_Handle pubentry, std::span< const std::string > defaultValue)
Publish a default value.
bool SetStringArray(NT_Handle pubentry, std::span< const std::string > value, int64_t time=0)
Publish a new value.
NT_Handle NT_Topic
Definition ntcore_c.h:42
NT_Handle NT_Subscriber
Definition ntcore_c.h:43
NT_Handle NT_Publisher
Definition ntcore_c.h:44
NT_Handle NT_Entry
Definition ntcore_c.h:37
@ NT_STRING_ARRAY
Definition ntcore_c.h:58
constexpr PubSubOptions DEFAULT_PUB_SUB_OPTIONS
Default publish/subscribe options.
Definition ntcore_cpp.hpp:388
Timestamped< std::vector< std::string > > TimestampedStringArray
Timestamped StringArray.
Definition ntcore_cpp_types.hpp:923
NT_Entry GetEntry(NT_Inst inst, std::string_view name)
Get Entry Handle.
NT_Topic GetTopicFromHandle(NT_Handle pubsubentry)
Gets the topic handle from an entry/subscriber/publisher handle.
NT_Subscriber Subscribe(NT_Topic topic, NT_Type type, std::string_view typeStr, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Creates a new subscriber to value changes on a topic.
void Unpublish(NT_Handle pubentry)
Stops publisher.
NT_Publisher PublishEx(NT_Topic topic, NT_Type type, std::string_view typeStr, const wpi::util::json &properties, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Creates a new publisher to a topic.
NT_Publisher Publish(NT_Topic topic, NT_Type type, std::string_view typeStr, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Creates a new publisher to a topic.
NetworkTables (ntcore) namespace.
Definition NTSendable.hpp:9
Definition raw_os_ostream.hpp:19
NetworkTables publish/subscribe options.
Definition ntcore_cpp.hpp:303