57 m_defaultValue{defaultValue.begin(), defaultValue.end()} {}
66 return Get(m_defaultValue);
77 return ::wpi::nt::GetFloatArray(
m_subHandle, defaultValue);
88 return Get(buf, m_defaultValue);
123 return ::wpi::nt::GetAtomicFloatArray(
m_subHandle, defaultValue);
165 return ::wpi::nt::ReadQueueFloatArray(
m_subHandle);
365 std::string_view typeString,
ParamType defaultValue,
NetworkTables FloatArray entry.
Definition FloatArrayTopic.hpp:238
TimestampedFloatArray TimestampedValueType
Definition FloatArrayTopic.hpp:249
FloatArrayTopic TopicType
Definition FloatArrayTopic.hpp:242
void Unpublish()
Stops publishing the entry if it's published.
Definition FloatArrayTopic.hpp:288
FloatArrayPublisher PublisherType
Definition FloatArrayTopic.hpp:241
FloatArrayEntry()=default
std::span< const float > ParamType
Definition FloatArrayTopic.hpp:244
FloatArraySubscriber SubscriberType
Definition FloatArrayTopic.hpp:240
FloatArrayEntry(NT_Entry handle, ParamType defaultValue)
Construct from an entry handle; recommended to use FloatArrayTopic::GetEntry() instead.
Definition FloatArrayTopic.hpp:260
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition FloatArrayTopic.hpp:276
std::span< float > SmallRetType
Definition FloatArrayTopic.hpp:246
float SmallElemType
Definition FloatArrayTopic.hpp:247
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatArrayTopic.hpp:484
std::vector< float > ValueType
Definition FloatArrayTopic.hpp:243
NetworkTables FloatArray publisher.
Definition FloatArrayTopic.hpp:182
std::vector< float > ValueType
Definition FloatArrayTopic.hpp:185
std::span< const float > ParamType
Definition FloatArrayTopic.hpp:186
void SetDefault(ParamType value)
Publish a default value.
Definition FloatArrayTopic.hpp:220
FloatArrayTopic TopicType
Definition FloatArrayTopic.hpp:184
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatArrayTopic.hpp:480
FloatArrayPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use FloatArrayTopic::Publish() instead.
Definition FloatArrayTopic.hpp:201
TimestampedFloatArray TimestampedValueType
Definition FloatArrayTopic.hpp:191
FloatArrayPublisher()=default
std::span< float > SmallRetType
Definition FloatArrayTopic.hpp:188
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition FloatArrayTopic.hpp:209
float SmallElemType
Definition FloatArrayTopic.hpp:189
NetworkTables FloatArray subscriber.
Definition FloatArrayTopic.hpp:34
FloatArrayTopic TopicType
Definition FloatArrayTopic.hpp:36
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value.
Definition FloatArrayTopic.hpp:99
ValueType Get(ParamType defaultValue) const
Get the last published value.
Definition FloatArrayTopic.hpp:76
FloatArraySubscriber(NT_Subscriber handle, ParamType defaultValue)
Construct from a subscriber handle; recommended to use FloatArrayTopic::Subscribe() instead.
Definition FloatArrayTopic.hpp:55
TimestampedValueType GetAtomic(ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition FloatArrayTopic.hpp:122
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value.
Definition FloatArrayTopic.hpp:87
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition FloatArrayTopic.hpp:164
ValueType Get() const
Get the last published value.
Definition FloatArrayTopic.hpp:65
std::span< float > SmallRetType
Definition FloatArrayTopic.hpp:41
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition FloatArrayTopic.hpp:148
float SmallElemType
Definition FloatArrayTopic.hpp:42
std::vector< float > ValueType
Definition FloatArrayTopic.hpp:37
TimestampedFloatArray TimestampedValueType
Definition FloatArrayTopic.hpp:39
FloatArraySubscriber()=default
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatArrayTopic.hpp:476
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value along with its timestamp.
Definition FloatArrayTopic.hpp:134
std::span< const float > ParamType
Definition FloatArrayTopic.hpp:38
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition FloatArrayTopic.hpp:110
TimestampedFloatArrayView TimestampedValueViewType
Definition FloatArrayTopic.hpp:43
NetworkTables FloatArray topic.
Definition FloatArrayTopic.hpp:296
SubscriberType Subscribe(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic.
Definition FloatArrayTopic.hpp:340
FloatArrayPublisher PublisherType
Definition FloatArrayTopic.hpp:299
SubscriberType SubscribeEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic, with specific type string.
Definition FloatArrayTopic.hpp:364
FloatArrayEntry EntryType
Definition FloatArrayTopic.hpp:300
PublisherType PublishEx(std::string_view typeString, const wpi::util::json &properties, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new publisher to the topic, with type string and initial properties.
Definition FloatArrayTopic.hpp:412
FloatArraySubscriber SubscriberType
Definition FloatArrayTopic.hpp:298
FloatArrayTopic(Topic topic)
Construct from a generic topic.
Definition FloatArrayTopic.hpp:322
FloatArrayTopic()=default
FloatArrayTopic(NT_Topic handle)
Construct from a topic handle; recommended to use NetworkTableInstance::GetFloatArrayTopic() instead.
Definition FloatArrayTopic.hpp:315
PublisherType Publish(const PubSubOptions &options=kDefaultPubSubOptions)
Create a new publisher to the topic.
Definition FloatArrayTopic.hpp:388
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic, with specific type string.
Definition FloatArrayTopic.hpp:467
static constexpr std::string_view kTypeString
The default type string for this topic type.
Definition FloatArrayTopic.hpp:305
EntryType GetEntry(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic.
Definition FloatArrayTopic.hpp:439
TimestampedFloatArray TimestampedValueType
Definition FloatArrayTopic.hpp:303
std::vector< float > ValueType
Definition FloatArrayTopic.hpp:301
std::span< const float > ParamType
Definition FloatArrayTopic.hpp:302
Publisher(const Publisher &)=delete
NT_Publisher m_pubHandle
NetworkTables handle.
Definition Topic.hpp:440
Subscriber(const Subscriber &)=delete
NT_Subscriber m_subHandle
Definition Topic.hpp:385
NT_Topic m_handle
Definition Topic.hpp:316
Definition BooleanTopic.hpp:24
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
Timestamped< std::vector< float > > TimestampedFloatArray
Timestamped FloatArray.
Definition ntcore_cpp_types.hpp:739
constexpr PubSubOptions kDefaultPubSubOptions
Default publish/subscribe options.
Definition ntcore_cpp.hpp:388
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_Publisher Publish(NT_Topic topic, NT_Type type, std::string_view typeStr, const PubSubOptions &options=kDefaultPubSubOptions)
Creates a new publisher to 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=kDefaultPubSubOptions)
Creates a new publisher to a topic.
NT_Subscriber Subscribe(NT_Topic topic, NT_Type type, std::string_view typeStr, const PubSubOptions &options=kDefaultPubSubOptions)
Creates a new subscriber to value changes on a topic.
NetworkTables (ntcore) namespace.
Definition NTSendable.hpp:9
Definition raw_os_ostream.hpp:19
NetworkTables publish/subscribe options.
Definition ntcore_cpp.hpp:303