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

Defines common bitcpy details as well as a info::version number, and bit_length function. More...

#include <stdint.h>
#include <cstddef>
#include <type_traits>
#include <utility>
#include <cstring>
#include "bitcpy_sized_pointer.h"

Go to the source code of this file.

Classes

struct  serdes::info
 CppSerdes library information. More...
 
struct  serdes::custom_type< UnsupportedType >
 wrapper construct used to let the user provide custom (de)serialization support for types without modifying the original type. More...
 

Namespaces

 serdes
 CppSerdes library namespace.
 

Macros

#define BITCPY_CONSTEXPR_SUPPORTED   0
 if == 1 constexpr for bitcpy is supported
 
#define CONSTEXPR_ABOVE_CPP11
 resolves automatically to "constexpr" if C++14 or greater
 
#define CONSTEXPR_ABOVE_CPP11_OR_INLINE   inline
 
#define BITCPY_CONSTEXPR_NON_LITERAL_STORAGE_SUPPORTED   0
 if == 1 constexpr for bitcpy functions using non-literal storage is supported
 
#define CONSTEXPR_ABOVE_CPP11_AND_NON_LITERAL_STORAGE
 resolves automatically to "constexpr" if C++14 or greater
 
#define LIB_CPP_SERDES_VERSION_MAJOR   1
 CppSerdes library #define major version.
 
#define LIB_CPP_SERDES_VERSION_MINOR   3
 CppSerdes library #define minor version.
 
#define LIB_CPP_SERDES_VERSION_MAJOR_MINOR(major, minor)   (major * 1000 + minor)
 CppSerdes library create single version number, from two major and minor numbers, suitable for >= comparisons.
 
#define LIB_CPP_SERDES_VERSION   LIB_CPP_SERDES_VERSION_MAJOR_MINOR(LIB_CPP_SERDES_VERSION_MAJOR, LIB_CPP_SERDES_VERSION_MINOR)
 CppSerdes library single version number, suitable for >= comparisons.
 

Functions

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. More...
 

Detailed Description

Defines common bitcpy details as well as a info::version number, and bit_length function.

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