WPILibC++ 2023.4.3-108-ge5452e3
BooleanArray Functions

Functions

bool nt::SetBooleanArray (NT_Handle pubentry, std::span< const int > value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultBooleanArray (NT_Handle pubentry, std::span< const int > defaultValue)
 Publish a default value. More...
 
std::vector< int > nt::GetBooleanArray (NT_Handle subentry, std::span< const int > defaultValue)
 Get the last published value. More...
 
TimestampedBooleanArray nt::GetAtomicBooleanArray (NT_Handle subentry, std::span< const int > defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedBooleanArraynt::ReadQueueBooleanArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< std::vector< int > > nt::ReadQueueValuesBooleanArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::span< int > nt::GetBooleanArray (NT_Handle subentry, wpi::SmallVectorImpl< int > &buf, std::span< const int > defaultValue)
 
TimestampedBooleanArrayView nt::GetAtomicBooleanArray (NT_Handle subentry, wpi::SmallVectorImpl< int > &buf, std::span< const int > defaultValue)
 

Detailed Description

Function Documentation

◆ GetAtomicBooleanArray() [1/2]

TimestampedBooleanArray nt::GetAtomicBooleanArray ( NT_Handle  subentry,
std::span< const int >  defaultValue 
)

Get the last published value along with its timestamp.

If no value has been published, returns the passed defaultValue and a timestamp of 0.

Parameters
subentrysubscriber or entry handle
defaultValuedefault value to return if no value has been published
Returns
timestamped value

◆ GetAtomicBooleanArray() [2/2]

TimestampedBooleanArrayView nt::GetAtomicBooleanArray ( NT_Handle  subentry,
wpi::SmallVectorImpl< int > &  buf,
std::span< const int >  defaultValue 
)

◆ GetBooleanArray() [1/2]

std::vector< int > nt::GetBooleanArray ( NT_Handle  subentry,
std::span< const int >  defaultValue 
)

Get the last published value.

If no value has been published, returns the passed defaultValue.

Parameters
subentrysubscriber or entry handle
defaultValuedefault value to return if no value has been published
Returns
value

◆ GetBooleanArray() [2/2]

std::span< int > nt::GetBooleanArray ( NT_Handle  subentry,
wpi::SmallVectorImpl< int > &  buf,
std::span< const int >  defaultValue 
)

◆ ReadQueueBooleanArray()

std::vector< TimestampedBooleanArray > nt::ReadQueueBooleanArray ( NT_Handle  subentry)

Get an array of all value changes since the last call to ReadQueue.

Also provides a timestamp for each value.

Note
The "poll storage" subscribe option can be used to set the queue depth.
Parameters
subentrysubscriber or entry handle
Returns
Array of timestamped values; empty array if no new changes have been published since the previous call.

◆ ReadQueueValuesBooleanArray()

std::vector< std::vector< int > > nt::ReadQueueValuesBooleanArray ( NT_Handle  subentry)

Get an array of all value changes since the last call to ReadQueue.

Note
The "poll storage" subscribe option can be used to set the queue depth.
Parameters
subentrysubscriber or entry handle
Returns
Array of values; empty array if no new changes have been published since the previous call.

◆ SetBooleanArray()

bool nt::SetBooleanArray ( NT_Handle  pubentry,
std::span< const int >  value,
int64_t  time = 0 
)

Publish a new value.

Parameters
pubentrypublisher or entry handle
valuevalue to publish
timetimestamp; 0 indicates current NT time should be used

◆ SetDefaultBooleanArray()

bool nt::SetDefaultBooleanArray ( NT_Handle  pubentry,
std::span< const int >  defaultValue 
)

Publish a default value.

On reconnect, a default value will never be used in preference to a published value.

Parameters
pubentrypublisher or entry handle
defaultValuedefault value