6#ifndef TTG_SERIALIZATION_MADNESS_H
7#define TTG_SERIALIZATION_MADNESS_H
11#ifdef TTG_SERIALIZATION_SUPPORTS_MADNESS
12#include <madness/world/archive.h>
13#include <madness/world/buffer_archive.h>
14#include <madness/world/type_traits.h>
23#ifdef TTG_SERIALIZATION_SUPPORTS_MADNESS
34 inline constexpr bool is_archive_v<T, std::enable_if_t<is_madness_archive_v<T>>> =
true;
36 inline constexpr bool is_input_archive_v<T, std::enable_if_t<is_madness_input_archive_v<T>>> =
true;
38 inline constexpr bool is_output_archive_v<T, std::enable_if_t<is_madness_output_archive_v<T>>> =
true;
51 template <
typename Archive,
typename T,
class =
void>
54#ifdef TTG_SERIALIZATION_SUPPORTS_MADNESS
55 template <
typename Archive,
typename T>
57 Archive, T,
std::enable_if_t<madness::is_output_archive_v<Archive> && madness::is_serializable_v<Archive, T>>>
61 template <
typename Archive,
typename T>
62 inline static constexpr bool is_madness_output_serializable_v = is_madness_output_serializable<Archive, T>::value;
64 template <
typename Archive,
typename T,
class =
void>
67#ifdef TTG_SERIALIZATION_SUPPORTS_MADNESS
68 template <
typename Archive,
typename T>
70 Archive, T,
std::enable_if_t<madness::is_input_archive_v<Archive> && madness::is_serializable_v<Archive, T>>>
74 template <
typename Archive,
typename T>
75 inline static constexpr bool is_madness_input_serializable_v = is_madness_input_serializable<Archive, T>::value;
77 template <
typename Archive,
typename T>
78 inline static constexpr bool is_madness_serializable_v =
79 is_madness_input_serializable_v<Archive, T> || is_madness_output_serializable_v<Archive, T>;
81 template <
typename T,
class =
void>
84#ifdef TTG_SERIALIZATION_SUPPORTS_MADNESS
87 T,
std::enable_if_t<is_madness_input_serializable_v<madness::archive::BufferInputArchive, T> &&
88 is_madness_output_serializable_v<madness::archive::BufferOutputArchive, T>>>
96 template <
typename T,
class =
void>
99#ifdef TTG_SERIALIZATION_SUPPORTS_MADNESS
100 template <
typename T>
102 T,
std::enable_if_t<madness::is_user_serializable_v<madness::archive::BufferInputArchive, T> &&
103 madness::is_user_serializable_v<madness::archive::BufferOutputArchive, T>>> : std::true_type {
108 template <
typename T>
constexpr bool is_madness_output_archive_v
constexpr bool is_madness_archive_v
constexpr bool is_madness_input_archive_v
constexpr bool is_madness_user_buffer_serializable_v
evaluates to true if can serialize T to/from buffer using user-provided MADNESS serialization
constexpr bool is_madness_buffer_serializable_v
evaluates to true if can serialize T to/from buffer using MADNESS serialization