nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
nros::LeSpan< T > Struct Template Reference

#include <span.hpp>

Public Member Functions

constexpr bool empty () const
 True if the view contains zero elements.
 
T operator[] (size_t i) const
 
constexpr size_t size () const
 Number of elements.
 

Public Attributes

const uint8_tbytes
 Pointer to the first element's little-endian bytes. Borrowed.
 
size_t count
 Number of elements.
 

Detailed Description

template<typename T>
struct nros::LeSpan< T >

Alignment-agnostic view over a little-endian numeric sequence in the CDR receive buffer (RFC-0033 borrowed mode — the C++ analogue of Rust's nros_core::LeSliceView and C's nros_le_slice_view_*).

T is a fixed-width numeric (uint16_t, float, …). The raw LE bytes are borrowed zero-copy; operator[] decodes one element by value (no T* is ever formed into the unaligned buffer), so the buffer base need not be T-aligned. The pointer is valid only while the source buffer lives.

Member Function Documentation

◆ empty()

template<typename T >
constexpr bool nros::LeSpan< T >::empty ( ) const
inlineconstexpr

True if the view contains zero elements.

◆ operator[]()

template<typename T >
T nros::LeSpan< T >::operator[] ( size_t  i) const
inline

Decode element i (little-endian → host); no bounds check, no alignment assumption.

◆ size()

template<typename T >
constexpr size_t nros::LeSpan< T >::size ( ) const
inlineconstexpr

Number of elements.

Member Data Documentation

◆ bytes

template<typename T >
const uint8_t* nros::LeSpan< T >::bytes

Pointer to the first element's little-endian bytes. Borrowed.

◆ count

template<typename T >
size_t nros::LeSpan< T >::count

Number of elements.


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