CppSerdes  1.0
A serialization/deserialization library designed with embedded systems in mind
serdes Namespace Reference

CppSerdes library namespace. More...

Namespaces

 init_formatter
 init_formatter() constructs a serdes::formatter object lambda without using dynamic memory allocation. A number of different use cases are supported, see serdes::formatter for examples.
 
 init_this_formatter
 init_this_formatter() constructs a serdes::formatter object lambda without using dynamic memory allocation. Same as init_formatter but captures "this", only necessary for older compilers which don't capture "this" automatically.
 
 literals
 provides fixed size literals, useful when specifying serialization actions to convey exact bit widths
 

Classes

struct  align
 specifies a number of bits to be used to align the bit offset as a multiple of More...
 
struct  array
 a container for fixed or dynamically sized arrays, with an upper bounds limit for safety More...
 
struct  bitpack
 bitpack a value into an exact number of specified bits. If applied to an array it will be applied to each element of the array, not the total bits in the array More...
 
struct  delimited_array
 a container for dynamically sized arrays with their ending marked by a reserved delimiter value More...
 
struct  formatter
 a lambda function wrapper that can describe any serialization/deserialization formatting process. While it does use more overhead (because of the lambda), it also can describe any format process as manipulatable runtime data, which the other hard coded interfaces don't allow.
More...
 
struct  info
 CppSerdes library information. More...
 
struct  packet
 a serialization/deserialization helper class, with load, store, and stream operators More...
 
struct  packet_base
 inheritable base class to allow format recording and application with no additional memory storage (except for the virtual table pointer) More...
 
struct  pad
 specifies a number of bits to be used to pad (add to) the current bit offset More...
 
struct  sized_pointer
 Holds a pointer to an array (with its type information) with a constant size. More...
 
struct  sized_pointer< void >
 Holds a pointer to a void array (with type information stored as a runtime element size paramenter) with a constant size. More...
 
struct  status_t
 status returned after any serialization/deserialization process More...
 

Enumerations

enum  status_e {
  status_e::NO_ERROR = 0, status_e::EXCEEDED_SERIAL_SIZE = 1, status_e::ARRAY_SIZE_OVER_MAX = 2, status_e::INVALID_FIELD = 3,
  status_e::NO_LOAD_TO_RVALUE = 4, status_e::DELIMITER_NOT_FOUND = 5, status_e::FORMATTER_NOT_SET = 6
}
 error status of serialization/deserialization process More...
 
enum  mode_e { mode_e::LOADING, mode_e::STORING, mode_e::UNSPECIFIED }
 the serdes mode of operation More...
 

Functions

template<typename T >
constexpr T bit_length (T &&x) noexcept
 Does nothing but annotate a passed value as a bit length, used for writting clearer code. More...
 
template<typename T_array , typename T_val , detail::requires_unsigned_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11 size_t 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 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 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 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 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 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 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 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...
 
template<typename T_array , typename T_val , detail::requires_unsigned_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11 size_t bitcpy (T_array *const dest, const T_val source, const size_t bit_offset=0, const size_t bits=detail::default_bitsize< T_val >::value) noexcept
 [[serialize, uint source]] copies the specified number of bits from a value into an array More...
 
template<typename T_array , typename T_val , detail::requires_unsigned_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11 size_t bitcpy (T_array *const dest, const sized_pointer< const T_val > &source, const size_t bit_offset, const size_t bits) noexcept
 [[serialize, partial sized_pointer source]] copies the specified number of bits from a value into an 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 bitcpy (T_array *const dest, const sized_pointer< const T_val > &source, const size_t bit_offset=0) noexcept
 [[serialize, entire sized_pointer source]] copies the entire sized_pointer object from a value into an array More...
 
template<typename T_array , typename T_val , detail::requires_large_non_integral_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11_AND_NON_LITERAL_STORAGE size_t bitcpy (T_array *const dest, const T_val &source, const size_t bit_offset=0, const size_t bits=detail::default_bitsize< T_val >::value) noexcept
 [[serialize, large non integral type source]] copies the specified number of bits from a value into an array More...
 
template<typename T_array = void, typename T_val = void>
CONSTEXPR_ABOVE_CPP11 size_t bitcpy (sized_pointer< T_array > dest, const T_val &source, const size_t bit_offset=0, const size_t bits=detail::default_bitsize< T_val >::value) noexcept
 [[serialize, size safe]] copies the specified number of bits from a value into an sized array More...
 
template<typename T_array , typename T_val >
size_t bitcpy (T_array *const dest, const std::atomic< T_val > &source, const size_t bit_offset=0, const size_t bits=detail::default_bitsize< T_val >::value) noexcept
 [[serialize, atomic source]] copies the specified number of bits from an atomic value into an sized array More...
 
