|
| UnitTopic ()=default |
|
| UnitTopic (NT_Topic handle) |
| Construct from a topic handle. More...
|
|
| UnitTopic (Topic topic) |
| Construct from a generic topic. More...
|
|
bool | IsMatchingUnit () const |
| Verify the topic has a matching unit type (if the topic is published). More...
|
|
SubscriberType | Subscribe (ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions) |
| Create a new subscriber to the topic. More...
|
|
SubscriberType | SubscribeEx (std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions) |
| Create a new subscriber to the topic, with specific type string. More...
|
|
PublisherType | Publish (const PubSubOptions &options=kDefaultPubSubOptions) |
| Create a new publisher to the topic. More...
|
|
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. More...
|
|
EntryType | GetEntry (ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions) |
| Create a new entry for the topic. More...
|
|
EntryType | GetEntryEx (std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions) |
| Create a new entry for the topic, with specific type string. More...
|
|
| Topic ()=default |
|
| Topic (NT_Topic handle) |
|
| operator bool () const |
| Determines if the native handle is valid. More...
|
|
NT_Topic | GetHandle () const |
| Gets the native handle for the topic. More...
|
|
NetworkTableInstance | GetInstance () const |
| Gets the instance for the topic. More...
|
|
std::string | GetName () const |
| Gets the name of the topic. More...
|
|
NetworkTableType | GetType () const |
| Gets the type of the topic. More...
|
|
std::string | GetTypeString () const |
| Gets the type string of the topic. More...
|
|
void | SetPersistent (bool persistent) |
| Make value persistent through server restarts. More...
|
|
bool | IsPersistent () const |
| Returns whether the value is persistent through server restarts. More...
|
|
void | SetRetained (bool retained) |
| Make the server retain the topic even when there are no publishers. More...
|
|
bool | IsRetained () const |
| Returns whether the topic is retained by server when there are no publishers. More...
|
|
bool | Exists () const |
| Determines if the topic is currently being published. More...
|
|
wpi::json | GetProperty (std::string_view name) const |
| Gets the current value of a property (as a JSON object). More...
|
|
void | SetProperty (std::string_view name, const wpi::json &value) |
| Sets a property value. More...
|
|
void | DeleteProperty (std::string_view name) |
| Deletes a property. More...
|
|
wpi::json | GetProperties () const |
| Gets all topic properties as a JSON object. More...
|
|
bool | SetProperties (const wpi::json &properties) |
| Updates multiple topic properties. More...
|
|
TopicInfo | GetInfo () const |
| Gets combined information about the topic. More...
|
|
GenericSubscriber | GenericSubscribe (const PubSubOptions &options=kDefaultPubSubOptions) |
| Create a new subscriber to the topic. More...
|
|
GenericSubscriber | GenericSubscribe (std::string_view typeString, const PubSubOptions &options=kDefaultPubSubOptions) |
| Create a new subscriber to the topic. More...
|
|
GenericPublisher | GenericPublish (std::string_view typeString, const PubSubOptions &options=kDefaultPubSubOptions) |
| Create a new publisher to the topic. More...
|
|
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. More...
|
|
GenericEntry | GetGenericEntry (const PubSubOptions &options=kDefaultPubSubOptions) |
| Create a new generic entry for the topic. More...
|
|
GenericEntry | GetGenericEntry (std::string_view typeString, const PubSubOptions &options=kDefaultPubSubOptions) |
| Create a new generic entry for the topic. More...
|
|
bool | operator== (const Topic &) const =default |
| Equality operator. More...
|
|
template<typename T>
class nt::UnitTopic< T >
NetworkTables unit-typed topic.
Publishers publish the type name (e.g. "meter") as the "unit" property. Type conversions are not performed–for correct behavior the publisher and subscriber must use the same unit type, but this can be checked at runtime using IsMatchingUnit().
- Template Parameters
-
T | unit type, e.g. units::meter_t |