QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
LittleEndian.h File Reference
#include <bit>
#include <concepts>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <optional>
#include <span>
#include <type_traits>
+ Include dependency graph for LittleEndian.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  LittleEndian
 

Concepts

concept  LittleEndian::Scalar
 

Typedefs

template<Scalar T>
using LittleEndian::Bits = std::conditional_t< sizeof(T)==1, uint8_t, std::conditional_t< sizeof(T)==2, uint16_t, std::conditional_t< sizeof(T)==4, uint32_t, uint64_t > > >
 

Functions

template<Scalar T>
constexpr std::optional< T > LittleEndian::read (std::span< const uint8_t > bytes, std::size_t offset=0)
 Decode an unaligned little-endian scalar, returning nullopt when its bytes are unavailable.
 
template<Scalar T>
constexpr bool LittleEndian::write (std::span< uint8_t > bytes, std::size_t offset, T value)
 Encode an unaligned little-endian scalar. Insufficient space leaves the destination unchanged.