template<typename T_val >
CONSTEXPR_ABOVE_CPP11 size_t bitcpy (sized_pointer< void > &dest, const T_val &source, const size_t bit_offset=0, const size_t bits=detail::default_bitsize< T_val >::value) noexcept
 [[serialize, size safe, type punned (void) dest array]] copies the specified number of bits from a value into an sized array More...
 
void printhex (const uint8_t data, const bool add_newline=true)
 prints uint8_t value in hex format More...
 
void printhex (const uint16_t data, const bool add_newline=true)
 prints uint16_t value in hex format More...
 
void printhex (const uint32_t data, const bool add_newline=true)
 prints uint32_t value in hex format More...
 
void printhex (const uint64_t data, const bool add_newline=true)
 prints uint64_t value in hex format More...
 
void printhex (const bool data, const bool add_newline=true)
 prints bool value in hex format More...
 
template<typename T = void, typename std::enable_if< std::is_signed< T >::valueBITCPY_INT128_CONDITIONAL_DEFINE(||std::is_same< T, __int128_t >::value), T >::type * = nullptr>
void printhex (const T data, const bool add_newline=true)
 prints signed value in hex format More...
 
template<bool use_brackets = true, typename T = void, size_t N = 0u>
void printhex (const T(&data)[N], const bool add_newline=true)
 prints an array in hex format More...
 
template<bool use_brackets = true, typename T = void, size_t N = 0u>
void printbin (const T(&data)[N], const bool add_newline=true)
 prints an array in binary format More...
 
template<typename T , typename std::enable_if<!std::is_array< T >::value &&!std::is_same< T, bool >::value, T >::type * = nullptr>
void printbin (const T data, const bool add_newline=true)
 prints a non-array non-bool value in binary format More...
 
void printbin (const bool data, const bool add_newline=true)
 prints a bool value in binary format More...
 
const char * status2str (status_e err_status) noexcept
 converts an error status enum to a c style string More...
 
void virtual_formatter (packet &)
 used to initialize a formatter object to be optionally overridable. the default behaviour if not overridden is to do nothing.
 

Variables

constexpr void(* pure_virtual_formatter )(packet &) = nullptr
 used to initialize a formatter object to be required but uninitialized. the default behaviour if not overridden is to give a status_e::FORMATTER_NOT_SET error
 

Detailed Description

CppSerdes library namespace.

Enumeration Type Documentation

enum serdes::mode_e
strong

the serdes mode of operation

Enumerator
LOADING 

(deserializing) loading from serial data into variables

STORING 

(serializing) storing variables into serial data

UNSPECIFIED 

not yet configured for storing/loading

enum serdes::status_e
strong

error status of serialization/deserialization process

Enumerator
NO_ERROR 

no serialization/deserialization errors occurred

EXCEEDED_SERIAL_SIZE 

during serialization/deserialization the serial array boundary was reached (causes the serdes process to abort)

ARRAY_SIZE_OVER_MAX 

the serdes::array object's size exceeded the maximum size of the array when evaluated (causes the serdes process to abort)

INVALID_FIELD 

a fields validation check failed (causes the serdes process to abort)

NO_LOAD_TO_RVALUE 

tried to loading data from a serial buffer into a temperary rvalue (causes the serdes process to abort)

DELIMITER_NOT_FOUND 

the specified delimiter in a delimited_array object was not found before the end of the array (causes the serdes process to abort)

FORMATTER_NOT_SET 

a pure_virtual_formatter (a.k.a "serdes::formatter(nullptr)") was used but not overriden (causes the serdes process to abort)

Function Documentation

template<typename T >
constexpr T serdes::bit_length ( T &&  x)
noexcept

Does nothing but annotate a passed value as a bit length, used for writting clearer code.

Parameters
xbit length value
Template Parameters
Tthe type of the bit length value
Returns
constexpr size_t: the same bit length value that was used as the input
Examples:
01_simple_example.cpp, and 02_bitcpy_usage.cpp.
template<typename T_array , typename T_val , detail::requires_unsigned_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11 size_t serdes::bitcpy ( T_array *const  dest,
const T_val  source,
const size_t  bit_offset = 0,
const size_t  bits = detail::default_bitsize<T_val>::value 
)
noexcept

[[serialize, uint source]] copies the specified number of bits from a value into an array

[[serialize, signed type source]] copies the specified number of bits from a value into an array

[[serialize, integral value <= 8 bytes source]] copies the specified number of bits from a value into an array

[[serialize, bool source]] copies the specified number of bits from a value into an array

