7 #ifndef ALPS_PARAMS_PARAM_TYPES_HPP_2b33f1b375e64b6fa9adcb68d7de2407 8 #define ALPS_PARAMS_PARAM_TYPES_HPP_2b33f1b375e64b6fa9adcb68d7de2407 13 #include <boost/mpl/list/list10.hpp> 14 #include <boost/mpl/transform.hpp> 15 #include <boost/mpl/front_inserter.hpp> 16 #include <boost/mpl/push_front.hpp> 17 #include <boost/mpl/copy.hpp> 18 #include <boost/mpl/contains.hpp> 23 namespace alps{
namespace hdf5 {
32 namespace mpl=::boost::mpl;
33 namespace mplh=::boost::mpl::placeholders;
41 inline S&
operator<<(S&,
const None&) {
throw std::logic_error(
"Generic streaming operator of None should never be called"); }
44 typedef mpl::list8<bool,
51 std::string> dict_scalar_types;
57 typedef mpl::transform< dict_scalar_types, std::vector<mplh::_1> >::type dict_vector_types;
60 template <
typename FS,
typename TS>
61 struct copy_to_front :
public mpl::reverse_copy< FS, mpl::front_inserter<TS> > {};
64 typedef mpl::push_front<
65 copy_to_front<dict_scalar_types, dict_vector_types>::type,
67 >::type dict_all_types;
80 struct is_supported :
public boost::mpl::contains<dict_all_types, T> {};
87 template <>
struct type_info<None> {
static std::string pretty_name() {
return "None"; } };
88 template <>
struct type_info<bool> {
static std::string pretty_name() {
return "bool"; } };
89 template <>
struct type_info<int> {
static std::string pretty_name() {
return "int"; } };
90 template <>
struct type_info<unsigned int> {
static std::string pretty_name() {
return "unsigned int"; } };
91 template <>
struct type_info<long int> {
static std::string pretty_name() {
return "long int"; } };
92 template <>
struct type_info<unsigned long int> {
static std::string pretty_name() {
return "unsigned long int"; } };
93 template <>
struct type_info<float> {
static std::string pretty_name() {
return "float"; } };
94 template <>
struct type_info<double> {
static std::string pretty_name() {
return "double"; } };
95 template <>
struct type_info<
std::string> {
static std::string pretty_name() {
return "std::string"; } };
98 struct type_info<
std::vector<T> > {
99 static std::string pretty_name() {
return "std::vector<"+type_info<T>::pretty_name()+
">"; }
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< has_complex_elements< typename alps::detail::remove_cvr< T >::type >::value, archive & >::type operator<<(archive &ar, detail::make_pvp_proxy< T > const &proxy)
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 >())