56 m_defaultValue{defaultValue.begin(), defaultValue.end()} {}
65 return Get(m_defaultValue);
76 return ::wpi::nt::GetDoubleArray(
m_subHandle, defaultValue);
87 return Get(buf, m_defaultValue);
122 return ::wpi::nt::GetAtomicDoubleArray(
m_subHandle, defaultValue);
164 return ::wpi::nt::ReadQueueDoubleArray(
m_subHandle);
364 std::string_view typeString,
ParamType defaultValue,
NetworkTables DoubleArray entry.
Definition DoubleArrayTopic.hpp:237
std::span< const double > ParamType
Definition DoubleArrayTopic.hpp:243
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition DoubleArrayTopic.hpp:275
std::vector< double > ValueType
Definition DoubleArrayTopic.hpp:242
TopicType GetTopic() const
Get the corresponding topic.
Definition DoubleArrayTopic.hpp:483
DoubleArrayTopic TopicType
Definition DoubleArrayTopic.hpp:241
DoubleArraySubscriber SubscriberType
Definition DoubleArrayTopic.hpp:239
DoubleArrayEntry(NT_Entry handle, ParamType defaultValue)
Construct from an entry handle; recommended to use DoubleArrayTopic::GetEntry() instead.
Definition DoubleArrayTopic.hpp:259
std::span< double > SmallRetType
Definition DoubleArrayTopic.hpp:245
void Unpublish()
Stops publishing the entry if it's published.
Definition DoubleArrayTopic.hpp:287
DoubleArrayEntry()=default
double SmallElemType
Definition DoubleArrayTopic.hpp:246
TimestampedDoubleArray TimestampedValueType
Definition DoubleArrayTopic.hpp:248
DoubleArrayPublisher PublisherType
Definition DoubleArrayTopic.hpp:240
NetworkTables DoubleArray publisher.
Definition DoubleArrayTopic.hpp:181
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition DoubleArrayTopic.hpp:208
TopicType GetTopic() const
Get the corresponding topic.
Definition DoubleArrayTopic.hpp:479
double SmallElemType
Definition DoubleArrayTopic.hpp:188
DoubleArrayPublisher()=default
void SetDefault(ParamType value)
Publish a default value.
Definition DoubleArrayTopic.hpp:219
std::vector< double > ValueType
Definition DoubleArrayTopic.hpp:184
std::span< double > SmallRetType
Definition DoubleArrayTopic.hpp:187
DoubleArrayTopic TopicType
Definition DoubleArrayTopic.hpp:183
DoubleArrayPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use DoubleArrayTopic::Publish() instead.
Definition DoubleArrayTopic.hpp:200
TimestampedDoubleArray TimestampedValueType
Definition DoubleArrayTopic.hpp:190
std::span< const double > ParamType
Definition DoubleArrayTopic.hpp:185
NetworkTables DoubleArray subscriber.
Definition DoubleArrayTopic.hpp:33
DoubleArrayTopic TopicType
Definition DoubleArrayTopic.hpp:35
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition DoubleArrayTopic.hpp:163
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value along with its timestamp.
Definition DoubleArrayTopic.hpp:133
TimestampedDoubleArray TimestampedValueType
Definition DoubleArrayTopic.hpp:38
DoubleArraySubscriber(NT_Subscriber handle, ParamType defaultValue)
Construct from a subscriber handle; recommended to use DoubleArrayTopic::Subscribe() instead.
Definition DoubleArrayTopic.hpp:54
std::vector< double > ValueType
Definition DoubleArrayTopic.hpp:36
double SmallElemType
Definition DoubleArrayTopic.hpp:41
TimestampedValueType GetAtomic(ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition DoubleArrayTopic.hpp:121
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition DoubleArrayTopic.hpp:147
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value.
Definition DoubleArrayTopic.hpp:86
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition DoubleArrayTopic.hpp:109
ValueType Get() const
Get the last published value.
Definition DoubleArrayTopic.hpp:64
TopicType GetTopic() const
Get the corresponding topic.
Definition DoubleArrayTopic.hpp:475
ValueType Get(ParamType defaultValue) const
Get the last published value.
Definition DoubleArrayTopic.hpp:75
std::span< const double > ParamType
Definition DoubleArrayTopic.hpp:37
std::span< double > SmallRetType
Definition DoubleArrayTopic.hpp:40
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value.
Definition DoubleArrayTopic.hpp:98
DoubleArraySubscriber()=default
TimestampedDoubleArrayView TimestampedValueViewType
Definition DoubleArrayTopic.hpp:42
NetworkTables DoubleArray topic.
Definition DoubleArrayTopic.hpp:295
PublisherType Publish(const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new publisher to the topic.
Definition DoubleArrayTopic.hpp:387
SubscriberType SubscribeEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new subscriber to the topic, with specific type string.
Definition DoubleArrayTopic.hpp:363
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new entry for the topic, with specific type string.
Definition DoubleArrayTopic.hpp:466
SubscriberType Subscribe(ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new subscriber to the topic.
Definition DoubleArrayTopic.hpp:339
std::span< const double > ParamType
Definition DoubleArrayTopic.hpp:301
DoubleArraySubscriber SubscriberType
Definition DoubleArrayTopic.hpp:297
EntryType GetEntry(ParamType defaultValue, const PubSubOptions &options=DEFAULT_PUB_SUB_OPTIONS)
Create a new entry for the topic.
Definition DoubleArrayTopic.hpp:438
std::vector< double > ValueType
Definition DoubleArrayTopic.hpp:300
DoubleArrayEntry EntryType
Definition DoubleArrayTopic.hpp:299
DoubleArrayTopic(NT_Topic handle)
Construct from a topic handle; recommended to use NetworkTableInstance::GetDoubleArrayTopic() instead...
Definition DoubleArrayTopic.hpp:314
DoubleArrayTopic(Topic topic)
Construct from a generic topic.
Definition DoubleArrayTopic.hpp:321
DoubleArrayTopic()=default
static constexpr std::string_view TYPE_STRING
The default type string for this topic type.
Definition DoubleArrayTopic.hpp:304
DoubleArrayPublisher PublisherType
Definition DoubleArrayTopic.hpp:298
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 DoubleArrayTopic.hpp:411
TimestampedDoubleArray TimestampedValueType
Definition DoubleArrayTopic.hpp:302
Publisher(const Publisher &)=delete
NT_Publisher m_pubHandle
NetworkTables handle.
Definition Topic.hpp:443
Subscriber(const Subscriber &)=delete
NT_Subscriber m_subHandle
Definition Topic.hpp:388
NT_Topic m_handle
Definition Topic.hpp:319
Definition BooleanTopic.hpp:22
TimestampedDoubleArray GetAtomicDoubleArray(NT_Handle subentry, std::span< const double > defaultValue)
Get the last published value along with its timestamp.
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.
bool SetDoubleArray(NT_Handle pubentry, std::span< const double > value, int64_t time=0)
Publish a new 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_DOUBLE_ARRAY
Definition ntcore_c.h:57
Timestamped< std::span< double > > TimestampedDoubleArrayView
Timestamped DoubleArray view (for wpi::util::SmallVector-taking functions).
Definition ntcore_cpp_types.hpp:837
constexpr PubSubOptions DEFAULT_PUB_SUB_OPTIONS
Default publish/subscribe options.
Definition ntcore_cpp.hpp:388
Timestamped< std::vector< double > > TimestampedDoubleArray
Timestamped DoubleArray.
Definition ntcore_cpp_types.hpp:831
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