57 m_defaultValue{defaultValue.begin(), defaultValue.end()} {}
66 return Get(m_defaultValue);
77 return ::wpi::nt::GetBooleanArray(
m_subHandle, defaultValue);
88 return Get(buf, m_defaultValue);
123 return ::wpi::nt::GetAtomicBooleanArray(
m_subHandle, defaultValue);
165 return ::wpi::nt::ReadQueueBooleanArray(
m_subHandle);
365 std::string_view typeString,
ParamType defaultValue,
NetworkTables BooleanArray entry.
Definition BooleanArrayTopic.hpp:238
std::span< int > SmallRetType
Definition BooleanArrayTopic.hpp:246
TimestampedBooleanArray TimestampedValueType
Definition BooleanArrayTopic.hpp:249
BooleanArrayEntry(NT_Entry handle, ParamType defaultValue)
Construct from an entry handle; recommended to use BooleanArrayTopic::GetEntry() instead.
Definition BooleanArrayTopic.hpp:260
TopicType GetTopic() const
Get the corresponding topic.
Definition BooleanArrayTopic.hpp:484
NT_Entry GetHandle() const
Gets the native handle for the entry.
Definition BooleanArrayTopic.hpp:276
BooleanArraySubscriber SubscriberType
Definition BooleanArrayTopic.hpp:240
int SmallElemType
Definition BooleanArrayTopic.hpp:247
BooleanArrayTopic TopicType
Definition BooleanArrayTopic.hpp:242
BooleanArrayEntry()=default
std::span< const int > ParamType
Definition BooleanArrayTopic.hpp:244
BooleanArrayPublisher PublisherType
Definition BooleanArrayTopic.hpp:241
void Unpublish()
Stops publishing the entry if it's published.
Definition BooleanArrayTopic.hpp:288
std::vector< int > ValueType
Definition BooleanArrayTopic.hpp:243
NetworkTables BooleanArray publisher.
Definition BooleanArrayTopic.hpp:182
std::span< int > SmallRetType
Definition BooleanArrayTopic.hpp:188
TopicType GetTopic() const
Get the corresponding topic.
Definition BooleanArrayTopic.hpp:480
std::span< const int > ParamType
Definition BooleanArrayTopic.hpp:186
BooleanArrayTopic TopicType
Definition BooleanArrayTopic.hpp:184
BooleanArrayPublisher()=default
void SetDefault(ParamType value)
Publish a default value.
Definition BooleanArrayTopic.hpp:220
void Set(ParamType value, int64_t time=0)
Publish a new value.
Definition BooleanArrayTopic.hpp:209
BooleanArrayPublisher(NT_Publisher handle)
Construct from a publisher handle; recommended to use BooleanArrayTopic::Publish() instead.
Definition BooleanArrayTopic.hpp:201
TimestampedBooleanArray TimestampedValueType
Definition BooleanArrayTopic.hpp:191
int SmallElemType
Definition BooleanArrayTopic.hpp:189
std::vector< int > ValueType
Definition BooleanArrayTopic.hpp:185
NetworkTables BooleanArray subscriber.
Definition BooleanArrayTopic.hpp:34
BooleanArraySubscriber()=default
int SmallElemType
Definition BooleanArrayTopic.hpp:42
std::vector< TimestampedValueType > ReadQueue()
Get an array of all value changes since the last call to ReadQueue.
Definition BooleanArrayTopic.hpp:164
std::span< int > SmallRetType
Definition BooleanArrayTopic.hpp:41
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value.
Definition BooleanArrayTopic.hpp:99
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf, ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition BooleanArrayTopic.hpp:148
SmallRetType Get(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value.
Definition BooleanArrayTopic.hpp:87
ValueType Get() const
Get the last published value.
Definition BooleanArrayTopic.hpp:65
BooleanArraySubscriber(NT_Subscriber handle, ParamType defaultValue)
Construct from a subscriber handle; recommended to use BooleanArrayTopic::Subscribe() instead.
Definition BooleanArrayTopic.hpp:55
TimestampedValueType GetAtomic() const
Get the last published value along with its timestamp If no value has been published,...
Definition BooleanArrayTopic.hpp:110
std::vector< int > ValueType
Definition BooleanArrayTopic.hpp:37
BooleanArrayTopic TopicType
Definition BooleanArrayTopic.hpp:36
TimestampedValueType GetAtomic(ParamType defaultValue) const
Get the last published value along with its timestamp.
Definition BooleanArrayTopic.hpp:122
TimestampedBooleanArray TimestampedValueType
Definition BooleanArrayTopic.hpp:39
ValueType Get(ParamType defaultValue) const
Get the last published value.
Definition BooleanArrayTopic.hpp:76
TimestampedBooleanArrayView TimestampedValueViewType
Definition BooleanArrayTopic.hpp:43
TopicType GetTopic() const
Get the corresponding topic.
Definition BooleanArrayTopic.hpp:476
TimestampedValueViewType GetAtomic(wpi::util::SmallVectorImpl< SmallElemType > &buf) const
Get the last published value along with its timestamp.
Definition BooleanArrayTopic.hpp:134
std::span< const int > ParamType
Definition BooleanArrayTopic.hpp:38
NetworkTables BooleanArray topic.
Definition BooleanArrayTopic.hpp:296
BooleanArraySubscriber SubscriberType
Definition BooleanArrayTopic.hpp:298
BooleanArrayEntry EntryType
Definition BooleanArrayTopic.hpp:300
BooleanArrayTopic(Topic topic)
Construct from a generic topic.
Definition BooleanArrayTopic.hpp:322
BooleanArrayPublisher PublisherType
Definition BooleanArrayTopic.hpp:299
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic, with specific type string.
Definition BooleanArrayTopic.hpp:467
SubscriberType SubscribeEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic, with specific type string.
Definition BooleanArrayTopic.hpp:364
SubscriberType Subscribe(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new subscriber to the topic.
Definition BooleanArrayTopic.hpp:340
TimestampedBooleanArray TimestampedValueType
Definition BooleanArrayTopic.hpp:303
PublisherType Publish(const PubSubOptions &options=kDefaultPubSubOptions)
Create a new publisher to the topic.
Definition BooleanArrayTopic.hpp:388
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 BooleanArrayTopic.hpp:412
EntryType GetEntry(ParamType defaultValue, const PubSubOptions &options=kDefaultPubSubOptions)
Create a new entry for the topic.
Definition BooleanArrayTopic.hpp:439
std::span< const int > ParamType
Definition BooleanArrayTopic.hpp:302
BooleanArrayTopic(NT_Topic handle)
Construct from a topic handle; recommended to use NetworkTableInstance::GetBooleanArrayTopic() instea...
Definition BooleanArrayTopic.hpp:315
static constexpr std::string_view kTypeString
The default type string for this topic type.
Definition BooleanArrayTopic.hpp:305
BooleanArrayTopic()=default
std::vector< int > ValueType
Definition BooleanArrayTopic.hpp:301
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
TimestampedBooleanArray GetAtomicBooleanArray(NT_Handle subentry, std::span< const int > defaultValue)
Get the last published value along with its timestamp.
bool SetDefaultBooleanArray(NT_Handle pubentry, std::span< const int > defaultValue)
Publish a default value.
std::vector< int > GetBooleanArray(NT_Handle subentry, std::span< const int > defaultValue)
Get the last published value.
bool SetBooleanArray(NT_Handle pubentry, std::span< const int > 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_BOOLEAN_ARRAY
Definition ntcore_c.h:56
Timestamped< std::vector< int > > TimestampedBooleanArray
Timestamped BooleanArray.
Definition ntcore_cpp_types.hpp:555
Timestamped< std::span< int > > TimestampedBooleanArrayView
Timestamped BooleanArray view (for wpi::util::SmallVector-taking functions).
Definition ntcore_cpp_types.hpp:561
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