WPILibC++ 2024.3.2
nt::StructArrayPublisher< T, I > Class Template Reference

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

#include <networktables/StructArrayTopic.h>

Inheritance diagram for nt::StructArrayPublisher< T, I >:
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. More...
 
 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. More...
 
void Set (std::span< const T > value, int64_t time=0)
 Publish a new value. More...
 
template<typename U >
void SetDefault (U &&value)
 Publish a default value. More...
 
void SetDefault (std::span< const T > value)
 Publish a default value. More...
 
TopicType GetTopic () const
 Get the corresponding topic. More...
 
- Public Member Functions inherited from nt::Publisher
virtual ~Publisher ()
 
 Publisher (const Publisher &)=delete
 
Publisheroperator= (const Publisher &)=delete
 
 Publisher (Publisher &&)
 
Publisheroperator= (Publisher &&)
 
 operator bool () const
 Determines if the native handle is valid. More...
 
NT_Publisher GetHandle () const
 Gets the native handle for the publisher. More...
 
Topic GetTopic () const
 Gets the published-to topic. More...
 

Additional Inherited Members

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

Detailed Description

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

NetworkTables struct-encoded value array publisher.

Member Typedef Documentation

◆ ParamType

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

◆ TimestampedValueType

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

◆ TopicType

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

◆ ValueType

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

Constructor & Destructor Documentation

◆ StructArrayPublisher() [1/4]

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

◆ StructArrayPublisher() [2/4]

template<typename T , typename... I>
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>
nt::StructArrayPublisher< T, I >::StructArrayPublisher ( const StructArrayPublisher< T, I > &  )
delete

◆ StructArrayPublisher() [4/4]

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

Member Function Documentation

◆ GetTopic()

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

Get the corresponding topic.

Returns
Topic

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Set() [1/2]

template<typename T , typename... I>
void 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 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 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 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: