37 #ifndef ALPS_PARAMS_DICT_VALUE_HPP_a8ecbead92aa4a1995f43adfc6d0aae0 38 #define ALPS_PARAMS_DICT_VALUE_HPP_a8ecbead92aa4a1995f43adfc6d0aae0 41 #include <type_traits> 44 #include <boost/variant/variant.hpp> 59 template <
typename>
struct is_allowed;
65 typedef boost::make_variant_over<detail::dict_all_types>::type
value_type;
79 explicit dict_value(
const std::string& name): name_(name), val_() {}
90 const T& operator=(
const T& rhs);
93 const char* operator=(
const char* rhs);
101 #ifndef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS 102 ,
typename std::enable_if<detail::is_allowed<T>::value,
int>::type =0
105 inline operator T()
const {
120 template <
typename T>
121 int compare(
const T& rhs)
const;
139 template <
typename F>
147 template <
typename F>
148 typename F::result_type
apply_visitor(
const F& visitor)
const;
161 return print(os, dv,
false);
dict_value()
Constructs the empty nameless 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 >())
void broadcast(C const &c, P &p, int r=0)
Header for object-oriented interface to MPI (similar to boost::mpi)
Encapsulation of an MPI communicator and some communicator-related operations.
F::result_type apply_visitor(F &visitor, dictionary::const_iterator it)
Const-access visitor to a value by an iterator.
std::ostream & print(std::ostream &s, const dict_value &dv, bool terse)
boost::make_variant_over< detail::dict_all_types >::type value_type
dict_value(const std::string &name)
Constructs the empty value.
std::ostream & operator<<(std::ostream &os, const dict_value &dv)
Print the value together with type in some human-readable format.
detail::None None
"Empty value" type
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 >())