53 m_defaultValue{defaultValue} {}
62 return Get(m_defaultValue);
96 return ::nt::GetAtomicBoolean(
m_subHandle, defaultValue);
304 std::string_view typeString,
ParamType defaultValue,
NetworkTables Boolean entry.
Definition BooleanTopic.h:180
BooleanTopic TopicType
Definition BooleanTopic.h:184
BooleanEntry(NT_Entry handle, ParamType defaultValue)
Construct from an entry handle; recommended to use BooleanTopic::GetEntry() instead.
Definition BooleanTopic.h:199
TopicType GetTopic() const
Get the corresponding topic.
Definition BooleanTopic.h:423
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition BooleanTopic.h:215
bool ParamType
Definition BooleanTopic.h:186
bool ValueType
Definition BooleanTopic.h:185
void Unpublish()
Stops publishing the entry if it's published.
Definition BooleanTopic.h:227
NetworkTables Boolean publisher.
Definition BooleanTopic.h:127
void SetDefault(ParamType value)
Publish a default value.
Definition BooleanTopic.h:162
TopicType GetTopic() const
Get the corresponding topic.
Definition BooleanTopic.h:419
BooleanPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use BooleanTopic::Publish() instead.
Definition BooleanTopic.h:143
bool ValueType
Definition BooleanTopic.h:130
BooleanTopic TopicType
Definition BooleanTopic.h:129
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition BooleanTopic.h:151
bool ParamType
Definition BooleanTopic.h:131
BooleanPublisher()=default
NetworkTables Boolean subscriber.
Definition BooleanTopic.h:34
bool ParamType
Definition BooleanTopic.h:38
BooleanTopic TopicType
Definition BooleanTopic.h:36
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition BooleanTopic.h:83
ValueType Get(ParamType defaultValue) const
Get the last published value.
Definition BooleanTopic.h:72
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition BooleanTopic.h:109
ValueType Get() const
Get the last published value.
Definition BooleanTopic.h:61
BooleanSubscriber()=default
BooleanSubscriber(NT_Subscriber handle, ParamType defaultValue)
Construct from a subscriber handle; recommended to use BooleanTopic::Subscribe() instead.
Definition BooleanTopic.h:51
TopicType GetTopic() const
Get the corresponding topic.
Definition BooleanTopic.h:415
TimestampedValueType GetAtomic(ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition BooleanTopic.h:95
bool ValueType
Definition BooleanTopic.h:37
NetworkTables Boolean topic.
Definition BooleanTopic.h:235
static constexpr std::string_view kTypeString
The default type string for this topic type.
Definition BooleanTopic.h:244
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic, with specific type string.
Definition BooleanTopic.h:406
PublisherType PublishEx(std::string_view typeString, const wpi::json &properties, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new publisher to the topic, with type string and initial properties.
Definition BooleanTopic.h:351
BooleanTopic(Topic topic)
Construct from a generic topic.
Definition BooleanTopic.h:261
bool ValueType
Definition BooleanTopic.h:240
BooleanTopic(NT_Topic handle)
Construct from a topic handle; recommended to use NetworkTableInstance::GetBooleanTopic() instead.
Definition BooleanTopic.h:254
SubscriberType SubscribeEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic, with specific type string.
Definition BooleanTopic.h:303
bool ParamType
Definition BooleanTopic.h:241
SubscriberType Subscribe(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic.
Definition BooleanTopic.h:279
PublisherType Publish(const PubSubOptions &options=kDefaultPubSubOptions)
Create a new publisher to the topic.
Definition BooleanTopic.h:327
EntryType GetEntry(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic.
Definition BooleanTopic.h:378
NetworkTables publisher.
Definition Topic.h:393
NT_Publisher m_pubHandle
NetworkTables handle.
Definition Topic.h:441
NetworkTables subscriber.
Definition Topic.h:321
NT_Subscriber m_subHandle
Definition Topic.h:386
NetworkTables Topic.
Definition Topic.h:28
NT_Topic m_handle
Definition Topic.h:317
bool SetBoolean(NT_Handle pubentry, bool value, int64_t time=0)
Publish a new value.
bool SetDefaultBoolean(NT_Handle pubentry, bool 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_BOOLEAN
Definition ntcore_c.h:55
constexpr PubSubOptions kDefaultPubSubOptions
Default publish/subscribe options.
Definition ntcore_cpp.h:390
Timestamped< bool > TimestampedBoolean
Timestamped Boolean.
Definition ntcore_cpp_types.h:55
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 PublishEx(NT_Topic topic, NT_Type type, std::string_view typeStr, const wpi::json &properties, const PubSubOptions &options=kDefaultPubSubOptions)
Creates a new publisher to a topic.
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_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 ntcore_cpp.h:36
Foonathan namespace.
Definition ntcore_cpp.h:26
NetworkTables publish/subscribe options.
Definition ntcore_cpp.h:305
Timestamped value.
Definition ntcore_cpp_types.h:30