47 #include <boost/type_traits/is_integral.hpp> 48 #include <boost/type_traits/integral_constant.hpp> 71 template<
typename F,
typename S>
87 template <
class Archive,
class T>
93 static bool serialize(Archive &ar,
T &v, boost::false_type, boost::true_type, A
a) {
94 ar.serialize_blob(&v,
sizeof(v));
98 static bool serialize(Archive &ar,
T &v, boost::true_type, boost::false_type, A
a) {
102 static bool serialize(Archive &ar,
T &v, boost::false_type, boost::false_type, boost::false_type) {
104 return v.do_serialize(ar);
106 static bool serialize(Archive &ar,
T &v, boost::false_type, boost::false_type, boost::true_type) {
118 template <
class Archive,
class T>
123 template <
class Archive>
126 ar.serialize_blob(&v,
sizeof(v));
143 #define BLOB_SERIALIZER(T) \ 145 struct is_blob_type<T> { \ 146 typedef boost::true_type type; \ 153 #define FREE_SERIALIZER(T) \ 155 struct has_free_serializer<T> { \ 156 typedef boost::true_type type; \ 163 #define VARIANT_TAG(Archive, Type, Tag) \ 165 struct variant_serialization_traits<Archive<W>, Type> { \ 166 static inline typename Archive<W>::variant_tag_type get_tag() { \ 177 #define BEGIN_SERIALIZE() \ 178 template <bool W, template <bool> class Archive> \ 179 bool do_serialize(Archive<W> &ar) { 186 #define BEGIN_SERIALIZE_OBJECT() \ 187 template <bool W, template <bool> class Archive> \ 188 bool do_serialize(Archive<W> &ar) { \ 190 bool r = do_serialize_object(ar); \ 194 template <bool W, template <bool> class Archive> \ 195 bool do_serialize_object(Archive<W> &ar){ 199 #define PREPARE_CUSTOM_VECTOR_SERIALIZATION(size, vec) \ 200 ::serialization::detail::prepare_custom_vector_serialization(size, vec, typename Archive<W>::is_saving()) 205 #define END_SERIALIZE() \ 215 bool r = ::do_serialize(ar, f); \ 216 if (!r || !ar.stream().good()) return false; \ 223 #define FIELD_N(t, f) \ 226 bool r = ::do_serialize(ar, f); \ 227 if (!r || !ar.stream().good()) return false; \ 237 bool r = ::do_serialize(ar, f); \ 238 if (!r || !ar.stream().good()) return false; \ 247 bool r = ::do_serialize(ar, f); \ 248 if (!r || !ar.stream().good()) return false; \ 254 #define VARINT_FIELD(f) \ 257 ar.serialize_varint(f); \ 258 if (!ar.stream().good()) return false; \ 265 #define VARINT_FIELD_N(t, f) \ 268 ar.serialize_varint(f); \ 269 if (!ar.stream().good()) return false; \ 285 template <
typename T>
290 template <
typename T>
300 template<
class Stream>
311 template<
class Stream>
317 std::ios_base::iostate
state =
s.rdstate();
318 result = EOF ==
s.peek();
329 template<
class Archive>
339 template <
class Archive,
class T>
Definition: binary_utils.h:37
bool check_stream_state(Archive &ar)
Definition: serialization.h:330
const uint32_t T[512]
Definition: groestl_tables.h:34
static void serialize_custom(Archive &ar, T &v, boost::true_type)
Definition: serialization.h:110
static bool serialize(Archive &ar, T &v, boost::false_type, boost::false_type, boost::false_type)
Definition: serialization.h:102
static bool serialize(Archive &ar, T &v)
Definition: serialization.h:89
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:286
a descriptor for dispatching serialize
Definition: serialization.h:55
bool serialize(Archive &ar, T &v)
Definition: serialization.h:340
boost::false_type type
Definition: serialization.h:69
declaration and default definition for the functions used the API
a descriptor for dispatching serialize
Definition: serialization.h:62
boost::true_type type
Definition: serialization.h:72
boost::true_type type
Definition: serialization.h:62
boost::false_type type
Definition: serialization.h:55
... wouldn't a class be better?
Definition: serialization.h:88
static bool serialize(Archive &ar, T &v, boost::true_type, boost::false_type, A a)
Definition: serialization.h:98
Definition: blake256.h:37
static bool serialize(Archive &ar, T &v, boost::false_type, boost::true_type, A a)
Definition: serialization.h:93
string a
Definition: MakeCryptoOps.py:15
a descriptor for dispatching serialize
Definition: serialization.h:69
bool do_serialize(Archive &ar, T &v)
just calls the serialize function defined for ar and v...
Definition: serialization.h:119
bool do_check_stream_state(Stream &s, boost::mpl::bool_< true >)
Definition: serialization.h:301
#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:106