56 m_defaultValue{defaultValue.begin(), defaultValue.end()} {}
65 return Get(m_defaultValue);
76 return ::wpi::nt::GetFloatArray(
m_subHandle, defaultValue);
87 return Get(buf, m_defaultValue);
122 return ::wpi::nt::GetAtomicFloatArray(
m_subHandle, defaultValue);
164 return ::wpi::nt::ReadQueueFloatArray(
m_subHandle);
364 std::string_view typeString,
ParamType defaultValue,
NetworkTables FloatArray entry.
Definition FloatArrayTopic.hpp:237
TimestampedFloatArray TimestampedValueType
Definition FloatArrayTopic.hpp:248
FloatArrayTopic TopicType
Definition FloatArrayTopic.hpp:241
void Unpublish()
Stops publishing the entry if it's published.
Definition FloatArrayTopic.hpp:287
FloatArrayPublisher PublisherType
Definition FloatArrayTopic.hpp:240
FloatArrayEntry()=default
std::span< const float > ParamType
Definition FloatArrayTopic.hpp:243
FloatArraySubscriber SubscriberType
Definition FloatArrayTopic.hpp:239
FloatArrayEntry(NT_Entry handle, ParamType defaultValue)
Construct from an entry handle; recommended to use FloatArrayTopic::GetEntry() instead.
Definition FloatArrayTopic.hpp:259
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition FloatArrayTopic.hpp:275
std::span< float > SmallRetType
Definition FloatArrayTopic.hpp:245
float SmallElemType
Definition FloatArrayTopic.hpp:246
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatArrayTopic.hpp:483
std::vector< float > ValueType
Definition FloatArrayTopic.hpp:242
NetworkTables FloatArray publisher.
Definition FloatArrayTopic.hpp:181
std::vector< float > ValueType
Definition FloatArrayTopic.hpp:184
std::span< const float > ParamType
Definition FloatArrayTopic.hpp:185
void SetDefault(ParamType value)
Publish a default value.
Definition FloatArrayTopic.hpp:219
FloatArrayTopic TopicType
Definition FloatArrayTopic.hpp:183
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatArrayTopic.hpp:479
FloatArrayPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use FloatArrayTopic::Publish() instead.
Definition FloatArrayTopic.hpp:200
TimestampedFloatArray TimestampedValueType
Definition FloatArrayTopic.hpp:190
FloatArrayPublisher()=default
std::span< float > SmallRetType
Definition FloatArrayTopic.hpp:187
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition FloatArrayTopic.hpp:208
float SmallElemType
Definition FloatArrayTopic.hpp:188
NetworkTables FloatArray subscriber.
Definition FloatArrayTopic.hpp:33
FloatArrayTopic TopicType
Definition FloatArrayTopic.hpp:35
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value.
Definition FloatArrayTopic.hpp:98
ValueType Get(ParamType defaultValue) const
Get the last published value.
Definition FloatArrayTopic.hpp:75
FloatArraySubscriber(NT_Subscriber handle, ParamType defaultValue)
Construct from a subscriber handle; recommended to use FloatArrayTopic::Subscribe() instead.
Definition FloatArrayTopic.hpp:54
TimestampedValueType GetAtomic(ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition FloatArrayTopic.hpp:121
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value.
Definition FloatArrayTopic.hpp:86
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition FloatArrayTopic.hpp:163
ValueType Get() const
Get the last published value.
Definition FloatArrayTopic.hpp:64
std::span< float > SmallRetType
Definition FloatArrayTopic.hpp:40
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition FloatArrayTopic.hpp:147
float SmallElemType
Definition FloatArrayTopic.hpp:41
std::vector< float > ValueType
Definition FloatArrayTopic.hpp:36
TimestampedFloatArray TimestampedValueType
Definition FloatArrayTopic.hpp:38
FloatArraySubscriber()=default
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatArrayTopic.hpp:475
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value along with its timestamp.
Definition FloatArrayTopic.hpp:133
std::span< const float > ParamType
Definition FloatArrayTopic.hpp:37
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition FloatArrayTopic.hpp:109
TimestampedFloatArrayView TimestampedValueViewType
Definition FloatArrayTopic.hpp:42
NetworkTables FloatArray topic.
Definition FloatArrayTopic.hpp:295
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 FloatArrayTopic.hpp:363
FloatArrayPublisher PublisherType
Definition FloatArrayTopic.hpp:298
PublisherType Publish(const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new publisher to the topic.
Definition FloatArrayTopic.hpp:387
FloatArrayEntry EntryType
Definition FloatArrayTopic.hpp:299
EntryType GetEntry(ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new entry for the topic.
Definition FloatArrayTopic.hpp:438
FloatArraySubscriber SubscriberType
Definition FloatArrayTopic.hpp:297
FloatArrayTopic(Topic topic)
Construct from a generic topic.
Definition FloatArrayTopic.hpp:321
FloatArrayTopic()=default
FloatArrayTopic(NT_Topic handle)
Construct from a topic handle; recommended to use NetworkTableInstance::GetFloatArrayTopic() instead.
Definition FloatArrayTopic.hpp:314
static constexpr std::string_view TYPE_STRING
The default type string for this topic type.
Definition FloatArrayTopic.hpp:304
TimestampedFloatArray TimestampedValueType
Definition FloatArrayTopic.hpp:302
std::vector< float > ValueType
Definition FloatArrayTopic.hpp:300
std::span< const float > ParamType
Definition FloatArrayTopic.hpp:301
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 FloatArrayTopic.hpp:411
SubscriberType Subscribe(ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new subscriber to the topic.
Definition FloatArrayTopic.hpp:339
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 FloatArrayTopic.hpp:466
Publisher(const Publisher &)=delete
NT_Publisher m_pubHandle
NetworkTables handle.
Definition Topic.hpp:443
Subscriber(const Subscriber &)=delete
NT_Subscriber m_subHandle
Definition Topic.hpp:388
NT_Topic m_handle
Definition Topic.hpp:319
Definition BooleanTopic.hpp:22
std::vector< float > GetFloatArray(NT_Handle subentry, std::span< const float > defaultValue)
Get the last published value.
TimestampedFloatArray GetAtomicFloatArray(NT_Handle subentry, std::span< const float > defaultValue)
Get the last published value along with its timestamp.
bool SetDefaultFloatArray(NT_Handle pubentry, std::span< const float > defaultValue)
Publish a default value.
bool SetFloatArray(NT_Handle pubentry, std::span< const float > 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_FLOAT_ARRAY
Definition ntcore_c.h:63
constexpr PubSubOptions DEFAULT_PUB_SUB_OPTIONS
Default publish/subscribe options.
Definition ntcore_cpp.hpp:388
Timestamped< std::vector< float > > TimestampedFloatArray
Timestamped FloatArray.
Definition ntcore_cpp_types.hpp:739
Timestamped< std::span< float > > TimestampedFloatArrayView
Timestamped FloatArray view (for wpi::util::SmallVector-taking functions).
Definition ntcore_cpp_types.hpp:745
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