Template Parameters
T_arraydestination serial array base type
T_valsource value type
Parameters
destpointer to the start of the destination serial array
sourcesource value reference
bit_offsetstarting bit of the destination array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
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

[[deserialize, large non integral type dest]] copies the specified number of bits from an array into a large non integral type value

[[deserialize, signed destination]] copies the specified number of bits from an array into a signed value

[[deserialize, bool destination]] copies the specified number of bits from an array into a boolean value

Template Parameters
T_arrayserial array base type
T_valdestination value type
Parameters
destdestination value reference
sourcepointer to the start of the source serial array
bit_offsetstarting bit of the source array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
Template Parameters
T_arrayserial array base type
T_valdestination value type, a boolean for this case.
Parameters
destdestination boolean value reference
sourcepointer to the start of the source serial array
bit_offsetstarting bit of the source array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
Examples:
02_bitcpy_usage.cpp, 11_using_atomics_with_bitcpy.cpp, and 12_compile_time_bitcpy_evaluation.cpp.
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

Template Parameters
T_arrayserial array base type
T_valdestination value type
Parameters
destdestination value reference
sourcepointer to the start of the source serial array
bit_offsetstarting bit of the source array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
template<typename T_array , typename T_val , detail::requires_unsigned_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11 size_t serdes::bitcpy ( T_array *const  dest,
const sized_pointer< const T_val > &  source,
const size_t  bit_offset,
const size_t  bits 
)
noexcept

[[serialize, partial sized_pointer source]] copies the specified number of bits from a value into an array (no default bits, since it can't necessarily be known at compile time)

Template Parameters
T_arraydestination serial array base type
T_valsource value type
Parameters
destpointer to the start of the destination serial array
sourcesource value reference
bit_offsetstarting bit of the destination array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
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)

Template Parameters
T_arrayserial array base type
T_valdestination value type
Parameters
destdestination value sized_pointer<T_val> reference
sourcepointer to the start of the source serial array
bit_offsetstarting bit of the source array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
template<typename T_array , typename T_val , detail::requires_unsigned_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11 size_t serdes::bitcpy ( T_array *const  dest,
const sized_pointer< const T_val > &  source,
const size_t  bit_offset = 0 
)
noexcept

[[serialize, entire sized_pointer source]] copies the entire sized_pointer object from a value into an array

Template Parameters
T_arraydestination serial array base type
T_valsource value type
Parameters
destpointer to the start of the destination serial array
sourcesource value reference
bit_offsetstarting bit of the destination array to start copying from
Returns
size_t: number of bits coppied
template<typename T_array , typename T_val , detail::requires_large_non_integral_type< T_val > * = nullptr>
CONSTEXPR_ABOVE_CPP11_AND_NON_LITERAL_STORAGE size_t serdes::bitcpy ( T_array *const  dest,
const T_val &  source,
const size_t  bit_offset = 0,
const size_t  bits = detail::default_bitsize<T_val>::value 
)
noexcept

[[serialize, large non integral type source]] copies the specified number of bits from a value into an array

Template Parameters
T_arraydestination serial array base type
T_valsource value type
Parameters
destpointer to the start of the destination serial array
sourcesource value reference
bit_offsetstarting bit of the destination array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
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.

Template Parameters
T_arrayserial array base type
T_valdestination value type
Parameters
destdestination value sized_pointer<T_val> reference
sourcepointer to the start of the source serial array
bit_offsetstarting bit of the source array to start copying from
Returns
size_t: number of bits coppied
template<typename T_array = void, typename T_val = void>
CONSTEXPR_ABOVE_CPP11 size_t serdes::bitcpy ( sized_pointer< T_array >  dest,
const T_val &  source,
const size_t  bit_offset = 0,
const size_t  bits = detail::default_bitsize<T_val>::value 
)
noexcept

[[serialize, size safe]] copies the specified number of bits from a value into an sized array

Template Parameters
T_arraydestination serial array base type
T_valsource value type
Parameters
destpointer to the start of the destination serial array
sourcesource value reference
bit_offsetstarting bit of the destination array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
template<typename T_array , typename T_val >
size_t serdes::bitcpy ( T_array *const  dest,
const std::atomic< T_val > &  source,
const size_t  bit_offset = 0,
const size_t  bits = detail::default_bitsize<T_val>::value 
)
noexcept

[[serialize, atomic source]] copies the specified number of bits from an atomic value into an sized array

Template Parameters
T_arraydestination serial array base type
T_valsource value type
Parameters
destpointer to the start of the destination serial array
sourcesource value reference
bit_offsetstarting bit of the destination array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
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.

