14 #ifndef ALPS_PARAMS_HDF5_VARIANT_HPP_e36c01f03a8b4756a0a0a098877618dd 15 #define ALPS_PARAMS_HDF5_VARIANT_HPP_e36c01f03a8b4756a0a0a098877618dd 37 void operator()(
const T& val) {
49 inline bool can_read(
const T*)
51 return is_native_type<T>::value
58 bool can_read(
const std::vector<T>*)
60 return is_native_type<T>::value
66 : ar_(ar), context_(ar.get_context())
70 boost::optional<T> operator()(
const T*)
72 boost::optional<T> maybe_val;
73 if (can_read((T*)0)) {
82 typedef alps::detail::variant_serializer<alps::params_ns::detail::dict_all_types,
83 to_archive, from_archive> var_serializer;
84 typedef var_serializer::variant_type variant_type;
89 template <
typename MPLSEQ>
92 detail::to_archive consumer(ar);
93 detail::var_serializer::consume(consumer, var);
97 template <
typename MPLSEQ>
101 detail::from_archive producer(ar);
102 return detail::var_serializer::produce(producer);
bool is_scalar(std::string path) const
bool is_datatype(std::string path) const
Header for boost::variant serialization.
boost::make_variant_over< MPLSEQ >::type read_variant(alps::hdf5::archive &ar)
loading of a boost::variant over MPL type sequence MPLSEQ
void write_variant(alps::hdf5::archive &ar, const typename boost::make_variant_over< MPLSEQ >::type &var)
saving of a boost::variant over MPL type sequence MPLSEQ