Derecho  0.9
Distributed systems toolkit for RDMA
Macros
SerializationMacros.hpp File Reference
#include <mutils/macro_utils.hpp>
Include dependency graph for SerializationMacros.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEFAULT_SERIALIZE1(a)
 This is an automatically-generated file that implements default serialization support with a series of macros. More...
 
#define DEFAULT_SERIALIZE2(a, b)
 
#define DEFAULT_SERIALIZE3(a, b, c)
 
#define DEFAULT_SERIALIZE4(a, b, c, d)
 
#define DEFAULT_SERIALIZE5(a, b, c, d, e)
 
#define DEFAULT_SERIALIZE6(a, b, c, d, e, f)
 
#define DEFAULT_SERIALIZE7(a, b, c, d, e, f, g)
 
#define DEFAULT_SERIALIZE8(a, b, c, d, e, f, g, h)
 
#define DEFAULT_SERIALIZE9(a, b, c, d, e, f, g, h, i)
 
#define DEFAULT_SERIALIZE10(a, b, c, d, e, f, g, h, i, j)
 
#define DEFAULT_SERIALIZE11(a, b, c, d, e, f, g, h, i, j, k)
 
#define DEFAULT_SERIALIZE12(a, b, c, d, e, f, g, h, i, j, k, l)
 
#define DEFAULT_SERIALIZE13(a, b, c, d, e, f, g, h, i, j, k, l, m)
 
#define DEFAULT_SERIALIZE14(a, b, c, d, e, f, g, h, i, j, k, l, m, n)
 
#define DEFAULT_DESERIALIZE2(Name, a)
 
#define DEFAULT_DESERIALIZE3(Name, a, b)
 
#define DEFAULT_DESERIALIZE4(Name, a, b, c)
 
#define DEFAULT_DESERIALIZE5(Name, a, b, c, d)
 
#define DEFAULT_DESERIALIZE6(Name, a, b, c, d, e)
 
#define DEFAULT_DESERIALIZE7(Name, a, b, c, d, e, f)
 
#define DEFAULT_DESERIALIZE8(Name, a, b, c, d, e, f, g)
 
#define DEFAULT_DESERIALIZE9(Name, a, b, c, d, e, f, g, h)
 
#define DEFAULT_DESERIALIZE10(Name, a, b, c, d, e, f, g, h, i)
 
#define DEFAULT_DESERIALIZE11(Name, a, b, c, d, e, f, g, h, i, j)
 
#define DEFAULT_DESERIALIZE12(Name, a, b, c, d, e, f, g, h, i, j, k)
 
#define DEFAULT_DESERIALIZE13(Name, a, b, c, d, e, f, g, h, i, j, k, l)
 
#define DEFAULT_DESERIALIZE14(Name, a, b, c, d, e, f, g, h, i, j, k, l, m)
 
#define DEFAULT_DESERIALIZE15(Name, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
 
#define DEFAULT_SERIALIZE_IMPL2(count, ...)   DEFAULT_SERIALIZE ## count (__VA_ARGS__)
 
#define DEFAULT_SERIALIZE_IMPL(count, ...)   DEFAULT_SERIALIZE_IMPL2(count, __VA_ARGS__)
 
#define DEFAULT_SERIALIZE(...)   DEFAULT_SERIALIZE_IMPL(VA_NARGS(__VA_ARGS__), __VA_ARGS__)
 
#define DEFAULT_DESERIALIZE_IMPL2(count, ...)   DEFAULT_DESERIALIZE ## count (__VA_ARGS__)
 
#define DEFAULT_DESERIALIZE_IMPL(count, ...)   DEFAULT_DESERIALIZE_IMPL2(count, __VA_ARGS__)
 
#define DEFAULT_DESERIALIZE(...)   DEFAULT_DESERIALIZE_IMPL(VA_NARGS(__VA_ARGS__), __VA_ARGS__)
 
#define DEFAULT_DESERIALIZE_NOALLOC(Name)
 
#define DEFAULT_SERIALIZATION_SUPPORT(CLASS_NAME, CLASS_MEMBERS...)
 THIS (below) is the only user-facing macro in this file. More...
 

