OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
MemCopySerialization.h File Reference
#include <typeinfo>
#include <type_traits>
#include "Utility/Streams/OutputStream.h"
#include "Utility/Streams/InputStream.h"
#include "BinaryExceptions.h"

Classes

struct  is_memcopy_serializable< T >
 

Macros

#define MM_DECLARE_MEMCOPY_SERIALIZABLE(T)
 

Functions

template<class T >
requires is_memcopy_serializable_v<T>
void serialize (const T &src, OutputStream *dst)
 
template<class T >
requires is_memcopy_serializable_v<T>
void deserialize (InputStream &src, T *dst)
 

Variables

template<class T >
constexpr bool is_memcopy_serializable_v = is_memcopy_serializable<T>::value
 

Macro Definition Documentation

◆ MM_DECLARE_MEMCOPY_SERIALIZABLE

#define MM_DECLARE_MEMCOPY_SERIALIZABLE (   T)
Value:
template<> \
struct is_memcopy_serializable<T> : std::true_type {};
Definition: MemCopySerialization.h:24

Invoke this macro for a type to use it with binary serialization functions via simple memory copy.

Parameters
TType to declare as memcopy-serializable.

Function Documentation

◆ deserialize()

template<class T >
requires is_memcopy_serializable_v<T>
void deserialize ( InputStream src,
T *  dst 
)

◆ serialize()

template<class T >
requires is_memcopy_serializable_v<T>
void serialize ( const T &  src,
OutputStream dst 
)

Variable Documentation

◆ is_memcopy_serializable_v

template<class T >
constexpr bool is_memcopy_serializable_v = is_memcopy_serializable<T>::value
constexpr