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>
91 template <
class Archive,
class T>
98 ar.serialize_blob(&v,
sizeof(v));
108 return v.do_serialize(ar);
122 template <
class Archive,
class T>
127 template <
class Archive>
130 ar.serialize_blob(&v,
sizeof(v));
147 #define BLOB_SERIALIZER(T) \
149 struct is_blob_type<T> { \
150 typedef boost::true_type type; \
157 #define FREE_SERIALIZER(T) \
159 struct has_free_serializer<T> { \
160 typedef boost::true_type type; \
167 #define VARIANT_TAG(Archive, Type, Tag) \
169 struct variant_serialization_traits<Archive<W>, Type> { \
170 static inline typename Archive<W>::variant_tag_type get_tag() { \
181 #define BEGIN_SERIALIZE() \
182 template <bool W, template <bool> class Archive> \
183 bool do_serialize(Archive<W> &ar) {
190 #define BEGIN_SERIALIZE_OBJECT() \
191 template <bool W, template <bool> class Archive> \
192 bool do_serialize(Archive<W> &ar) { \
194 bool r = do_serialize_object(ar); \
198 template <bool W, template <bool> class Archive> \
199 bool do_serialize_object(Archive<W> &ar){
203 #define PREPARE_CUSTOM_VECTOR_SERIALIZATION(size, vec) \
204 ::serialization::detail::prepare_custom_vector_serialization(size, vec, typename Archive<W>::is_saving())
208 #define PREPARE_CUSTOM_DEQUE_SERIALIZATION(size, vec) \
209 ::serialization::detail::prepare_custom_deque_serialization(size, vec, typename Archive<W>::is_saving())
214 #define END_SERIALIZE() \
215 return ar.stream().good(); \
224 bool r = ::do_serialize(ar, f); \
225 if (!r || !ar.stream().good()) return false; \
232 #define FIELD_N(t, f) \
235 bool r = ::do_serialize(ar, f); \
236 if (!r || !ar.stream().good()) return false; \
246 bool r = ::do_serialize(ar, f); \
247 if (!r || !ar.stream().good()) return false; \
256 bool r = ::do_serialize(ar, f); \
257 if (!r || !ar.stream().good()) return false; \
263 #define VARINT_FIELD(f) \
266 ar.serialize_varint(f); \
267 if (!ar.stream().good()) return false; \
274 #define VARINT_FIELD_N(t, f) \
277 ar.serialize_varint(f); \
278 if (!ar.stream().good()) return false; \
294 template <
typename T>
299 template <
typename T>
305 template <
typename T>
310 template <
typename T>
320 template<
class Stream>
331 template<
class Stream>
337 std::ios_base::iostate
state = s.rdstate();
338 result = noeof || EOF == s.peek();
349 template<
class Archive>
359 template <
class Archive,
class T>
370 template <
class Archive,
class T>
Concept for reading and writing characters.
declaration and default definition for the functions used the API
void prepare_custom_deque_serialization(size_t size, std::deque< T > &vec, const boost::mpl::bool_< true > &)
void prepare_custom_vector_serialization(size_t size, std::vector< T > &vec, const boost::mpl::bool_< true > &)
bool do_check_stream_state(Stream &s, boost::mpl::bool_< true >, bool noeof)
bool serialize_noeof(Archive &ar, T &v)
bool check_stream_state(Archive &ar, bool noeof=false)
bool serialize(Archive &ar, T &v)
bool_constant< true > true_type
bool_constant< false > false_type
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
void serialize(Archive &a, unsigned_tx_set &x, const boost::serialization::version_type ver)
bool do_serialize(Archive &ar, T &v)
just calls the serialize function defined for ar and v...
a descriptor for dispatching serialize
a descriptor for dispatching serialize
a descriptor for dispatching serialize
... wouldn't a class be better?
static bool serialize(Archive &ar, T &v, boost::false_type, boost::false_type, boost::false_type)
static void serialize_custom(Archive &ar, T &v, boost::true_type)
static bool serialize(Archive &ar, T &v, boost::false_type, boost::true_type, A a)
static bool serialize(Archive &ar, T &v, boost::false_type, boost::false_type, boost::true_type)
static bool serialize(Archive &ar, T &v)
static bool serialize(Archive &ar, T &v, boost::true_type, boost::false_type, A a)