12 #ifndef THRILL_DATA_SERIALIZATION_CEREAL_HEADER 13 #define THRILL_DATA_SERIALIZATION_CEREAL_HEADER 15 #include <cereal/cereal.hpp> 16 #include <cereal/details/traits.hpp> 34 namespace serialization_cereal {
71 template <
typename Writer>
73 :
public cereal::OutputArchive<ThrillOutputArchive<Writer>,
74 cereal::AllowEmptyClassElision>
80 cereal::AllowEmptyClassElision>(this),
94 template <
typename Reader>
96 :
public cereal::InputArchive<ThrillInputArchive<Reader>,
97 cereal::AllowEmptyClassElision>
103 cereal::AllowEmptyClassElision>(this),
109 reader_.Read(data, size);
120 template <
typename T,
typename Writer>
128 template <
typename Reader,
typename T>
136 template <
typename Writer,
typename T>
144 template <
typename Reader,
typename T>
152 template <
typename Writer,
typename T>
160 template <
typename Reader,
typename T>
168 template <
typename T,
typename Writer>
172 ar.
saveBinary(bd.data, static_cast<std::size_t>(bd.size));
176 template <
typename Reader,
typename T>
180 ar.
loadBinary(bd.data, static_cast<std::size_t>(bd.size));
192 template <
typename Archive,
typename T>
194 cereal::traits::is_input_serializable<T, Archive>::value &&
195 !std::is_pod<T>::value &&
196 !std::is_same<T, std::string>::value &&
197 !tlx::is_std_pair<T>::value &&
198 !tlx::is_std_array<T>::value &&
199 !tlx::is_std_vector<T>::value &&
200 !tlx::is_std_tuple<T>::value
217 static constexpr
bool is_fixed_size =
false;
218 static constexpr
size_t fixed_size = 0;
234 #endif // !THRILL_DATA_SERIALIZATION_CEREAL_HEADER
static T Deserialize(Archive &ar)
ThrillOutputArchive(Writer &writer)
Construct, outputting to the provided thrill writer.
std::enable_if< std::is_arithmetic< T >::value, void >::type CEREAL_SAVE_FUNCTION_NAME(ThrillOutputArchive< Writer > &ar, T const &t)
Saving for POD types to binary.
void CEREAL_SERIALIZE_FUNCTION_NAME(ThrillOutputArchive< Writer > &ar, cereal::NameValuePair< T > &t)
Serializing NVP types to binary.
std::enable_if< std::is_arithmetic< T >::value, void >::type CEREAL_LOAD_FUNCTION_NAME(ThrillInputArchive< Reader > &ar, T &t)
Loading for POD types from binary.
static void Serialize(const T &t, Archive &ar)
An output archive designed to save data in a compact binary representation.
void saveBinary(const void *data, std::size_t size)
Writes size bytes of data to the thrill writer.