WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
wpi::WpiArrayUnpackCallback< T, N > Struct Template Reference

A DirectUnpackCallback backed by a wpi::array<T, N>. More...

#include <wpi/protobuf/ProtobufCallbacks.h>

Inheritance diagram for wpi::WpiArrayUnpackCallback< T, N >:
wpi::DirectUnpackCallback< T, WpiArrayEmplaceWrapper< T, N >, N >

Public Member Functions

 WpiArrayUnpackCallback ()
 Constructs a WpiArrayUnpackCallback.
 
bool IsFull () const noexcept
 Returns if the buffer is completely filled up.
 
size_t Size () const noexcept
 Returns the number of elements in the buffer.
 
wpi::array< T, N > & Array () noexcept
 Returns a reference to the backing array.
 
- Public Member Functions inherited from wpi::DirectUnpackCallback< T, WpiArrayEmplaceWrapper< T, N >, N >
 DirectUnpackCallback (WpiArrayEmplaceWrapper< T, N > &storage)
 Constructs a callback from a vector like type.
 
 DirectUnpackCallback (const DirectUnpackCallback &)=delete
 
 DirectUnpackCallback (DirectUnpackCallback &&)=delete
 
DirectUnpackCallbackoperator= (const DirectUnpackCallback &)=delete
 
DirectUnpackCallbackoperator= (DirectUnpackCallback &&)=delete
 
void SetLimits (DecodeLimits limit) noexcept
 Set the limits on what happens if more elements exist in the buffer then expected.
 
pb_callback_t Callback () const
 Gets the nanopb callback pointing to this object.
 

Detailed Description

template<ProtoCallbackUnpackable T, size_t N>
struct wpi::WpiArrayUnpackCallback< T, N >

A DirectUnpackCallback backed by a wpi::array<T, N>.

Any elements in the packed buffer past N will be cause decoding to fail.

Template Parameters
Tobject type
Nsmall vector small size/number of expected elements

Constructor & Destructor Documentation

◆ WpiArrayUnpackCallback()

template<ProtoCallbackUnpackable T, size_t N>
wpi::WpiArrayUnpackCallback< T, N >::WpiArrayUnpackCallback ( )
inline

Constructs a WpiArrayUnpackCallback.

Member Function Documentation

◆ Array()

template<ProtoCallbackUnpackable T, size_t N>
wpi::array< T, N > & wpi::WpiArrayUnpackCallback< T, N >::Array ( )
inlinenoexcept

Returns a reference to the backing array.

Returns
array reference

◆ IsFull()

template<ProtoCallbackUnpackable T, size_t N>
bool wpi::WpiArrayUnpackCallback< T, N >::IsFull ( ) const
inlinenoexcept

Returns if the buffer is completely filled up.

Returns
true if buffer is full

◆ Size()

template<ProtoCallbackUnpackable T, size_t N>
size_t wpi::WpiArrayUnpackCallback< T, N >::Size ( ) const
inlinenoexcept

Returns the number of elements in the buffer.

Returns
number of elements

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