WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
wpi::PackCallback< T > Class Template Reference

A callback method that will pack elements when called. More...

#include <wpi/protobuf/ProtobufCallbacks.h>

Public Member Functions

 PackCallback (std::span< const T > buffer)
 Constructs a pack callback from a span of elements.
 
 PackCallback (const T *element)
 Constructs a pack callback from a pointer to a single element.
 
 PackCallback (const PackCallback &)=delete
 
 PackCallback (PackCallback &&)=delete
 
PackCallbackoperator= (const PackCallback &)=delete
 
PackCallbackoperator= (PackCallback &&)=delete
 
pb_callback_t Callback () const
 Gets the nanopb callback pointing to this object.
 
std::span< const T > Bufs () const
 Gets a span pointing to the items.
 

Detailed Description

template<ProtoCallbackPackable T>
class wpi::PackCallback< T >

A callback method that will pack elements when called.

Template Parameters
Tobject type

Constructor & Destructor Documentation

◆ PackCallback() [1/4]

template<ProtoCallbackPackable T>
wpi::PackCallback< T >::PackCallback ( std::span< const T > buffer)
inlineexplicit

Constructs a pack callback from a span of elements.

The elements in the buffer MUST stay alive throughout the entire encode call.

◆ PackCallback() [2/4]

template<ProtoCallbackPackable T>
wpi::PackCallback< T >::PackCallback ( const T * element)
inlineexplicit

Constructs a pack callback from a pointer to a single element.

This element MUST stay alive throughout the entire encode call. Do not pass a temporary here (This is why its a pointer and not a reference)

◆ PackCallback() [3/4]

template<ProtoCallbackPackable T>
wpi::PackCallback< T >::PackCallback ( const PackCallback< T > & )
delete

◆ PackCallback() [4/4]

template<ProtoCallbackPackable T>
wpi::PackCallback< T >::PackCallback ( PackCallback< T > && )
delete

Member Function Documentation

◆ Bufs()

template<ProtoCallbackPackable T>
std::span< const T > wpi::PackCallback< T >::Bufs ( ) const
inline

Gets a span pointing to the items.

Returns
span

◆ Callback()

template<ProtoCallbackPackable T>
pb_callback_t wpi::PackCallback< T >::Callback ( ) const
inline

Gets the nanopb callback pointing to this object.

Returns
nanopb callback

◆ operator=() [1/2]

template<ProtoCallbackPackable T>
PackCallback & wpi::PackCallback< T >::operator= ( const PackCallback< T > & )
delete

◆ operator=() [2/2]

template<ProtoCallbackPackable T>
PackCallback & wpi::PackCallback< T >::operator= ( PackCallback< T > && )
delete

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