CppSerdes  1.0
A serialization/deserialization library designed with embedded systems in mind
bitcpy_from_array.h File Reference

Defines serialization functions in the form of: size_t bitcpy(T1 dest[], const T2 source, const size_t bit_offset, const size_t bits) More...

#include "bitcpy_common.h"
#include <memory>

Go to the source code of this file.

Namespaces

 serdes
 CppSerdes library namespace.
 

Functions

template<typename T_array , typename T_val , detail::requires_unsigned_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11 size_t serdes::bitcpy (T_val &dest, const T_array *const source, const size_t bit_offset=0, const size_t bits=detail::default_bitsize< T_val >::value) noexcept
 [[deserialize, uint destination]] copies the specified number of bits from an array into a value More...
 
template<typename T_array , typename T_val , detail::requires_small_non_integral_type< T_val > * = nullptr>
size_t serdes::bitcpy (T_val &dest, const T_array *const source, const size_t bit_offset=0, const size_t bits=detail::default_bitsize< T_val >::value) noexcept
 [[deserialize, integral value <= 8 bytes destination]] copies the specified number of bits from an array into a integral value with <= 8 bytes More...
 
template<typename T_array , typename T_val , detail::requires_unsigned_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11 size_t serdes::bitcpy (sized_pointer< T_val > &dest, const T_array *const source, const size_t bit_offset, const size_t bits) noexcept
 [[deserialize, partial sized_pointer destination]] copies the specified number of bits from an array into a sized_pointer array (no default bits, since it can't necessarily be known at compile time) More...
 
template<typename T_array , typename T_val , detail::requires_unsigned_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11 size_t serdes::bitcpy (sized_pointer< T_val > &dest, const T_array *const source, const size_t bit_offset=0) noexcept
 [[deserialize, entire sized_pointer destination]] copies the specified number of bits from an array into a sized_pointer array using a bit length equal to the entire bit capacity of the sized_pointer object. More...
 
template<typename T_array = void, typename T_val = void, detail::requires_not_a_pointer_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11 size_t serdes::bitcpy (T_val &dest, const sized_pointer< T_array > source, size_t bit_offset=0, const size_t bits=detail::default_bitsize< T_val >::value) noexcept
 [[deserialize, size safe]] copies the specified number of bits from an sized_pointer into a value. used to prevent reading beyond the boundary of the source array. More...
 
template<typename T_array = void, typename T_val = void, detail::requires_pointer_type< T_val > * = nullptr>
size_t serdes::bitcpy (T_val &dest, const sized_pointer< T_array > source, const size_t bit_offset=0, const size_t bits=detail::default_bitsize< T_val >::value) noexcept
 [[deserialize, size safe, pointer dest]] copies the specified number of bits from an sized_pointer into a value. used to prevent reading beyond the boundary of the source array. More...
 
template<typename T_array , typename T_val >
size_t serdes::bitcpy (std::atomic< T_val > &dest, const T_array *const source, const size_t bit_offset=0, const size_t bits=detail::default_bitsize< T_val >::value) noexcept
 [[deserialize, atomic dest]] copies the specified number of bits from an array into an atomic value More...
 
template<typename T_val = void>
CONSTEXPR_ABOVE_CPP11 size_t serdes::bitcpy (T_val &dest, const sized_pointer< void > &source, const size_t bit_offset=0, const size_t bits=detail::default_bitsize< T_val >::value) noexcept
 [[deserialize, size safe, type punned (void) source array]] copies the specified number of bits from an array with a runtime determined base type into a value More...
 

Detailed Description

Defines serialization functions in the form of: size_t bitcpy(T1 dest[], const T2 source, const size_t bit_offset, const size_t bits)

Author
Darren V Levine (Darre.nosp@m.nVLe.nosp@m.vine@.nosp@m.gmai.nosp@m.l.com)