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