SUNphi  1.0
Serializable.hpp File Reference

Define a serializable quantity. More...

#include <yaml-cpp/yaml.h>
#include <metaprogramming/TypeTraits.hpp>
#include <metaprogramming/UniversalReferences.hpp>
#include <serialize/Base.hpp>
#include <serialize/Binarize.hpp>
#include <serialize/Default.hpp>
#include <utility/Macros.hpp>

Go to the source code of this file.

Classes

class  SUNphi::Serializable< T >
 Forward definition of serializable. More...
 

Macros

#define PROVIDE_SIMPLE_FRIEND_BINARY_OPERATOR(OP)
 Provide a simple friend binary operator. More...
 
#define PROVIDE_SIMPLE_BINARY_OPERATOR(OP)
 Provide a simple binary operator. More...
 

Typedefs

template<typename T , typename Ret = void>
using SUNphi::EnableIfIsSerializable = EnableIf< isSerializable< T >,Ret >
 

Functions

template<typename T >
constexpr bool SUNphi::_isSerializable (const T *)
 
template<typename... Ts>
constexpr bool SUNphi::_isSerializable (const Serializable< Ts... > *)
 

Variables

template<typename T >
constexpr bool SUNphi::isSerializable = _isSerializable ((RemRef<T>*)nullptr)
 

Detailed Description

Define a serializable quantity.

Definition in file Serializable.hpp.

Macro Definition Documentation

#define PROVIDE_SIMPLE_BINARY_OPERATOR (   OP)
Value:
\
template <typename O, \
SFINAE_ON_TEMPLATE_ARG(not isSame<O,Serializable>)> \
DECLAUTO operator OP (const O& oth) \
{ \
return \
value OP oth; \
}
#define SFINAE_ON_TEMPLATE_ARG(...)
Definition: SFINAE.hpp:24
#define DECLAUTO
Short name for decltype(auto)

Provide a simple binary operator.

Definition at line 144 of file Serializable.hpp.

#define PROVIDE_SIMPLE_FRIEND_BINARY_OPERATOR (   OP)
Value:
\
template <typename O> \
DECLAUTO friend operator OP (O& first, \
const Serializable& second) \
{ \
return \
first OP second.value; \
}
#define DECLAUTO
Short name for decltype(auto)

Provide a simple friend binary operator.

Definition at line 133 of file Serializable.hpp.

Typedef Documentation

template<typename T , typename Ret = void>
using SUNphi::EnableIfIsSerializable = typedef EnableIf< isSerializable <T> ,Ret>

Provides the class itself if T is of the given type

Provides the class itself if T satisfies the condition

Definition at line 195 of file Serializable.hpp.

Function Documentation

template<typename T >
constexpr bool SUNphi::_isSerializable ( const T *  )

Check if the class is a Serializable

False case

Definition at line 195 of file Serializable.hpp.

template<typename... Ts>
constexpr bool SUNphi::_isSerializable ( const Serializable< Ts... > *  )

Check if the class is a Serializable

True case

Definition at line 195 of file Serializable.hpp.

Variable Documentation

template<typename T >
constexpr bool SUNphi::isSerializable = _isSerializable ((RemRef<T>*)nullptr)

Check if the class is a Serializable

Calls the internal implementation

Definition at line 195 of file Serializable.hpp.