Loading...
Searching...
No Matches
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

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

- serialize(Processor&, T&, const unsigned int)
- serialize(Processor&, T&)
- T::serialize(Processor&, const unsigned int).
- T::serialize(Processor&).

## Member Typedef Documentation

## type

template<class T, bool Ignore = std::is_pointer<T>::value || std::is_function<T>::value>

using caf::detail::has_serialize< T, Ignore >::type

Initial value:
std::integral_constant<
bool,
std::is_same<serialize_type, void>::value
&& std::is_same<deserialize_type, void>::value
>

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

- /build/actor-framework-Z9pIPl/actor-framework-0.17.6/libcaf_core/caf/detail/type_traits.hpp