WPILibC++ 2024.1.1-beta-4
nt::StructArrayPublisher< T > Class Template Reference

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

#include <networktables/StructArrayTopic.h>

Inheritance diagram for nt::StructArrayPublisher< T >:
nt::Publisher nt::StructArrayEntry< T >

Public Types

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

Public Member Functions

 StructArrayPublisher ()=default
 
 StructArrayPublisher (NT_Publisher handle)
 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}
 

Detailed Description

template<wpi::StructSerializable T>
class nt::StructArrayPublisher< T >

NetworkTables struct-encoded value array publisher.

Member Typedef Documentation

◆ ParamType

using nt::StructArrayPublisher< T >::ParamType = std::span<const T>

◆ TimestampedValueType

using nt::StructArrayPublisher< T >::TimestampedValueType = Timestamped<ValueType>

◆ TopicType

using nt::StructArrayPublisher< T >::TopicType = StructArrayTopic<T>

◆ ValueType

using nt::StructArrayPublisher< T >::ValueType = std::vector<T>

Constructor & Destructor Documentation

◆ StructArrayPublisher() [1/4]

nt::StructArrayPublisher< T >::StructArrayPublisher ( )
default

◆ StructArrayPublisher() [2/4]

nt::StructArrayPublisher< T >::StructArrayPublisher ( NT_Publisher  handle)
inlineexplicit

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

Parameters
handleNative handle

◆ StructArrayPublisher() [3/4]

nt::StructArrayPublisher< T >::StructArrayPublisher ( const StructArrayPublisher< T > &  )
delete

◆ StructArrayPublisher() [4/4]

nt::StructArrayPublisher< T >::StructArrayPublisher ( StructArrayPublisher< T > &&  rhs)
inline

Member Function Documentation

◆ GetTopic()

TopicType nt::StructArrayPublisher< T >::GetTopic ( ) const
inline

Get the corresponding topic.

Returns
Topic

◆ operator=() [1/2]

StructArrayPublisher & nt::StructArrayPublisher< T >::operator= ( const StructArrayPublisher< T > &  )
delete

◆ operator=() [2/2]

StructArrayPublisher & nt::StructArrayPublisher< T >::operator= ( StructArrayPublisher< T > &&  rhs)
inline

◆ Set() [1/2]

void nt::StructArrayPublisher< T >::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 U >
void nt::StructArrayPublisher< T >::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]

void nt::StructArrayPublisher< T >::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 U >
void nt::StructArrayPublisher< T >::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: