120 std::vector<TimestampedValueType>
ReadQueue();
360 const wpi::json& properties,
NetworkTables publisher.
Definition: Topic.h:364
NetworkTables subscriber.
Definition: Topic.h:309
NT_Subscriber m_subHandle
Definition: Topic.h:360
NetworkTables Topic.
Definition: Topic.h:28
NetworkTables unit-typed entry.
Definition: UnitTopic.h:190
void Unpublish()
Stops publishing the entry if it's published.
Definition: UnitTopic.inc:86
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition: UnitTopic.h:223
TopicType GetTopic() const
Get the corresponding topic.
Definition: UnitTopic.inc:81
UnitTopic< T > TopicType
Definition: UnitTopic.h:194
NetworkTables unit-typed publisher.
Definition: UnitTopic.h:139
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition: UnitTopic.inc:62
void SetDefault(ParamType value)
Publish a default value.
Definition: UnitTopic.inc:67
TopicType GetTopic() const
Get the corresponding topic.
Definition: UnitTopic.inc:72
T ParamType
Definition: UnitTopic.h:143
T ValueType
Definition: UnitTopic.h:142
NetworkTables unit-typed subscriber.
Definition: UnitTopic.h:56
TopicType GetTopic() const
Get the corresponding topic.
Definition: UnitTopic.inc:53
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition: UnitTopic.inc:32
ValueType Get() const
Get the last published value.
Definition: UnitTopic.inc:22
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition: UnitTopic.inc:43
T ValueType
Definition: UnitTopic.h:59
T ParamType
Definition: UnitTopic.h:60
NetworkTables unit-typed topic.
Definition: UnitTopic.h:247
UnitEntry< T > EntryType
Definition: UnitTopic.h:251
bool IsMatchingUnit() const
Verify the topic has a matching unit type (if the topic is published).
Definition: UnitTopic.inc:91
PublisherType Publish(const PubSubOptions &options=kDefaultPubSubOptions)
Create a new publisher to the topic.
Definition: UnitTopic.inc:110
SubscriberType Subscribe(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic.
Definition: UnitTopic.inc:96
static constexpr std::string_view kTypeString
The default type string for this topic type.
Definition: UnitTopic.h:256
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: UnitTopic.inc:116
T ValueType
Definition: UnitTopic.h:252
UnitTopic(NT_Topic handle)
Construct from a topic handle.
Definition: UnitTopic.h:265
SubscriberType SubscribeEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic, with specific type string.
Definition: UnitTopic.inc:103
UnitTopic(Topic topic)
Construct from a generic topic.
Definition: UnitTopic.h:272
UnitSubscriber< T > SubscriberType
Definition: UnitTopic.h:249
T ParamType
Definition: UnitTopic.h:253
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic, with specific type string.
Definition: UnitTopic.inc:133
EntryType GetEntry(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic.
Definition: UnitTopic.inc:126
UnitPublisher< T > PublisherType
Definition: UnitTopic.h:250
basic_string_view< char > string_view
Definition: core.h:501
NT_Handle NT_Topic
Definition: ntcore_c.h:40
NT_Handle NT_Subscriber
Definition: ntcore_c.h:41
NT_Handle NT_Publisher
Definition: ntcore_c.h:42
NT_Handle NT_Entry
Definition: ntcore_c.h:35
constexpr PubSubOptions kDefaultPubSubOptions
Default publish/subscribe options.
Definition: ntcore_cpp.h:390
NetworkTables (ntcore) namespace.
Definition: ntcore_cpp.h:36
NetworkTables publish/subscribe options.
Definition: ntcore_cpp.h:305
Timestamped unit.
Definition: UnitTopic.h:29
int64_t time
Time in local time base.
Definition: UnitTopic.h:37
int64_t serverTime
Time in server time base.
Definition: UnitTopic.h:42
TimestampedUnit(int64_t time, int64_t serverTime, T value)
Definition: UnitTopic.h:31
TimestampedUnit()=default
T value
Value.
Definition: UnitTopic.h:47