57 m_defaultValue{defaultValue.begin(), defaultValue.end()} {}
66 return Get(m_defaultValue);
77 return ::wpi::nt::GetIntegerArray(
m_subHandle, defaultValue);
88 return Get(buf, m_defaultValue);
123 return ::wpi::nt::GetAtomicIntegerArray(
m_subHandle, defaultValue);
165 return ::wpi::nt::ReadQueueIntegerArray(
m_subHandle);
365 std::string_view typeString,
ParamType defaultValue,
NetworkTables IntegerArray entry.
Definition IntegerArrayTopic.hpp:238
void Unpublish()
Stops publishing the entry if it's published.
Definition IntegerArrayTopic.hpp:288
TopicType GetTopic() const
Get the corresponding topic.
Definition IntegerArrayTopic.hpp:484
IntegerArrayEntry()=default
std::vector< int64_t > ValueType
Definition IntegerArrayTopic.hpp:243
std::span< const int64_t > ParamType
Definition IntegerArrayTopic.hpp:244
IntegerArrayTopic TopicType
Definition IntegerArrayTopic.hpp:242
IntegerArraySubscriber SubscriberType
Definition IntegerArrayTopic.hpp:240
int64_t SmallElemType
Definition IntegerArrayTopic.hpp:247
IntegerArrayEntry(NT_Entry handle, ParamType defaultValue)
Construct from an entry handle; recommended to use IntegerArrayTopic::GetEntry() instead.
Definition IntegerArrayTopic.hpp:260
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition IntegerArrayTopic.hpp:276
std::span< int64_t > SmallRetType
Definition IntegerArrayTopic.hpp:246
IntegerArrayPublisher PublisherType
Definition IntegerArrayTopic.hpp:241
TimestampedIntegerArray TimestampedValueType
Definition IntegerArrayTopic.hpp:249
NetworkTables IntegerArray publisher.
Definition IntegerArrayTopic.hpp:182
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition IntegerArrayTopic.hpp:209
IntegerArrayTopic TopicType
Definition IntegerArrayTopic.hpp:184
void SetDefault(ParamType value)
Publish a default value.
Definition IntegerArrayTopic.hpp:220
std::span< int64_t > SmallRetType
Definition IntegerArrayTopic.hpp:188
int64_t SmallElemType
Definition IntegerArrayTopic.hpp:189
std::span< const int64_t > ParamType
Definition IntegerArrayTopic.hpp:186
IntegerArrayPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use IntegerArrayTopic::Publish() instead.
Definition IntegerArrayTopic.hpp:201
TimestampedIntegerArray TimestampedValueType
Definition IntegerArrayTopic.hpp:191
std::vector< int64_t > ValueType
Definition IntegerArrayTopic.hpp:185
TopicType GetTopic() const
Get the corresponding topic.
Definition IntegerArrayTopic.hpp:480
IntegerArrayPublisher()=default
NetworkTables IntegerArray subscriber.
Definition IntegerArrayTopic.hpp:34
IntegerArraySubscriber()=default
std::span< int64_t > SmallRetType
Definition IntegerArrayTopic.hpp:41
TimestampedIntegerArray TimestampedValueType
Definition IntegerArrayTopic.hpp:39
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition IntegerArrayTopic.hpp:164
TimestampedValueType GetAtomic(ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition IntegerArrayTopic.hpp:122
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition IntegerArrayTopic.hpp:110
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value along with its timestamp.
Definition IntegerArrayTopic.hpp:134
ValueType Get() const
Get the last published value.
Definition IntegerArrayTopic.hpp:65
int64_t SmallElemType
Definition IntegerArrayTopic.hpp:42
TimestampedIntegerArrayView TimestampedValueViewType
Definition IntegerArrayTopic.hpp:43
std::vector< int64_t > ValueType
Definition IntegerArrayTopic.hpp:37
TopicType GetTopic() const
Get the corresponding topic.
Definition IntegerArrayTopic.hpp:476
IntegerArrayTopic TopicType
Definition IntegerArrayTopic.hpp:36
std::span< const int64_t > ParamType
Definition IntegerArrayTopic.hpp:38
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value.
Definition IntegerArrayTopic.hpp:99
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value.
Definition IntegerArrayTopic.hpp:87
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition IntegerArrayTopic.hpp:148
IntegerArraySubscriber(NT_Subscriber handle, ParamType defaultValue)
Construct from a subscriber handle; recommended to use IntegerArrayTopic::Subscribe() instead.
Definition IntegerArrayTopic.hpp:55
ValueType Get(ParamType defaultValue) const
Get the last published value.
Definition IntegerArrayTopic.hpp:76
NetworkTables IntegerArray topic.
Definition IntegerArrayTopic.hpp:296
SubscriberType Subscribe(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic.
Definition IntegerArrayTopic.hpp:340
TimestampedIntegerArray TimestampedValueType
Definition IntegerArrayTopic.hpp:303
IntegerArrayPublisher PublisherType
Definition IntegerArrayTopic.hpp:299
SubscriberType SubscribeEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic, with specific type string.
Definition IntegerArrayTopic.hpp:364
EntryType GetEntry(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic.
Definition IntegerArrayTopic.hpp:439
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic, with specific type string.
Definition IntegerArrayTopic.hpp:467
std::vector< int64_t > ValueType
Definition IntegerArrayTopic.hpp:301
PublisherType Publish(const PubSubOptions &options=kDefaultPubSubOptions)
Create a new publisher to the topic.
Definition IntegerArrayTopic.hpp:388
IntegerArraySubscriber SubscriberType
Definition IntegerArrayTopic.hpp:298
IntegerArrayTopic()=default
IntegerArrayEntry EntryType
Definition IntegerArrayTopic.hpp:300
IntegerArrayTopic(NT_Topic handle)
Construct from a topic handle; recommended to use NetworkTableInstance::GetIntegerArrayTopic() instea...
Definition IntegerArrayTopic.hpp:315
std::span< const int64_t > ParamType
Definition IntegerArrayTopic.hpp:302
PublisherType PublishEx(std::string_view typeString, const wpi::util::json &properties, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new publisher to the topic, with type string and initial properties.
Definition IntegerArrayTopic.hpp:412
static constexpr std::string_view kTypeString
The default type string for this topic type.
Definition IntegerArrayTopic.hpp:305
IntegerArrayTopic(Topic topic)
Construct from a generic topic.
Definition IntegerArrayTopic.hpp:322
Publisher(const Publisher &)=delete
NT_Publisher m_pubHandle
NetworkTables handle.
Definition Topic.hpp:440
Subscriber(const Subscriber &)=delete
NT_Subscriber m_subHandle
Definition Topic.hpp:385
NT_Topic m_handle
Definition Topic.hpp:316
Definition BooleanTopic.hpp:24
std::vector< int64_t > GetIntegerArray(NT_Handle subentry, std::span< const int64_t > defaultValue)
Get the last published value.
bool SetDefaultIntegerArray(NT_Handle pubentry, std::span< const int64_t > defaultValue)
Publish a default value.
TimestampedIntegerArray GetAtomicIntegerArray(NT_Handle subentry, std::span< const int64_t > defaultValue)
Get the last published value along with its timestamp.
bool SetIntegerArray(NT_Handle pubentry, std::span< const int64_t > 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_INTEGER_ARRAY
Definition ntcore_c.h:62
Timestamped< std::span< int64_t > > TimestampedIntegerArrayView
Timestamped IntegerArray view (for wpi::util::SmallVector-taking functions).
Definition ntcore_cpp_types.hpp:653
Timestamped< std::vector< int64_t > > TimestampedIntegerArray
Timestamped IntegerArray.
Definition ntcore_cpp_types.hpp:647
constexpr PubSubOptions kDefaultPubSubOptions
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_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_Publisher PublishEx(NT_Topic topic, NT_Type type, std::string_view typeStr, const wpi::util::json &properties, const PubSubOptions &options=kDefaultPubSubOptions)
Creates a new publisher to a topic.
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 NTSendable.hpp:9
Definition raw_os_ostream.hpp:19
NetworkTables publish/subscribe options.
Definition ntcore_cpp.hpp:303