Macro Definition Documentation

◆ DEFAULT_DESERIALIZE

#define DEFAULT_DESERIALIZE (   ...)    DEFAULT_DESERIALIZE_IMPL(VA_NARGS(__VA_ARGS__), __VA_ARGS__)

Definition at line 581 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE10

#define DEFAULT_DESERIALIZE10 (   Name,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*b_obj); \
auto c_obj = mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*c_obj); \
auto d_obj = mutils::from_bytes<std::decay_t<decltype(d)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*d_obj); \
auto e_obj = mutils::from_bytes<std::decay_t<decltype(e)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*e_obj); \
auto f_obj = mutils::from_bytes<std::decay_t<decltype(f)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*f_obj); \
auto g_obj = mutils::from_bytes<std::decay_t<decltype(g)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*g_obj); \
auto h_obj = mutils::from_bytes<std::decay_t<decltype(h)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj,*c_obj,*d_obj,*e_obj,*f_obj,*g_obj,*h_obj, *(mutils::from_bytes<std::decay_t<decltype(i)> >(dsm, buf + bytes_read + mutils::bytes_size(*h_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 423 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE11

#define DEFAULT_DESERIALIZE11 (   Name,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*b_obj); \
auto c_obj = mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*c_obj); \
auto d_obj = mutils::from_bytes<std::decay_t<decltype(d)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*d_obj); \
auto e_obj = mutils::from_bytes<std::decay_t<decltype(e)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*e_obj); \
auto f_obj = mutils::from_bytes<std::decay_t<decltype(f)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*f_obj); \
auto g_obj = mutils::from_bytes<std::decay_t<decltype(g)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*g_obj); \
auto h_obj = mutils::from_bytes<std::decay_t<decltype(h)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*h_obj); \
auto i_obj = mutils::from_bytes<std::decay_t<decltype(i)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj,*c_obj,*d_obj,*e_obj,*f_obj,*g_obj,*h_obj,*i_obj, *(mutils::from_bytes<std::decay_t<decltype(j)> >(dsm, buf + bytes_read + mutils::bytes_size(*i_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 443 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE12

#define DEFAULT_DESERIALIZE12 (   Name,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*b_obj); \
auto c_obj = mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*c_obj); \
auto d_obj = mutils::from_bytes<std::decay_t<decltype(d)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*d_obj); \
auto e_obj = mutils::from_bytes<std::decay_t<decltype(e)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*e_obj); \
auto f_obj = mutils::from_bytes<std::decay_t<decltype(f)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*f_obj); \
auto g_obj = mutils::from_bytes<std::decay_t<decltype(g)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*g_obj); \
auto h_obj = mutils::from_bytes<std::decay_t<decltype(h)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*h_obj); \
auto i_obj = mutils::from_bytes<std::decay_t<decltype(i)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*i_obj); \
auto j_obj = mutils::from_bytes<std::decay_t<decltype(j)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj,*c_obj,*d_obj,*e_obj,*f_obj,*g_obj,*h_obj,*i_obj,*j_obj, *(mutils::from_bytes<std::decay_t<decltype(k)> >(dsm, buf + bytes_read + mutils::bytes_size(*j_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 465 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE13

#define DEFAULT_DESERIALIZE13 (   Name,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*b_obj); \
auto c_obj = mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*c_obj); \
auto d_obj = mutils::from_bytes<std::decay_t<decltype(d)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*d_obj); \
auto e_obj = mutils::from_bytes<std::decay_t<decltype(e)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*e_obj); \
auto f_obj = mutils::from_bytes<std::decay_t<decltype(f)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*f_obj); \
auto g_obj = mutils::from_bytes<std::decay_t<decltype(g)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*g_obj); \
auto h_obj = mutils::from_bytes<std::decay_t<decltype(h)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*h_obj); \
auto i_obj = mutils::from_bytes<std::decay_t<decltype(i)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*i_obj); \
auto j_obj = mutils::from_bytes<std::decay_t<decltype(j)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*j_obj); \
auto k_obj = mutils::from_bytes<std::decay_t<decltype(k)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj,*c_obj,*d_obj,*e_obj,*f_obj,*g_obj,*h_obj,*i_obj,*j_obj,*k_obj, *(mutils::from_bytes<std::decay_t<decltype(l)> >(dsm, buf + bytes_read + mutils::bytes_size(*k_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 489 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE14

#define DEFAULT_DESERIALIZE14 (   Name,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
  l,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*b_obj); \
auto c_obj = mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*c_obj); \
auto d_obj = mutils::from_bytes<std::decay_t<decltype(d)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*d_obj); \
auto e_obj = mutils::from_bytes<std::decay_t<decltype(e)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*e_obj); \
auto f_obj = mutils::from_bytes<std::decay_t<decltype(f)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*f_obj); \
auto g_obj = mutils::from_bytes<std::decay_t<decltype(g)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*g_obj); \
auto h_obj = mutils::from_bytes<std::decay_t<decltype(h)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*h_obj); \
auto i_obj = mutils::from_bytes<std::decay_t<decltype(i)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*i_obj); \
auto j_obj = mutils::from_bytes<std::decay_t<decltype(j)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*j_obj); \
auto k_obj = mutils::from_bytes<std::decay_t<decltype(k)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*k_obj); \
auto l_obj = mutils::from_bytes<std::decay_t<decltype(l)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj,*c_obj,*d_obj,*e_obj,*f_obj,*g_obj,*h_obj,*i_obj,*j_obj,*k_obj,*l_obj, *(mutils::from_bytes<std::decay_t<decltype(m)> >(dsm, buf + bytes_read + mutils::bytes_size(*l_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 515 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE15

#define DEFAULT_DESERIALIZE15 (   Name,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
  l,
  m,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*b_obj); \
auto c_obj = mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*c_obj); \
auto d_obj = mutils::from_bytes<std::decay_t<decltype(d)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*d_obj); \
auto e_obj = mutils::from_bytes<std::decay_t<decltype(e)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*e_obj); \
auto f_obj = mutils::from_bytes<std::decay_t<decltype(f)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*f_obj); \
auto g_obj = mutils::from_bytes<std::decay_t<decltype(g)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*g_obj); \
auto h_obj = mutils::from_bytes<std::decay_t<decltype(h)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*h_obj); \
auto i_obj = mutils::from_bytes<std::decay_t<decltype(i)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*i_obj); \
auto j_obj = mutils::from_bytes<std::decay_t<decltype(j)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*j_obj); \
auto k_obj = mutils::from_bytes<std::decay_t<decltype(k)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*k_obj); \
auto l_obj = mutils::from_bytes<std::decay_t<decltype(l)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*l_obj); \
auto m_obj = mutils::from_bytes<std::decay_t<decltype(m)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj,*c_obj,*d_obj,*e_obj,*f_obj,*g_obj,*h_obj,*i_obj,*j_obj,*k_obj,*l_obj,*m_obj, *(mutils::from_bytes<std::decay_t<decltype(n)> >(dsm, buf + bytes_read + mutils::bytes_size(*m_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 543 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE2

#define DEFAULT_DESERIALIZE2 (   Name,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
return std::make_unique<Name>(*a_obj); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
The manager for any RemoteDeserializationContexts.

Definition at line 333 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE3

#define DEFAULT_DESERIALIZE3 (   Name,
  a,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
return std::make_unique<Name>(*a_obj, *(mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + mutils::bytes_size(*a_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 339 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE4

#define DEFAULT_DESERIALIZE4 (   Name,
  a,
  b,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj, *(mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read + mutils::bytes_size(*b_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 345 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE5

#define DEFAULT_DESERIALIZE5 (   Name,
  a,
  b,
  c,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*b_obj); \
auto c_obj = mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj,*c_obj, *(mutils::from_bytes<std::decay_t<decltype(d)> >(dsm, buf + bytes_read + mutils::bytes_size(*c_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 353 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE6

#define DEFAULT_DESERIALIZE6 (   Name,
  a,
  b,
  c,
  d,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*b_obj); \
auto c_obj = mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*c_obj); \
auto d_obj = mutils::from_bytes<std::decay_t<decltype(d)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj,*c_obj,*d_obj, *(mutils::from_bytes<std::decay_t<decltype(e)> >(dsm, buf + bytes_read + mutils::bytes_size(*d_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 363 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE7

#define DEFAULT_DESERIALIZE7 (   Name,
  a,
  b,
  c,
  d,
  e,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*b_obj); \
auto c_obj = mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*c_obj); \
auto d_obj = mutils::from_bytes<std::decay_t<decltype(d)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*d_obj); \
auto e_obj = mutils::from_bytes<std::decay_t<decltype(e)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj,*c_obj,*d_obj,*e_obj, *(mutils::from_bytes<std::decay_t<decltype(f)> >(dsm, buf + bytes_read + mutils::bytes_size(*e_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 375 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE8

#define DEFAULT_DESERIALIZE8 (   Name,
  a,
  b,
  c,
  d,
  e,
  f,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*b_obj); \
auto c_obj = mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*c_obj); \
auto d_obj = mutils::from_bytes<std::decay_t<decltype(d)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*d_obj); \
auto e_obj = mutils::from_bytes<std::decay_t<decltype(e)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*e_obj); \
auto f_obj = mutils::from_bytes<std::decay_t<decltype(f)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj,*c_obj,*d_obj,*e_obj,*f_obj, *(mutils::from_bytes<std::decay_t<decltype(g)> >(dsm, buf + bytes_read + mutils::bytes_size(*f_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 389 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE9

#define DEFAULT_DESERIALIZE9 (   Name,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
 
)
Value:
static std::unique_ptr<Name> from_bytes(mutils::DeserializationManager* dsm, char const * buf){ \
auto a_obj = mutils::from_bytes<std::decay_t<decltype(a)> >(dsm, buf); \
std::size_t bytes_read = mutils::bytes_size(*a_obj); \
auto b_obj = mutils::from_bytes<std::decay_t<decltype(b)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*b_obj); \
auto c_obj = mutils::from_bytes<std::decay_t<decltype(c)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*c_obj); \
auto d_obj = mutils::from_bytes<std::decay_t<decltype(d)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*d_obj); \
auto e_obj = mutils::from_bytes<std::decay_t<decltype(e)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*e_obj); \
auto f_obj = mutils::from_bytes<std::decay_t<decltype(f)> >(dsm, buf + bytes_read); \
bytes_read += mutils::bytes_size(*f_obj); \
auto g_obj = mutils::from_bytes<std::decay_t<decltype(g)> >(dsm, buf + bytes_read); \
return std::make_unique<Name>(*a_obj,*b_obj,*c_obj,*d_obj,*e_obj,*f_obj,*g_obj, *(mutils::from_bytes<std::decay_t<decltype(h)> >(dsm, buf + bytes_read + mutils::bytes_size(*g_obj)))); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
auto bytes_size(const T &)
Just calls sizeof(T)
The manager for any RemoteDeserializationContexts.

Definition at line 405 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE_IMPL

#define DEFAULT_DESERIALIZE_IMPL (   count,
  ... 
)    DEFAULT_DESERIALIZE_IMPL2(count, __VA_ARGS__)

Definition at line 580 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE_IMPL2

#define DEFAULT_DESERIALIZE_IMPL2 (   count,
  ... 
)    DEFAULT_DESERIALIZE ## count (__VA_ARGS__)

Definition at line 579 of file SerializationMacros.hpp.

◆ DEFAULT_DESERIALIZE_NOALLOC

#define DEFAULT_DESERIALIZE_NOALLOC (   Name)
Value:
template<typename... SerializationMacroArgs>\
static mutils::context_ptr<Name> from_bytes_noalloc(SerializationMacroArgs&& ... args){ \
return mutils::context_ptr<Name>(Name::from_bytes(std::forward<SerializationMacroArgs>(args)...).release()); \
}\
template<typename... SerializationMacroArgs>\
static mutils::context_ptr<const Name> from_bytes_noalloc_const(SerializationMacroArgs&& ... args){ \
return mutils::context_ptr<const Name>(Name::from_bytes(std::forward<SerializationMacroArgs>(args)...).release()); \
}
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
std::enable_if_t< std::is_base_of< ByteRepresentable CMA std::decay_t< T > >::value, context_ptr< T > > from_bytes_noalloc(DeserializationManager *ctx, const char *v, context_ptr< std::decay_t< T >>=context_ptr< std::decay_t< T >>{})
Calls T::from_bytes_noalloc(ctx,v) when T is a ByteRepresentable.
std::unique_ptr< T, ContextDeleter< T > > context_ptr
Definition: context_ptr.hpp:20

Definition at line 583 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZATION_SUPPORT

#define DEFAULT_SERIALIZATION_SUPPORT (   CLASS_NAME,
  CLASS_MEMBERS... 
)
Value:
DEFAULT_SERIALIZE(CLASS_MEMBERS) DEFAULT_DESERIALIZE(CLASS_NAME,CLASS_MEMBERS) DEFAULT_DESERIALIZE_NOALLOC(CLASS_NAME) \
void ensure_registered(mutils::DeserializationManager&){}
#define DEFAULT_DESERIALIZE_NOALLOC(Name)
The manager for any RemoteDeserializationContexts.
#define DEFAULT_SERIALIZE(...)
#define DEFAULT_DESERIALIZE(...)

THIS (below) is the only user-facing macro in this file.

It's for automatically generating basic serialization support. plop this macro inside the body of a class which extends ByteRepresentable, providing the name of the class (that you plopped this into) as the first argument and the name of the class's fields as the remaining arguments. Right now we only support up to seven fields; adding more support is easy, just ask if you need.

MAJOR CAVEAT: This macro assumes that there is a constructor which takes all the class members (in the order listed). it's fine if this is a private constructor, but it needs to exist.

Definition at line 609 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE

#define DEFAULT_SERIALIZE (   ...)    DEFAULT_SERIALIZE_IMPL(VA_NARGS(__VA_ARGS__), __VA_ARGS__)

Definition at line 576 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE1

#define DEFAULT_SERIALIZE1 (   a)
Value:
std::size_t to_bytes(char* ret) const { \
return mutils::to_bytes(a, ret); \
} \
std::size_t bytes_size() const { \
return mutils::bytes_size(a) ; \
} \
void post_object(const std::function<void (char const * const, std::size_t)>& func ) const { \
}
auto bytes_size(const T &)
Just calls sizeof(T)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.

This is an automatically-generated file that implements default serialization support with a series of macros.

Do not edit this file by hand; you should generate it with generate_macros.py. The public interface is at the bottom of the file.

Definition at line 11 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE10

#define DEFAULT_SERIALIZE10 (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
 
)
Value:
std::size_t to_bytes(char* ret) const { \
int bytes_written = mutils::to_bytes(a,ret); \
bytes_written += mutils::to_bytes(b,ret + bytes_written); \
bytes_written += mutils::to_bytes(c,ret + bytes_written); \
bytes_written += mutils::to_bytes(d,ret + bytes_written); \
bytes_written += mutils::to_bytes(e,ret + bytes_written); \
bytes_written += mutils::to_bytes(f,ret + bytes_written); \
bytes_written += mutils::to_bytes(g,ret + bytes_written); \
bytes_written += mutils::to_bytes(h,ret + bytes_written); \
bytes_written += mutils::to_bytes(i,ret + bytes_written); \
return bytes_written + mutils::to_bytes(j,ret + bytes_written); \
} \
std::size_t bytes_size() const { \
} \
void post_object(const std::function<void (char const * const, std::size_t)>& func ) const { \
}
auto bytes_size(const T &)
Just calls sizeof(T)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.

Definition at line 173 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE11

#define DEFAULT_SERIALIZE11 (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
 
)
Value:
std::size_t to_bytes(char* ret) const { \
int bytes_written = mutils::to_bytes(a,ret); \
bytes_written += mutils::to_bytes(b,ret + bytes_written); \
bytes_written += mutils::to_bytes(c,ret + bytes_written); \
bytes_written += mutils::to_bytes(d,ret + bytes_written); \
bytes_written += mutils::to_bytes(e,ret + bytes_written); \
bytes_written += mutils::to_bytes(f,ret + bytes_written); \
bytes_written += mutils::to_bytes(g,ret + bytes_written); \
bytes_written += mutils::to_bytes(h,ret + bytes_written); \
bytes_written += mutils::to_bytes(i,ret + bytes_written); \
bytes_written += mutils::to_bytes(j,ret + bytes_written); \
return bytes_written + mutils::to_bytes(k,ret + bytes_written); \
} \
std::size_t bytes_size() const { \
} \
void post_object(const std::function<void (char const * const, std::size_t)>& func ) const { \
}
auto bytes_size(const T &)
Just calls sizeof(T)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.

Definition at line 201 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE12

#define DEFAULT_SERIALIZE12 (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
 
)

