29class DoubleArrayTopic;
57 m_defaultValue{defaultValue.begin(), defaultValue.end()} {}
66 return Get(m_defaultValue);
77 return ::nt::GetDoubleArray(
m_subHandle, defaultValue);
88 return Get(buf, m_defaultValue);
123 return ::nt::GetAtomicDoubleArray(
m_subHandle, defaultValue);
365 std::string_view typeString,
ParamType defaultValue,
NetworkTables DoubleArray entry.
Definition DoubleArrayTopic.h:238
DoubleArrayEntry()=default
std::span< const double > ParamType
Definition DoubleArrayTopic.h:244
DoubleArrayTopic TopicType
Definition DoubleArrayTopic.h:242
TopicType GetTopic() const
Get the corresponding topic.
Definition DoubleArrayTopic.h:484
std::vector< double > ValueType
Definition DoubleArrayTopic.h:243
void Unpublish()
Stops publishing the entry if it's published.
Definition DoubleArrayTopic.h:288
double SmallElemType
Definition DoubleArrayTopic.h:247
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition DoubleArrayTopic.h:276
DoubleArrayEntry(NT_Entry handle, ParamType defaultValue)
Construct from an entry handle; recommended to use DoubleArrayTopic::GetEntry() instead.
Definition DoubleArrayTopic.h:260
std::span< double > SmallRetType
Definition DoubleArrayTopic.h:246
NetworkTables DoubleArray publisher.
Definition DoubleArrayTopic.h:182
TopicType GetTopic() const
Get the corresponding topic.
Definition DoubleArrayTopic.h:480
DoubleArrayPublisher()=default
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition DoubleArrayTopic.h:209
std::span< double > SmallRetType
Definition DoubleArrayTopic.h:188
DoubleArrayPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use DoubleArrayTopic::Publish() instead.
Definition DoubleArrayTopic.h:201
double SmallElemType
Definition DoubleArrayTopic.h:189
void SetDefault(ParamType value)
Publish a default value.
Definition DoubleArrayTopic.h:220
std::vector< double > ValueType
Definition DoubleArrayTopic.h:185
DoubleArrayTopic TopicType
Definition DoubleArrayTopic.h:184
std::span< const double > ParamType
Definition DoubleArrayTopic.h:186
NetworkTables DoubleArray subscriber.
Definition DoubleArrayTopic.h:34
SmallRetType Get(wpi::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value.
Definition DoubleArrayTopic.h:87
std::vector< double > ValueType
Definition DoubleArrayTopic.h:37
TimestampedValueViewType GetAtomic(wpi::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition DoubleArrayTopic.h:148
ValueType Get() const
Get the last published value.
Definition DoubleArrayTopic.h:65
ValueType Get(ParamType defaultValue) const
Get the last published value.
Definition DoubleArrayTopic.h:76
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition DoubleArrayTopic.h:164
TopicType GetTopic() const
Get the corresponding topic.
Definition DoubleArrayTopic.h:476
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition DoubleArrayTopic.h:110
TimestampedValueViewType GetAtomic(wpi::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value along with its timestamp.
Definition DoubleArrayTopic.h:134
DoubleArraySubscriber(NT_Subscriber handle, ParamType defaultValue)
Construct from a subscriber handle; recommended to use DoubleArrayTopic::Subscribe() instead.
Definition DoubleArrayTopic.h:55
SmallRetType Get(wpi::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value.
Definition DoubleArrayTopic.h:99
double SmallElemType
Definition DoubleArrayTopic.h:42
std::span< double > SmallRetType
Definition DoubleArrayTopic.h:41
std::span< const double > ParamType
Definition DoubleArrayTopic.h:38
DoubleArrayTopic TopicType
Definition DoubleArrayTopic.h:36
TimestampedValueType GetAtomic(ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition DoubleArrayTopic.h:122
DoubleArraySubscriber()=default
NetworkTables DoubleArray topic.
Definition DoubleArrayTopic.h:296
PublisherType Publish(const PubSubOptions &options=kDefaultPubSubOptions)
Create a new publisher to the topic.
Definition DoubleArrayTopic.h:388
SubscriberType Subscribe(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic.
Definition DoubleArrayTopic.h:340
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 DoubleArrayTopic.h:412
static constexpr std::string_view kTypeString
The default type string for this topic type.
Definition DoubleArrayTopic.h:305
SubscriberType SubscribeEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic, with specific type string.
Definition DoubleArrayTopic.h:364
std::span< const double > ParamType
Definition DoubleArrayTopic.h:302
DoubleArrayTopic(Topic topic)
Construct from a generic topic.
Definition DoubleArrayTopic.h:322
DoubleArrayTopic()=default
EntryType GetEntry(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic.
Definition DoubleArrayTopic.h:439
std::vector< double > ValueType
Definition DoubleArrayTopic.h:301
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic, with specific type string.
Definition DoubleArrayTopic.h:467
DoubleArrayTopic(NT_Topic handle)
Construct from a topic handle; recommended to use NetworkTableInstance::GetDoubleArrayTopic() instead...
Definition DoubleArrayTopic.h:315
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
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition sha1.h:30
bool SetDoubleArray(NT_Handle pubentry, std::span< const double > value, int64_t time=0)
Publish a new value.
bool SetDefaultDoubleArray(NT_Handle pubentry, std::span< const double > defaultValue)
Publish a default value.
std::vector< double > GetDoubleArray(NT_Handle subentry, std::span< const double > defaultValue)
Get the last published value.
TimestampedDoubleArray GetAtomicDoubleArray(NT_Handle subentry, std::span< const double > defaultValue)
Get the last published value along with its timestamp.
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_DOUBLE_ARRAY
Definition ntcore_c.h:60
Timestamped< std::span< double > > TimestampedDoubleArrayView
Timestamped DoubleArray view (for SmallVector-taking functions).
Definition ntcore_cpp_types.h:837
Timestamped< std::vector< double > > TimestampedDoubleArray
Timestamped DoubleArray.
Definition ntcore_cpp_types.h:831
constexpr PubSubOptions kDefaultPubSubOptions
Default publish/subscribe options.
Definition ntcore_cpp.h:390
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