NetworkTables struct-encoded value subscriber.
More...
#include <networktables/StructTopic.h>
NetworkTables struct-encoded value 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>
◆ StructSubscriber() [1/2]
template<typename T , typename... I>
◆ StructSubscriber() [2/2]
template<typename T , typename... I>
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/2]
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/2]
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
◆ GetAtomic() [1/2]
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/2]
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
◆ GetInto()
template<typename T , typename... I>
Get the last published value, replacing the contents in place of an existing object.
If no value has been published or the value cannot be unpacked, does not replace the contents and returns false.
- Parameters
-
[out] | out | object to replace contents of |
- Returns
- true if successful
◆ 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: