WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
DoubleArray Functions

Functions

bool wpi::nt::SetDoubleArray (NT_Handle pubentry, std::span< const double > value, int64_t time=0)
 Publish a new value.
bool wpi::nt::SetDefaultDoubleArray (NT_Handle pubentry, std::span< const double > defaultValue)
 Publish a default value.
std::vector< double > wpi::nt::GetDoubleArray (NT_Handle subentry, std::span< const double > defaultValue)
 Get the last published value.
TimestampedDoubleArray wpi::nt::GetAtomicDoubleArray (NT_Handle subentry, std::span< const double > defaultValue)
 Get the last published value along with its timestamp.
std::vector< TimestampedDoubleArraywpi::nt::ReadQueueDoubleArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue.
std::vector< std::vector< double > > wpi::nt::ReadQueueValuesDoubleArray (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue.
std::span< double > wpi::nt::GetDoubleArray (NT_Handle subentry, wpi::util::SmallVectorImpl< double > &buf, std::span< const double > defaultValue)
TimestampedDoubleArrayView wpi::nt::GetAtomicDoubleArray (NT_Handle subentry, wpi::util::SmallVectorImpl< double > &buf, std::span< const double > defaultValue)

Detailed Description

Function Documentation

◆ GetAtomicDoubleArray() [1/2]

TimestampedDoubleArray wpi::nt::GetAtomicDoubleArray ( NT_Handle subentry,
std::span< const double > 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

◆ GetAtomicDoubleArray() [2/2]

TimestampedDoubleArrayView wpi::nt::GetAtomicDoubleArray ( NT_Handle subentry,
wpi::util::SmallVectorImpl< double > & buf,
std::span< const double > defaultValue )

◆ GetDoubleArray() [1/2]

std::vector< double > wpi::nt::GetDoubleArray ( NT_Handle subentry,
std::span< const double > 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

◆ GetDoubleArray() [2/2]

std::span< double > wpi::nt::GetDoubleArray ( NT_Handle subentry,
wpi::util::SmallVectorImpl< double > & buf,
std::span< const double > defaultValue )

◆ ReadQueueDoubleArray()

std::vector< TimestampedDoubleArray > wpi::nt::ReadQueueDoubleArray ( 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.

◆ ReadQueueValuesDoubleArray()

std::vector< std::vector< double > > wpi::nt::ReadQueueValuesDoubleArray ( 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.

◆ SetDefaultDoubleArray()

bool wpi::nt::SetDefaultDoubleArray ( NT_Handle pubentry,
std::span< const double > 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

◆ SetDoubleArray()

bool wpi::nt::SetDoubleArray ( NT_Handle pubentry,
std::span< const double > 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