Template Parameters
T_arrayserial array base type
T_valdestination value type
Parameters
destdestination value reference
sourcepointer to the start of the source serial array
bit_offsetstarting bit of the source array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
template<typename T_val >
CONSTEXPR_ABOVE_CPP11 size_t serdes::bitcpy ( sized_pointer< void > &  dest,
const T_val &  source,
const size_t  bit_offset = 0,
const size_t  bits = detail::default_bitsize<T_val>::value 
)
noexcept

[[serialize, size safe, type punned (void) dest array]] copies the specified number of bits from a value into an sized array

Template Parameters
T_arraydestination serial array base type
T_valsource value type
Parameters
destpointer to the start of the destination serial array
sourcesource value reference
bit_offsetstarting bit of the destination array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
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.

Template Parameters
T_arrayserial array base type
T_valdestination value type
Parameters
destdestination value reference
sourcepointer to the start of the source serial array
bit_offsetstarting bit of the source array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
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

Template Parameters
T_arrayserial array base type
T_valdestination value type
Parameters
destdestination value reference
sourcepointer to the start of the source serial array
bit_offsetstarting bit of the source array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
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

Template Parameters
T_arrayserial array base type
T_valdestination value type
Parameters
destdestination value reference
sourcepointer to the start of the source serial array
bit_offsetstarting bit of the source array to start copying from
bitsnumber of bits to copy from
Returns
size_t: number of bits coppied
template<bool use_brackets = true, typename T = void, size_t N = 0u>
void serdes::printbin ( const T(&)  data[N],
const bool  add_newline = true 
)

prints an array in binary format

Template Parameters
use_bracketsif true, curly brackets will surround the printed statement
Parameters
datavalue to print
add_newlineif true, a newline will be added to the end
Examples:
06_variable_length_formats.cpp.
template<typename T , typename std::enable_if<!std::is_array< T >::value &&!std::is_same< T, bool >::value, T >::type * = nullptr>
void serdes::printbin ( const T  data,
const bool  add_newline = true 
)

prints a non-array non-bool value in binary format

Parameters
datavalue to print
add_newlineif true, a newline will be added to the end
void serdes::printbin ( const bool  data,
const bool  add_newline = true 
)
inline

prints a bool value in binary format

Parameters
datavalue to print
add_newlineif true, a newline will be added to the end
void serdes::printhex ( const uint8_t  data,
const bool  add_newline = true 
)
inline

prints uint8_t value in hex format

Parameters
datavalue to print
add_newlineif true, a newline will be added to the end
Examples:
02_bitcpy_usage.cpp, 03_serial_usage.cpp, 06_variable_length_formats.cpp, and 08_error_handling.cpp.
void serdes::printhex ( const uint16_t  data,
const bool  add_newline = true 
)
inline

prints uint16_t value in hex format

Parameters
datavalue to print
add_newlineif true, a newline will be added to the end
void serdes::printhex ( const uint32_t  data,
const bool  add_newline = true 
)
inline

prints uint32_t value in hex format

Parameters
datavalue to print
add_newlineif true, a newline will be added to the end
void serdes::printhex ( const uint64_t  data,
const bool  add_newline = true 
)
inline

prints uint64_t value in hex format

Parameters
datavalue to print
add_newlineif true, a newline will be added to the end
void serdes::printhex ( const bool  data,
const bool  add_newline = true 
)
inline

prints bool value in hex format

Parameters
datavalue to print
add_newlineif true, a newline will be added to the end
template<typename T = void, typename std::enable_if< std::is_signed< T >::valueBITCPY_INT128_CONDITIONAL_DEFINE(||std::is_same< T, __int128_t >::value), T >::type * = nullptr>
void serdes::printhex ( const T  data,
const bool  add_newline = true 
)

prints signed value in hex format

Parameters
datavalue to print
add_newlineif true, a newline will be added to the end
template<bool use_brackets = true, typename T = void, size_t N = 0u>
void serdes::printhex ( const T(&)  data[N],
const bool  add_newline = true 
)

prints an array in hex format

Template Parameters
use_bracketsif true, curly brackets will surround the printed statement
Parameters
datavalue to print
add_newlineif true, a newline will be added to the end
const char* serdes::status2str ( status_e  err_status)
inlinenoexcept

converts an error status enum to a c style string

Parameters
err_statuserror status enumeration
Returns
const char*: converted string
Examples:
04_object_oriented_serial.cpp, 05_nested_object_oriented_serial.cpp, 07_delimited_arrays.cpp, 08_error_handling.cpp, 09_runtime_edittable_formats.cpp, 10_virtual_fields.cpp, and 13_arrays_of_packets.cpp.