mitteLib
Loading...
Searching...
No Matches
byte_order.hpp File Reference
#include <cstdint>
#include <tuple>
#include <type_traits>
Include dependency graph for byte_order.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  mlab
 
namespace  mlab::impl
 

Typedefs

template<unsigned Bits>
using mlab::uint_least_t = decltype(impl::get_uint_least<Bits>())
 
template<unsigned Bits>
using mlab::uint_exact_t = decltype(impl::get_uint_exact<Bits>())
 

Enumerations

enum struct  mlab::byte_order { mlab::msb_first , mlab::lsb_first }
 

Functions

template<unsigned Bits>
auto mlab::impl::get_uint_exact ()
 
template<unsigned Bits>
auto mlab::impl::get_uint_least ()
 
template<byte_order Order, unsigned Bits, class Num >
std::array< std::uint8_t, Bits/8 > mlab::encode (Num n)
 
template<byte_order Order, unsigned Bits, class Num >
Num mlab::decode (std::array< std::uint8_t, Bits/8 > const &b)
 
template<class Num , std::size_t NBytes>
constexpr Num mlab::lsb_unsigned_decode (std::array< std::uint8_t, NBytes > b)
 
template<class Num , std::size_t NBytes, std::size_t I = NBytes - 1>
constexpr Num mlab::msb_unsigned_decode (std::array< std::uint8_t, NBytes > b)
 
template<class Num , std::size_t NBytes>
constexpr std::array< std::uint8_t, NBytes > mlab::lsb_unsigned_encode (Num n)
 
template<class Num , std::size_t NBytes>
constexpr std::array< std::uint8_t, NBytes > mlab::msb_unsigned_encode (Num n)
 
template<class Num , std::size_t NBytes>
constexpr Num mlab::msb_unsigned_decode (std::array< std::uint8_t, NBytes > b)