47 #include <unordered_set> 49 #include <boost/type_traits/is_integral.hpp> 50 #include <boost/type_traits/integral_constant.hpp> 73 template<
typename F,
typename S>
89 template <
class Archive,
class T>
95 static bool serialize(Archive &ar,
T &v, boost::false_type, boost::true_type, A
a) {
96 ar.serialize_blob(&v,
sizeof(v));
100 static bool serialize(Archive &ar,
T &v, boost::true_type, boost::false_type, A
a) {
104 static bool serialize(Archive &ar,
T &v, boost::false_type, boost::false_type, boost::false_type) {
106 return v.do_serialize(ar);
108 static bool serialize(Archive &ar,
T &v, boost::false_type, boost::false_type, boost::true_type) {
120 template <
class Archive,
class T>
125 template <
class Archive>
128 ar.serialize_blob(&v,
sizeof(v));
145 #define BLOB_SERIALIZER(T) \ 147 struct is_blob_type<T> { \ 148 typedef boost::true_type type; \ 155 #define FREE_SERIALIZER(T) \ 157 struct has_free_serializer<T> { \ 158 typedef boost::true_type type; \ 165 #define VARIANT_TAG(Archive, Type, Tag) \ 167 struct variant_serialization_traits<Archive<W>, Type> { \ 168 static inline typename Archive<W>::variant_tag_type get_tag() { \ 179 #define BEGIN_SERIALIZE() \ 180 template <bool W, template <bool> class Archive> \ 181 bool do_serialize(Archive<W> &ar) { 188 #define BEGIN_SERIALIZE_OBJECT() \ 189 template <bool W, template <bool> class Archive> \ 190 bool do_serialize(Archive<W> &ar) { \ 192 bool r = do_serialize_object(ar); \ 196 template <bool W, template <bool> class Archive> \ 197 bool do_serialize_object(Archive<W> &ar){ 201 #define PREPARE_CUSTOM_VECTOR_SERIALIZATION(size, vec) \ 202 ::serialization::detail::prepare_custom_vector_serialization(size, vec, typename Archive<W>::is_saving()) 207 #define END_SERIALIZE() \ 208 return ar.stream().good(); \ 217 bool r = ::do_serialize(ar, f); \ 218 if (!r || !ar.stream().good()) return false; \ 225 #define FIELD_N(t, f) \ 228 bool r = ::do_serialize(ar, f); \ 229 if (!r || !ar.stream().good()) return false; \ 239 bool r = ::do_serialize(ar, f); \ 240 if (!r || !ar.stream().good()) return false; \ 249 bool r = ::do_serialize(ar, f); \ 250 if (!r || !ar.stream().good()) return false; \ 256 #define VARINT_FIELD(f) \ 259 ar.serialize_varint(f); \ 260 if (!ar.stream().good()) return false; \ 267 #define VARINT_FIELD_N(t, f) \ 270 ar.serialize_varint(f); \ 271 if (!ar.stream().good()) return false; \ 287 template <
typename T>
292 template <
typename T>
302 template<
class Stream>
313 template<
class Stream>
319 std::ios_base::iostate
state =
s.rdstate();
320 result = EOF ==
s.peek();
331 template<
class Archive>
341 template <
class Archive,
class T>
Definition: binary_utils.h:37
bool check_stream_state(Archive &ar)
Definition: serialization.h:332
const uint32_t T[512]
Definition: groestl_tables.h:34
static void serialize_custom(Archive &ar, T &v, boost::true_type)
Definition: serialization.h:112
static bool serialize(Archive &ar, T &v, boost::false_type, boost::false_type, boost::false_type)
Definition: serialization.h:104
static bool serialize(Archive &ar, T &v)
Definition: serialization.h:91
Definition: block_queue.cpp:41
void prepare_custom_vector_serialization(size_t size, std::vector< T > &vec, const boost::mpl::bool_< true > &)
Definition: serialization.h:288
a descriptor for dispatching serialize
Definition: serialization.h:57
bool serialize(Archive &ar, T &v)
Definition: serialization.h:342
boost::false_type type
Definition: serialization.h:71
declaration and default definition for the functions used the API
a descriptor for dispatching serialize
Definition: serialization.h:64
boost::true_type type
Definition: serialization.h:74
type
Definition: json.h:74
boost::true_type type
Definition: serialization.h:64
boost::false_type type
Definition: serialization.h:57
... wouldn't a class be better?
Definition: serialization.h:90
static bool serialize(Archive &ar, T &v, boost::true_type, boost::false_type, A a)
Definition: serialization.h:100
Definition: blake256.h:37
static bool serialize(Archive &ar, T &v, boost::false_type, boost::true_type, A a)
Definition: serialization.h:95
string a
Definition: MakeCryptoOps.py:15
a descriptor for dispatching serialize
Definition: serialization.h:71
bool do_serialize(Archive &ar, T &v)
just calls the serialize function defined for ar and v...
Definition: serialization.h:121
bool do_check_stream_state(Stream &s, boost::mpl::bool_< true >)
Definition: serialization.h:303
#define s(x, c)
Definition: aesb.c:46
static bool serialize(Archive &ar, T &v, boost::false_type, boost::false_type, boost::true_type)
Definition: serialization.h:108