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