56 m_defaultValue{defaultValue.begin(), defaultValue.end()} {}
65 return Get(m_defaultValue);
76 return ::wpi::nt::GetRaw(
m_subHandle, defaultValue);
87 return Get(buf, m_defaultValue);
122 return ::wpi::nt::GetAtomicRaw(
m_subHandle, defaultValue);
340 std::string_view typeString,
ParamType defaultValue,
Publisher(const Publisher &)=delete
NT_Publisher m_pubHandle
NetworkTables handle.
Definition Topic.hpp:443
NetworkTables Raw entry.
Definition RawTopic.hpp:237
void Unpublish()
Stops publishing the entry if it's published.
Definition RawTopic.hpp:287
RawTopic TopicType
Definition RawTopic.hpp:241
std::vector< uint8_t > ValueType
Definition RawTopic.hpp:242
std::span< const uint8_t > ParamType
Definition RawTopic.hpp:243
RawSubscriber SubscriberType
Definition RawTopic.hpp:239
TopicType GetTopic() const
Get the corresponding topic.
Definition RawTopic.hpp:433
RawPublisher PublisherType
Definition RawTopic.hpp:240
std::span< uint8_t > SmallRetType
Definition RawTopic.hpp:245
TimestampedRaw TimestampedValueType
Definition RawTopic.hpp:248
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition RawTopic.hpp:275
RawEntry(NT_Entry handle, ParamType defaultValue)
Construct from an entry handle; recommended to use RawTopic::GetEntry() instead.
Definition RawTopic.hpp:259
uint8_t SmallElemType
Definition RawTopic.hpp:246
NetworkTables Raw publisher.
Definition RawTopic.hpp:181
TopicType GetTopic() const
Get the corresponding topic.
Definition RawTopic.hpp:429
uint8_t SmallElemType
Definition RawTopic.hpp:188
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition RawTopic.hpp:208
std::vector< uint8_t > ValueType
Definition RawTopic.hpp:184
RawPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use RawTopic::Publish() instead.
Definition RawTopic.hpp:200
TimestampedRaw TimestampedValueType
Definition RawTopic.hpp:190
void SetDefault(ParamType value)
Publish a default value.
Definition RawTopic.hpp:219
std::span< uint8_t > SmallRetType
Definition RawTopic.hpp:187
std::span< const uint8_t > ParamType
Definition RawTopic.hpp:185
RawTopic TopicType
Definition RawTopic.hpp:183
NetworkTables Raw subscriber.
Definition RawTopic.hpp:33
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition RawTopic.hpp:109
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value along with its timestamp.
Definition RawTopic.hpp:133
TimestampedValueType GetAtomic(ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition RawTopic.hpp:121
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition RawTopic.hpp:163
ValueType Get(ParamType defaultValue) const
Get the last published value.
Definition RawTopic.hpp:75
std::vector< uint8_t > ValueType
Definition RawTopic.hpp:36
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value.
Definition RawTopic.hpp:98
ValueType Get() const
Get the last published value.
Definition RawTopic.hpp:64
TimestampedRaw TimestampedValueType
Definition RawTopic.hpp:38
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value.
Definition RawTopic.hpp:86
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition RawTopic.hpp:147
std::span< uint8_t > SmallRetType
Definition RawTopic.hpp:40
TimestampedRawView TimestampedValueViewType
Definition RawTopic.hpp:42
RawTopic TopicType
Definition RawTopic.hpp:35
std::span< const uint8_t > ParamType
Definition RawTopic.hpp:37
RawSubscriber(NT_Subscriber handle, ParamType defaultValue)
Construct from a subscriber handle; recommended to use RawTopic::Subscribe() instead.
Definition RawTopic.hpp:54
uint8_t SmallElemType
Definition RawTopic.hpp:41
TopicType GetTopic() const
Get the corresponding topic.
Definition RawTopic.hpp:425
NetworkTables Raw topic.
Definition RawTopic.hpp:295
PublisherType Publish(std::string_view typeString, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new publisher to the topic.
Definition RawTopic.hpp:364
RawPublisher PublisherType
Definition RawTopic.hpp:298
RawSubscriber SubscriberType
Definition RawTopic.hpp:297
std::span< const uint8_t > ParamType
Definition RawTopic.hpp:301
RawTopic(NT_Topic handle)
Construct from a topic handle; recommended to use NetworkTableInstance::GetRawTopic() instead.
Definition RawTopic.hpp:312
std::vector< uint8_t > ValueType
Definition RawTopic.hpp:300
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 RawTopic.hpp:388
RawTopic(Topic topic)
Construct from a generic topic.
Definition RawTopic.hpp:319
SubscriberType Subscribe(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new subscriber to the topic.
Definition RawTopic.hpp:339
RawEntry EntryType
Definition RawTopic.hpp:299
EntryType GetEntry(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new entry for the topic.
Definition RawTopic.hpp:417
TimestampedRaw TimestampedValueType
Definition RawTopic.hpp:302
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 SetRaw(NT_Handle pubentry, std::span< const uint8_t > value, int64_t time=0)
Publish a new value.
TimestampedRaw GetAtomicRaw(NT_Handle subentry, std::span< const uint8_t > defaultValue)
Get the last published value along with its timestamp.
bool SetDefaultRaw(NT_Handle pubentry, std::span< const uint8_t > defaultValue)
Publish a default value.
std::vector< uint8_t > GetRaw(NT_Handle subentry, std::span< const uint8_t > defaultValue)
Get the last published 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_RAW
Definition ntcore_c.h:55
Timestamped< std::span< uint8_t > > TimestampedRawView
Timestamped Raw view (for wpi::util::SmallVector-taking functions).
Definition ntcore_cpp_types.hpp:469
Timestamped< std::vector< uint8_t > > TimestampedRaw
Timestamped Raw.
Definition ntcore_cpp_types.hpp:463
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