WPILibC++ 2023.4.3-108-ge5452e3
Integer Functions

Functions

bool nt::SetInteger (NT_Handle pubentry, int64_t value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultInteger (NT_Handle pubentry, int64_t defaultValue)
 Publish a default value. More...
 
int64_t nt::GetInteger (NT_Handle subentry, int64_t defaultValue)
 Get the last published value. More...
 
TimestampedInteger nt::GetAtomicInteger (NT_Handle subentry, int64_t defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedIntegernt::ReadQueueInteger (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< int64_t > nt::ReadQueueValuesInteger (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 

Detailed Description

Function Documentation

◆ GetAtomicInteger()

TimestampedInteger nt::GetAtomicInteger ( NT_Handle  subentry,
int64_t  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

◆ GetInteger()

int64_t nt::GetInteger ( NT_Handle  subentry,
int64_t  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

◆ ReadQueueInteger()

std::vector< TimestampedInteger > nt::ReadQueueInteger ( 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.

◆ ReadQueueValuesInteger()

std::vector< int64_t > nt::ReadQueueValuesInteger ( 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.

◆ SetDefaultInteger()

bool nt::SetDefaultInteger ( NT_Handle  pubentry,
int64_t  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

◆ SetInteger()

bool nt::SetInteger ( NT_Handle  pubentry,
int64_t  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