WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::nt::StructArrayPublisher< T, I > Class Template Reference

NetworkTables struct-encoded value array publisher. More...

#include <wpi/nt/StructArrayTopic.hpp>

Inheritance diagram for wpi::nt::StructArrayPublisher< T, I >:
wpi::nt::Publisher

Public Types

using TopicType = StructArrayTopic<T, I...>
using ValueType = std::vector<T>
using ParamType = std::span<const T>
using TimestampedValueType = Timestamped<ValueType>

Public Member Functions

 StructArrayPublisher ()=default
 StructArrayPublisher (NT_Publisher handle, I... info)
 Construct from a publisher handle; recommended to use StructTopic::Publish() instead.
 StructArrayPublisher (const StructArrayPublisher &)=delete
StructArrayPublisheroperator= (const StructArrayPublisher &)=delete
 StructArrayPublisher (StructArrayPublisher &&rhs)
StructArrayPublisheroperator= (StructArrayPublisher &&rhs)
template<typename U>
void Set (U &&value, int64_t time=0)
 Publish a new value.
void Set (std::span< const T > value, int64_t time=0)
 Publish a new value.
template<typename U>
void SetDefault (U &&value)
 Publish a default value.
void SetDefault (std::span< const T > value)
 Publish a default value.
TopicType GetTopic () const
 Get the corresponding topic.
Public Member Functions inherited from wpi::nt::Publisher
virtual ~Publisher ()
 Publisher (const Publisher &)=delete
Publisheroperator= (const Publisher &)=delete
 Publisher (Publisher &&rhs)
Publisheroperator= (Publisher &&rhs)
 operator bool () const
 Determines if the native handle is valid.
NT_Publisher GetHandle () const
 Gets the native handle for the publisher.
Topic GetTopic () const
 Gets the published-to topic.

Additional Inherited Members

Protected Member Functions inherited from wpi::nt::Publisher
 Publisher ()=default
 Publisher (NT_Publisher handle)
Protected Attributes inherited from wpi::nt::Publisher
NT_Publisher m_pubHandle {0}
 NetworkTables handle.

Detailed Description

template<typename T, typename... I>
requires wpi::util::StructSerializable<T, I...>
class wpi::nt::StructArrayPublisher< T, I >

NetworkTables struct-encoded value array publisher.

Member Typedef Documentation

◆ ParamType

template<typename T, typename... I>
using wpi::nt::StructArrayPublisher< T, I >::ParamType = std::span<const T>

◆ TimestampedValueType

template<typename T, typename... I>
using wpi::nt::StructArrayPublisher< T, I >::TimestampedValueType = Timestamped<ValueType>

◆ TopicType

template<typename T, typename... I>
using wpi::nt::StructArrayPublisher< T, I >::TopicType = StructArrayTopic<T, I...>

◆ ValueType

template<typename T, typename... I>
using wpi::nt::StructArrayPublisher< T, I >::ValueType = std::vector<T>

Constructor & Destructor Documentation

◆ StructArrayPublisher() [1/4]

template<typename T, typename... I>
wpi::nt::StructArrayPublisher< T, I >::StructArrayPublisher ( )
default

◆ StructArrayPublisher() [2/4]

template<typename T, typename... I>
wpi::nt::StructArrayPublisher< T, I >::StructArrayPublisher ( NT_Publisher handle,
I... info )
inlineexplicit

Construct from a publisher handle; recommended to use StructTopic::Publish() instead.

Parameters
handleNative handle
infooptional struct type info

◆ StructArrayPublisher() [3/4]

template<typename T, typename... I>
wpi::nt::StructArrayPublisher< T, I >::StructArrayPublisher ( const StructArrayPublisher< T, I > & )
delete

◆ StructArrayPublisher() [4/4]

template<typename T, typename... I>
wpi::nt::StructArrayPublisher< T, I >::StructArrayPublisher ( StructArrayPublisher< T, I > && rhs)
inline

Member Function Documentation

◆ GetTopic()

template<typename T, typename... I>
TopicType wpi::nt::StructArrayPublisher< T, I >::GetTopic ( ) const
inline

Get the corresponding topic.

Returns
Topic

◆ operator=() [1/2]

template<typename T, typename... I>
StructArrayPublisher & wpi::nt::StructArrayPublisher< T, I >::operator= ( const StructArrayPublisher< T, I > & )
delete

◆ operator=() [2/2]

template<typename T, typename... I>
StructArrayPublisher & wpi::nt::StructArrayPublisher< T, I >::operator= ( StructArrayPublisher< T, I > && rhs)
inline

◆ Set() [1/2]

template<typename T, typename... I>
void wpi::nt::StructArrayPublisher< T, I >::Set ( std::span< const T > value,
int64_t time = 0 )
inline

Publish a new value.

Parameters
valuevalue to publish
timetimestamp; 0 indicates current NT time should be used

◆ Set() [2/2]

template<typename T, typename... I>
template<typename U>
void wpi::nt::StructArrayPublisher< T, I >::Set ( U && value,
int64_t time = 0 )
inline

Publish a new value.

Parameters
valuevalue to publish
timetimestamp; 0 indicates current NT time should be used

◆ SetDefault() [1/2]

template<typename T, typename... I>
void wpi::nt::StructArrayPublisher< T, I >::SetDefault ( std::span< const T > value)
inline

Publish a default value.

On reconnect, a default value will never be used in preference to a published value.

Parameters
valuevalue

◆ SetDefault() [2/2]

template<typename T, typename... I>
template<typename U>
void wpi::nt::StructArrayPublisher< T, I >::SetDefault ( U && value)
inline

Publish a default value.

On reconnect, a default value will never be used in preference to a published value.

Parameters
valuevalue

The documentation for this class was generated from the following file: