25class GenericPublisher;
26class GenericSubscriber;
27class NetworkTableInstance;
40 explicit operator bool()
const {
return m_handle != 0; }
NetworkTables generic entry.
Definition: GenericEntry.h:435
NetworkTables generic publisher.
Definition: GenericEntry.h:193
NetworkTables generic subscriber.
Definition: GenericEntry.h:24
NetworkTables Instance.
Definition: NetworkTableInstance.h:59
NetworkTables publisher.
Definition: Topic.h:351
Publisher(const Publisher &)=delete
Publisher(NT_Publisher handle)
Definition: Topic.h:384
Topic GetTopic() const
Gets the published-to topic.
Definition: Topic.inc:111
Publisher & operator=(const Publisher &)=delete
virtual ~Publisher()
Definition: Topic.inc:94
NT_Publisher m_pubHandle
Definition: Topic.h:386
NT_Publisher GetHandle() const
Gets the native handle for the publisher.
Definition: Topic.h:373
NetworkTables subscriber.
Definition: Topic.h:296
bool Exists() const
Determines if the topic is currently being published.
Definition: Topic.inc:82
int64_t GetLastChange() const
Gets the last time the value was changed.
Definition: Topic.inc:86
NT_Subscriber GetHandle() const
Gets the native handle for the subscriber.
Definition: Topic.h:318
virtual ~Subscriber()
Definition: Topic.inc:65
Subscriber & operator=(const Subscriber &)=delete
NT_Subscriber m_subHandle
Definition: Topic.h:347
Subscriber(NT_Subscriber handle)
Definition: Topic.h:345
Topic GetTopic() const
Gets the subscribed-to topic.
Definition: Topic.inc:90
Subscriber(const Subscriber &)=delete
NetworkTables Topic.
Definition: Topic.h:30
GenericPublisher GenericPublishEx(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.
bool IsPersistent() const
Returns whether the value is persistent through server restarts.
Definition: Topic.inc:37
bool Exists() const
Determines if the topic is currently being published.
Definition: Topic.inc:49
Topic(NT_Topic handle)
Definition: Topic.h:33
bool SetProperties(const wpi::json &properties)
Updates multiple topic properties.
Definition: Topic.inc:57
void DeleteProperty(std::string_view name)
Deletes a property.
Definition: Topic.inc:53
void SetRetained(bool retained)
Make the server retain the topic even when there are no publishers.
Definition: Topic.inc:41
std::string GetTypeString() const
Gets the type string of the topic.
Definition: Topic.inc:29
GenericEntry GetGenericEntry(std::string_view typeString, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new generic entry for the topic.
GenericEntry GetGenericEntry(const PubSubOptions &options=kDefaultPubSubOptions)
Create a new generic entry for the topic.
NT_Topic GetHandle() const
Gets the native handle for the topic.
Definition: Topic.h:47
NetworkTableType GetType() const
Gets the type of the topic.
Definition: Topic.inc:25
std::string GetName() const
Gets the name of the topic.
Definition: Topic.inc:21
bool IsRetained() const
Returns whether the topic is retained by server when there are no publishers.
Definition: Topic.inc:45
NT_Topic m_handle
Definition: Topic.h:292
bool operator==(const Topic &) const =default
Equality operator.
void SetPersistent(bool persistent)
Make value persistent through server restarts.
Definition: Topic.inc:33
wpi::json GetProperties() const
Gets all topic properties as a JSON object.
GenericPublisher GenericPublish(std::string_view typeString, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new publisher to the topic.
wpi::json GetProperty(std::string_view name) const
Gets the current value of a property (as a JSON object).
NetworkTableInstance GetInstance() const
Gets the instance for the topic.
Definition: Topic.inc:17
TopicInfo GetInfo() const
Gets combined information about the topic.
Definition: Topic.inc:61
void SetProperty(std::string_view name, const wpi::json &value)
Sets a property value.
GenericSubscriber GenericSubscribe(std::string_view typeString, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic.
GenericSubscriber GenericSubscribe(const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic.
a class to store JSON values
Definition: json.h:2655
basic_string_view< char > string_view
Definition: core.h:520
NT_Handle NT_Topic
Definition: ntcore_c.h:38
NT_Handle NT_Subscriber
Definition: ntcore_c.h:39
NT_Handle NT_Publisher
Definition: ntcore_c.h:40
NetworkTableType
NetworkTable entry type.
Definition: NetworkTableType.h:15
constexpr PubSubOptions kDefaultPubSubOptions
Default publish/subscribe options.
Definition: ntcore_cpp.h:381
::int64_t int64_t
Definition: Meta.h:59
NetworkTables (ntcore) namespace.
Definition: Topic.inc:15
Definition: AprilTagFieldLayout.h:18
NetworkTables publish/subscribe options.
Definition: ntcore_cpp.h:304
NetworkTables Topic Information.
Definition: ntcore_cpp.h:89