1#ifndef REFLECTIVE_RAPIDJSON_BINARY_REFLECTOR_BOOST_HANA_H
2#define REFLECTIVE_RAPIDJSON_BINARY_REFLECTOR_BOOST_HANA_H
17#include <boost/hana/adapt_struct.hpp>
18#include <boost/hana/at_key.hpp>
19#include <boost/hana/define_struct.hpp>
20#include <boost/hana/for_each.hpp>
21#include <boost/hana/intersection.hpp>
22#include <boost/hana/keys.hpp>
25namespace BinaryReflector {
27template <
typename Type, Traits::EnableIf<IsCustomType<Type>> *>
30 boost::hana::for_each(boost::hana::keys(customType), [&](
auto key) { deserializer.
read(boost::hana::at_key(customType, key), version); });
34template <
typename Type, Traits::EnableIf<IsCustomType<Type>> *>
37 boost::hana::for_each(boost::hana::keys(customType), [&](
auto key) { serializer.
write(boost::hana::at_key(customType, key), version); });
Contains BinaryReader and BinaryWriter supporting binary (de)serialization of primitive and custom ty...
The BinaryDeserializer class can read various data types, including custom ones, from an std::istream...
The BinarySerializer class can write various data types, including custom ones, to an std::ostream.
void write(const Type &pair)
BinaryVersion readCustomType(BinaryDeserializer &deserializer, Type &customType, BinaryVersion version=0)
Reads customType via deserializer.
void writeCustomType(BinarySerializer &serializer, const Type &customType, BinaryVersion version=0)
Writes customType via serializer.
std::uint64_t BinaryVersion