Definition at line 231 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE13

#define DEFAULT_SERIALIZE13 (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
  l,
 
)

Definition at line 263 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE14

#define DEFAULT_SERIALIZE14 (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
  l,
  m,
 
)

Definition at line 297 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE2

#define DEFAULT_SERIALIZE2 (   a,
 
)
Value:
std::size_t to_bytes(char* ret) const { \
int bytes_written = mutils::to_bytes(a,ret); \
return bytes_written + mutils::to_bytes(b,ret + bytes_written); \
} \
std::size_t bytes_size() const { \
} \
void post_object(const std::function<void (char const * const, std::size_t)>& func ) const { \
}
auto bytes_size(const T &)
Just calls sizeof(T)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.

Definition at line 21 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE3

#define DEFAULT_SERIALIZE3 (   a,
  b,
 
)
Value:
std::size_t to_bytes(char* ret) const { \
int bytes_written = mutils::to_bytes(a,ret); \
bytes_written += mutils::to_bytes(b,ret + bytes_written); \
return bytes_written + mutils::to_bytes(c,ret + bytes_written); \
} \
std::size_t bytes_size() const { \
} \
void post_object(const std::function<void (char const * const, std::size_t)>& func ) const { \
}
auto bytes_size(const T &)
Just calls sizeof(T)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.

