CAF  0.17.3
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
caf::detail::has_serialize< T, Ignore > Struct Template Reference

Checks whether T provides either a free function or a member function for serialization. More...

#include <type_traits.hpp>

Public Types

using serialize_type = decltype(test_serialize< T >(nullptr, nullptr))
 
using deserialize_type = decltype(test_deserialize< T >(nullptr, nullptr))
 
using type = std::integral_constant< bool, std::is_same< serialize_type, void >::value &&std::is_same< deserialize_type, void >::value >
 

Static Public Member Functions

template<class U >
static auto test_serialize (caf::serializer *sink, U *x, unsigned int y=0) -> decltype(serialize(*sink, *x, y))
 
template<class U >
static auto test_serialize (caf::serializer *sink, U *x) -> decltype(serialize(*sink, *x))
 
template<class >
static auto test_serialize (...) -> std::false_type
 
template<class U >
static auto test_deserialize (caf::deserializer *source, U *x, unsigned int y=0) -> decltype(serialize(*source, *x, y))
 
template<class U >
static auto test_deserialize (caf::deserializer *source, U *x) -> decltype(serialize(*source, *x))
 
template<class >
static auto test_deserialize (...) -> std::false_type
 

Static Public Attributes

static constexpr bool value = type::value
 

Detailed Description

template<class T, bool Ignore = std::is_pointer<T>::value || std::is_function<T>::value>
struct caf::detail::has_serialize< T, Ignore >

Checks whether T provides either a free function or a member function for serialization.

The checks test whether both serialization and deserialization can succeed. The meta function tests the following functions with Processor being both serializer and deserializer and returns an integral constant if and only if the test succeeds for both.


The documentation for this struct was generated from the following file: