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