52 m_defaultValue{defaultValue} {}
61 return Get(m_defaultValue);
72 return ::wpi::nt::GetFloat(
m_subHandle, defaultValue);
95 return ::wpi::nt::GetAtomicFloat(
m_subHandle, defaultValue);
303 std::string_view typeString,
ParamType defaultValue,
NetworkTables Float entry.
Definition FloatTopic.hpp:179
float ParamType
Definition FloatTopic.hpp:185
void Unpublish()
Stops publishing the entry if it's published.
Definition FloatTopic.hpp:226
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatTopic.hpp:422
FloatPublisher PublisherType
Definition FloatTopic.hpp:182
FloatSubscriber SubscriberType
Definition FloatTopic.hpp:181
FloatTopic TopicType
Definition FloatTopic.hpp:183
TimestampedFloat TimestampedValueType
Definition FloatTopic.hpp:187
FloatEntry(NT_Entry handle, ParamType defaultValue)
Construct from an entry handle; recommended to use FloatTopic::GetEntry() instead.
Definition FloatTopic.hpp:198
float ValueType
Definition FloatTopic.hpp:184
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition FloatTopic.hpp:214
NetworkTables Float publisher.
Definition FloatTopic.hpp:126
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatTopic.hpp:418
FloatTopic TopicType
Definition FloatTopic.hpp:128
void SetDefault(ParamType value)
Publish a default value.
Definition FloatTopic.hpp:161
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition FloatTopic.hpp:150
TimestampedFloat TimestampedValueType
Definition FloatTopic.hpp:132
float ParamType
Definition FloatTopic.hpp:130
FloatPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use FloatTopic::Publish() instead.
Definition FloatTopic.hpp:142
float ValueType
Definition FloatTopic.hpp:129
NetworkTables Float subscriber.
Definition FloatTopic.hpp:33
TimestampedFloat TimestampedValueType
Definition FloatTopic.hpp:38
ValueType Get(ParamType defaultValue) const
Get the last published value.
Definition FloatTopic.hpp:71
ValueType Get() const
Get the last published value.
Definition FloatTopic.hpp:60
float ValueType
Definition FloatTopic.hpp:36
TopicType GetTopic() const
Get the corresponding topic.
Definition FloatTopic.hpp:414
FloatTopic TopicType
Definition FloatTopic.hpp:35
FloatSubscriber()=default
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition FloatTopic.hpp:108
FloatSubscriber(NT_Subscriber handle, ParamType defaultValue)
Construct from a subscriber handle; recommended to use FloatTopic::Subscribe() instead.
Definition FloatTopic.hpp:50
float ParamType
Definition FloatTopic.hpp:37
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition FloatTopic.hpp:82
TimestampedValueType GetAtomic(ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition FloatTopic.hpp:94
NetworkTables Float topic.
Definition FloatTopic.hpp:234
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 FloatTopic.hpp:350
FloatSubscriber SubscriberType
Definition FloatTopic.hpp:236
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 FloatTopic.hpp:405
TimestampedFloat TimestampedValueType
Definition FloatTopic.hpp:241
FloatPublisher PublisherType
Definition FloatTopic.hpp:237
SubscriberType Subscribe(ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new subscriber to the topic.
Definition FloatTopic.hpp:278
static constexpr std::string_view TYPE_STRING
The default type string for this topic type.
Definition FloatTopic.hpp:243
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 FloatTopic.hpp:302
FloatEntry EntryType
Definition FloatTopic.hpp:238
FloatTopic(NT_Topic handle)
Construct from a topic handle; recommended to use NetworkTableInstance::GetFloatTopic() instead.
Definition FloatTopic.hpp:253
float ValueType
Definition FloatTopic.hpp:239
PublisherType Publish(const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new publisher to the topic.
Definition FloatTopic.hpp:326
FloatTopic(Topic topic)
Construct from a generic topic.
Definition FloatTopic.hpp:260
float ParamType
Definition FloatTopic.hpp:240
EntryType GetEntry(ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new entry for the topic.
Definition FloatTopic.hpp:377
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
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
constexpr PubSubOptions DEFAULT_PUB_SUB_OPTIONS
Default publish/subscribe options.
Definition ntcore_cpp.hpp:388
Timestamped< float > TimestampedFloat
Timestamped Float.
Definition ntcore_cpp_types.hpp:213
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