53 m_defaultValue{defaultValue} {}
62 return Get(m_defaultValue);
73 return ::wpi::nt::GetFloat(
m_subHandle, defaultValue);
96 return ::wpi::nt::GetAtomicFloat(
m_subHandle, defaultValue);
304 std::string_view typeString,
ParamType defaultValue,
NetworkTables Float entry.
Definition FloatTopic.hpp:180
float ParamType
Definition FloatTopic.hpp:186
void Unpublish()
Stops publishing the entry if it's published.
Definition FloatTopic.hpp:227
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatTopic.hpp:423
FloatPublisher PublisherType
Definition FloatTopic.hpp:183
FloatSubscriber SubscriberType
Definition FloatTopic.hpp:182
FloatTopic TopicType
Definition FloatTopic.hpp:184
TimestampedFloat TimestampedValueType
Definition FloatTopic.hpp:188
FloatEntry(NT_Entry handle, ParamType defaultValue)
Construct from an entry handle; recommended to use FloatTopic::GetEntry() instead.
Definition FloatTopic.hpp:199
float ValueType
Definition FloatTopic.hpp:185
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition FloatTopic.hpp:215
NetworkTables Float publisher.
Definition FloatTopic.hpp:127
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatTopic.hpp:419
FloatTopic TopicType
Definition FloatTopic.hpp:129
void SetDefault(ParamType value)
Publish a default value.
Definition FloatTopic.hpp:162
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition FloatTopic.hpp:151
TimestampedFloat TimestampedValueType
Definition FloatTopic.hpp:133
float ParamType
Definition FloatTopic.hpp:131
FloatPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use FloatTopic::Publish() instead.
Definition FloatTopic.hpp:143
float ValueType
Definition FloatTopic.hpp:130
NetworkTables Float subscriber.
Definition FloatTopic.hpp:34
TimestampedFloat TimestampedValueType
Definition FloatTopic.hpp:39
ValueType Get(ParamType defaultValue) const
Get the last published value.
Definition FloatTopic.hpp:72
ValueType Get() const
Get the last published value.
Definition FloatTopic.hpp:61
float ValueType
Definition FloatTopic.hpp:37
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatTopic.hpp:415
FloatTopic TopicType
Definition FloatTopic.hpp:36
FloatSubscriber()=default
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition FloatTopic.hpp:109
FloatSubscriber(NT_Subscriber handle, ParamType defaultValue)
Construct from a subscriber handle; recommended to use FloatTopic::Subscribe() instead.
Definition FloatTopic.hpp:51
float ParamType
Definition FloatTopic.hpp:38
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition FloatTopic.hpp:83
TimestampedValueType GetAtomic(ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition FloatTopic.hpp:95
NetworkTables Float topic.
Definition FloatTopic.hpp:235
SubscriberType SubscribeEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic, with specific type string.
Definition FloatTopic.hpp:303
FloatSubscriber SubscriberType
Definition FloatTopic.hpp:237
static constexpr std::string_view kTypeString
The default type string for this topic type.
Definition FloatTopic.hpp:244
TimestampedFloat TimestampedValueType
Definition FloatTopic.hpp:242
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic, with specific type string.
Definition FloatTopic.hpp:406
FloatPublisher PublisherType
Definition FloatTopic.hpp:238
EntryType GetEntry(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic.
Definition FloatTopic.hpp:378
SubscriberType Subscribe(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic.
Definition FloatTopic.hpp:279
FloatEntry EntryType
Definition FloatTopic.hpp:239
PublisherType Publish(const PubSubOptions &options=kDefaultPubSubOptions)
Create a new publisher to the topic.
Definition FloatTopic.hpp:327
FloatTopic(NT_Topic handle)
Construct from a topic handle; recommended to use NetworkTableInstance::GetFloatTopic() instead.
Definition FloatTopic.hpp:254
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 FloatTopic.hpp:351
float ValueType
Definition FloatTopic.hpp:240
FloatTopic(Topic topic)
Construct from a generic topic.
Definition FloatTopic.hpp:261
float ParamType
Definition FloatTopic.hpp:241
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
bool SetDefaultFloat(NT_Handle pubentry, float defaultValue)
Publish a default value.
bool SetFloat(NT_Handle pubentry, 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
Definition ntcore_c.h:61
Timestamped< float > TimestampedFloat
Timestamped Float.
Definition ntcore_cpp_types.hpp:213
constexpr PubSubOptions kDefaultPubSubOptions
Default publish/subscribe options.
Definition ntcore_cpp.hpp:388
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