Definition at line 33 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE4

#define DEFAULT_SERIALIZE4 (   a,
  b,
  c,
 
)
Value:
std::size_t to_bytes(char* ret) const { \
int bytes_written = mutils::to_bytes(a,ret); \
bytes_written += mutils::to_bytes(b,ret + bytes_written); \
bytes_written += mutils::to_bytes(c,ret + bytes_written); \
return bytes_written + mutils::to_bytes(d,ret + bytes_written); \
} \
std::size_t bytes_size() const { \
} \
void post_object(const std::function<void (char const * const, std::size_t)>& func ) const { \
}
auto bytes_size(const T &)
Just calls sizeof(T)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.

Definition at line 47 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE5

#define DEFAULT_SERIALIZE5 (   a,
  b,
  c,
  d,
 
)
Value:
std::size_t to_bytes(char* ret) const { \
int bytes_written = mutils::to_bytes(a,ret); \
bytes_written += mutils::to_bytes(b,ret + bytes_written); \
bytes_written += mutils::to_bytes(c,ret + bytes_written); \
bytes_written += mutils::to_bytes(d,ret + bytes_written); \
return bytes_written + mutils::to_bytes(e,ret + bytes_written); \
} \
std::size_t bytes_size() const { \
} \
void post_object(const std::function<void (char const * const, std::size_t)>& func ) const { \
}
auto bytes_size(const T &)
Just calls sizeof(T)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.

Definition at line 63 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE6

#define DEFAULT_SERIALIZE6 (   a,
  b,
  c,
  d,
  e,
 
)
Value:
std::size_t to_bytes(char* ret) const { \
int bytes_written = mutils::to_bytes(a,ret); \
bytes_written += mutils::to_bytes(b,ret + bytes_written); \
bytes_written += mutils::to_bytes(c,ret + bytes_written); \
bytes_written += mutils::to_bytes(d,ret + bytes_written); \
bytes_written += mutils::to_bytes(e,ret + bytes_written); \
return bytes_written + mutils::to_bytes(f,ret + bytes_written); \
} \
std::size_t bytes_size() const { \
} \
void post_object(const std::function<void (char const * const, std::size_t)>& func ) const { \
}
auto bytes_size(const T &)
Just calls sizeof(T)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.

Definition at line 81 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE7

#define DEFAULT_SERIALIZE7 (   a,
  b,
  c,
  d,
  e,
  f,
 
)
Value:
std::size_t to_bytes(char* ret) const { \
int bytes_written = mutils::to_bytes(a,ret); \
bytes_written += mutils::to_bytes(b,ret + bytes_written); \
bytes_written += mutils::to_bytes(c,ret + bytes_written); \
bytes_written += mutils::to_bytes(d,ret + bytes_written); \
bytes_written += mutils::to_bytes(e,ret + bytes_written); \
bytes_written += mutils::to_bytes(f,ret + bytes_written); \
return bytes_written + mutils::to_bytes(g,ret + bytes_written); \
} \
std::size_t bytes_size() const { \
} \
void post_object(const std::function<void (char const * const, std::size_t)>& func ) const { \
}
auto bytes_size(const T &)
Just calls sizeof(T)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.

Definition at line 101 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE8

#define DEFAULT_SERIALIZE8 (   a,
  b,
  c,
  d,
  e,
  f,
  g,
 
)
Value:
std::size_t to_bytes(char* ret) const { \
int bytes_written = mutils::to_bytes(a,ret); \
bytes_written += mutils::to_bytes(b,ret + bytes_written); \
bytes_written += mutils::to_bytes(c,ret + bytes_written); \
bytes_written += mutils::to_bytes(d,ret + bytes_written); \
bytes_written += mutils::to_bytes(e,ret + bytes_written); \
bytes_written += mutils::to_bytes(f,ret + bytes_written); \
bytes_written += mutils::to_bytes(g,ret + bytes_written); \
return bytes_written + mutils::to_bytes(h,ret + bytes_written); \
} \
std::size_t bytes_size() const { \
} \
void post_object(const std::function<void (char const * const, std::size_t)>& func ) const { \
}
auto bytes_size(const T &)
Just calls sizeof(T)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.

Definition at line 123 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE9

#define DEFAULT_SERIALIZE9 (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
 
)
Value:
std::size_t to_bytes(char* ret) const { \
int bytes_written = mutils::to_bytes(a,ret); \
bytes_written += mutils::to_bytes(b,ret + bytes_written); \
bytes_written += mutils::to_bytes(c,ret + bytes_written); \
bytes_written += mutils::to_bytes(d,ret + bytes_written); \
bytes_written += mutils::to_bytes(e,ret + bytes_written); \
bytes_written += mutils::to_bytes(f,ret + bytes_written); \
bytes_written += mutils::to_bytes(g,ret + bytes_written); \
bytes_written += mutils::to_bytes(h,ret + bytes_written); \
return bytes_written + mutils::to_bytes(i,ret + bytes_written); \
} \
std::size_t bytes_size() const { \
} \
void post_object(const std::function<void (char const * const, std::size_t)>& func ) const { \
}
auto bytes_size(const T &)
Just calls sizeof(T)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.

Definition at line 147 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE_IMPL

#define DEFAULT_SERIALIZE_IMPL (   count,
  ... 
)    DEFAULT_SERIALIZE_IMPL2(count, __VA_ARGS__)

Definition at line 575 of file SerializationMacros.hpp.

◆ DEFAULT_SERIALIZE_IMPL2

#define DEFAULT_SERIALIZE_IMPL2 (   count,
  ... 
)    DEFAULT_SERIALIZE ## count (__VA_ARGS__)

Definition at line 574 of file SerializationMacros.hpp.