NetworkTables struct-encoded value array subscriber.
More...
#include <networktables/StructArrayTopic.h>
template<typename T, typename... I>
requires
wpi::StructSerializable<T, I...>
class nt::StructArraySubscriber< T, I >
NetworkTables struct-encoded value array subscriber.
◆ ParamType
template<typename T , typename... I>
◆ TimestampedValueType
template<typename T , typename... I>
◆ TopicType
template<typename T , typename... I>
◆ ValueType
template<typename T , typename... I>
◆ StructArraySubscriber() [1/2]
template<typename T , typename... I>
◆ StructArraySubscriber() [2/2]
template<typename T , typename... I>
template<typename U >
Construct from a subscriber handle; recommended to use StructTopic::Subscribe() instead.
- Parameters
-
handle | Native handle |
defaultValue | Default value |
info | optional struct type info |
◆ Get() [1/3]
template<typename T , typename... I>
Get the last published value.
If no value has been published or the value cannot be unpacked, returns the stored default value.
- Returns
- value
◆ Get() [2/3]
template<typename T , typename... I>
Get the last published value.
If no value has been published or the value cannot be unpacked, returns the passed defaultValue.
- Parameters
-
defaultValue | default value to return if no value has been published |
- Returns
- value
◆ Get() [3/3]
template<typename T , typename... I>
template<typename U >
Get the last published value.
If no value has been published or the value cannot be unpacked, returns the passed defaultValue.
- Parameters
-
defaultValue | default value to return if no value has been published |
- Returns
- value
◆ GetAtomic() [1/3]
template<typename T , typename... I>
Get the last published value along with its timestamp If no value has been published or the value cannot be unpacked, returns the stored default value and a timestamp of 0.
- Returns
- timestamped value
◆ GetAtomic() [2/3]
template<typename T , typename... I>
Get the last published value along with its timestamp.
If no value has been published or the value cannot be unpacked, returns the passed defaultValue and a timestamp of 0.
- Parameters
-
defaultValue | default value to return if no value has been published |
- Returns
- timestamped value
◆ GetAtomic() [3/3]
template<typename T , typename... I>
template<typename U >
Get the last published value along with its timestamp.
If no value has been published or the value cannot be unpacked, returns the passed defaultValue and a timestamp of 0.
- Parameters
-
defaultValue | default value to return if no value has been published |
- Returns
- timestamped value
◆ GetTopic()
template<typename T , typename... I>
Get the corresponding topic.
- Returns
- Topic
◆ ReadQueue()
template<typename T , typename... I>
Get an array of all valid value changes since the last call to ReadQueue.
Also provides a timestamp for each value. Values that cannot be unpacked are dropped.
- Note
- The "poll storage" subscribe option can be used to set the queue depth.
- Returns
- Array of timestamped values; empty array if no valid new changes have been published since the previous call.
The documentation for this class was generated from the following file: