Package edu.wpi.first.networktables
Interface StructArraySubscriber<T>
- Type Parameters:
T
- value class
- All Superinterfaces:
AutoCloseable
,PubSub
,Subscriber
,Supplier<T[]>
- All Known Subinterfaces:
StructArrayEntry<T>
public interface StructArraySubscriber<T> extends Subscriber, Supplier<T[]>
NetworkTables struct-encoded array value subscriber.
-
Method Summary
Modifier and Type Method Description T[]
get()
Get the last published value.T[]
get(T[] defaultValue)
Get the last published value.TimestampedObject<T[]>
getAtomic()
Get the last published value along with its timestamp.TimestampedObject<T[]>
getAtomic(T[] defaultValue)
Get the last published value along with its timestamp.StructArrayTopic<T>
getTopic()
Get the corresponding topic.TimestampedObject<T[]>[]
readQueue()
Get an array of all valid value changes since the last call to readQueue.T[][]
readQueueValues()
Get an array of all valid value changes since the last call to readQueue.
-
Method Details
-
getTopic
Get the corresponding topic. -
get
Get the last published value. If no value has been published or the value cannot be unpacked, returns the stored default value. -
get
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
TimestampedObject<T[]> getAtomic()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
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
-
readQueue
TimestampedObject<T[]>[] readQueue()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.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.
-
readQueueValues
T[][] readQueueValues()Get an array of all valid value changes since the last call to readQueue. Values that cannot be unpacked are dropped.The "poll storage" subscribe option can be used to set the queue depth.
- Returns:
- Array of values; empty array if no valid new changes have been published since the previous call.
-