6 #ifndef TURI_VARIANT_DEEP_SERIALIZE_H_ 7 #define TURI_VARIANT_DEEP_SERIALIZE_H_ 9 #include <model_server/lib/variant.hpp> 24 static uint64_t type_check_hash =
hash64(0);
26 oarc << type_check_hash;
42 static uint64_t type_check_hash =
hash64(0);
44 uint64_t type_check_hash_load;
45 iarc >> type_check_hash_load;
47 ASSERT_MSG(type_check_hash == type_check_hash_load,
48 (std::string(
"Deserialization of type ") +
typeid(T).name()
49 +
" failed, likely due to corruption earlier in the stream. ").c_str());
53 v = variant_get_value<T>(vv);
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
void variant_deep_load(variant_type &v, iarchive &iarc)
void variant_deep_save(const variant_type &v, oarchive &oarc)
boost::make_recursive_variant< flexible_type, std::shared_ptr< unity_sgraph_base >, dataframe_t, std::shared_ptr< model_base >, std::shared_ptr< unity_sframe_base >, std::shared_ptr< unity_sarray_base >, std::map< std::string, boost::recursive_variant_ >, std::vector< boost::recursive_variant_ >, boost::recursive_wrapper< function_closure_info > >::type variant_type
static uint64_t hash64(const char *s, size_t len)
variant_type to_variant(const T &f)
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.