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