7 #ifndef ALPS_HDF5_BOOST_TUPLE 8 #define ALPS_HDF5_BOOST_TUPLE 15 #include <boost/tuple/tuple.hpp> 24 template <
int N,
typename T,
typename E>
struct save_helper {
26 typename A,
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9
29 , std::string
const & path
30 , boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>
const & value
33 save(ar, path, get<N>(value));
34 if (has_complex_elements<
typename alps::detail::remove_cvr<T>::type>::value)
39 template <
int N,
typename T>
struct save_helper<N, T,
std::true_type> {
41 typename A,
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9
45 , boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>
const &
49 template <
int N,
typename T,
class E>
struct load_helper {
51 typename A,
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9
54 , std::string
const & path
55 , boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & value
58 load(ar, path, get<N>(value));
62 template <
int N,
typename T>
struct load_helper<N, T,
std::true_type> {
64 typename A,
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9
68 , boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> &
74 typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9
77 , std::string
const & path
78 , boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>
const & value
79 , std::vector<std::size_t>
size = std::vector<std::size_t>()
80 , std::vector<std::size_t> chunk = std::vector<std::size_t>()
81 , std::vector<std::size_t> offset = std::vector<std::size_t>()
83 detail::save_helper<0, T0, typename std::is_same<T0, boost::tuples::null_type>::type>::apply(
86 detail::save_helper<1, T1, typename std::is_same<T1, boost::tuples::null_type>::type>::apply(
89 detail::save_helper<2, T2, typename std::is_same<T2, boost::tuples::null_type>::type>::apply(
92 detail::save_helper<3, T3, typename std::is_same<T3, boost::tuples::null_type>::type>::apply(
95 detail::save_helper<4, T4, typename std::is_same<T4, boost::tuples::null_type>::type>::apply(
98 detail::save_helper<5, T5, typename std::is_same<T5, boost::tuples::null_type>::type>::apply(
101 detail::save_helper<6, T6, typename std::is_same<T6, boost::tuples::null_type>::type>::apply(
104 detail::save_helper<7, T7, typename std::is_same<T7, boost::tuples::null_type>::type>::apply(
107 detail::save_helper<8, T8, typename std::is_same<T8, boost::tuples::null_type>::type>::apply(
110 detail::save_helper<9, T9, typename std::is_same<T9, boost::tuples::null_type>::type>::apply(
116 typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9
119 , std::string
const & path
120 , boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & value
121 , std::vector<std::size_t> chunk = std::vector<std::size_t>()
122 , std::vector<std::size_t> offset = std::vector<std::size_t>()
124 detail::load_helper<0, T0, typename std::is_same<T0, boost::tuples::null_type>::type>::apply(ar, ar.
complete_path(path) +
"/0", value);
125 detail::load_helper<1, T1, typename std::is_same<T1, boost::tuples::null_type>::type>::apply(ar, ar.
complete_path(path) +
"/1", value);
126 detail::load_helper<2, T2, typename std::is_same<T2, boost::tuples::null_type>::type>::apply(ar, ar.
complete_path(path) +
"/2", value);
127 detail::load_helper<3, T3, typename std::is_same<T3, boost::tuples::null_type>::type>::apply(ar, ar.
complete_path(path) +
"/3", value);
128 detail::load_helper<4, T4, typename std::is_same<T4, boost::tuples::null_type>::type>::apply(ar, ar.
complete_path(path) +
"/4", value);
129 detail::load_helper<5, T5, typename std::is_same<T5, boost::tuples::null_type>::type>::apply(ar, ar.
complete_path(path) +
"/5", value);
130 detail::load_helper<6, T6, typename std::is_same<T6, boost::tuples::null_type>::type>::apply(ar, ar.
complete_path(path) +
"/6", value);
131 detail::load_helper<7, T7, typename std::is_same<T7, boost::tuples::null_type>::type>::apply(ar, ar.
complete_path(path) +
"/7", value);
132 detail::load_helper<8, T8, typename std::is_same<T8, boost::tuples::null_type>::type>::apply(ar, ar.
complete_path(path) +
"/8", value);
133 detail::load_helper<9, T9, typename std::is_same<T9, boost::tuples::null_type>::type>::apply(ar, ar.
complete_path(path) +
"/9", value);
void load(archive &ar, std::string const &path, T &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t >=std::vector< std::size_t >())
std::enable_if<!is_sequence< T >::value, std::size_t >::type size(T const &)
std::string complete_path(std::string path) const
void save(archive &ar, std::string const &path, T const &value, std::vector< std::size_t >=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t >=std::vector< std::size_t >())