Exemplo n.º 1
0
                    static bool can_load(hdf5::archive & ar) { // TODO: make archive const
                        using alps::hdf5::get_extent;

                        ar.set_context("weight/value");
                        bool is = weight_type::can_load(ar);
                        ar.set_context("../..");

                        return is && B::can_load(ar);
                    }
Exemplo n.º 2
0
 void save(hdf5::archive & ar) const {
     ar.create_group("");
     for(const_iterator it = begin(); it != end(); ++it) {
         if (it->second->count()!=0) {
             ar[it->first] = *(it->second);
         }
     }
 }
Exemplo n.º 3
0
 void Accumulator<T, max_num_binning_tag, B>::load(hdf5::archive & ar) { // TODO: make archive const
     B::load(ar);
     ar["timeseries/data"] >> m_mn_bins;
     ar["timeseries/data/@binsize"] >> m_mn_elements_in_bin;
     ar["timeseries/data/@maxbinnum"] >> m_mn_max_number;
     if (ar.is_data("timeseries/partialbin")) {
         ar["timeseries/partialbin"] >> m_mn_partial;
         ar["timeseries/partialbin/@count"] >> m_mn_elements_in_partial;
     }
Exemplo n.º 4
0
 void load(hdf5::archive & ar) {
     std::vector<std::string> list = ar.list_children("");
     for (std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); ++it) {
         ar.set_context(*it);
         for (typename std::vector<boost::shared_ptr<detail::serializable_type<T> > >::const_iterator jt = m_types.begin()
             ; jt != m_types.end()
             ; ++jt
         )
             if ((*jt)->can_load(ar)) {
                 operator[](*it) = boost::shared_ptr<T>((*jt)->create(ar));
                 break;
             }
         if (!has(*it))
             throw std::logic_error("The Accumulator/Result " + *it + " cannot be unserilized" + ALPS_STACKTRACE);
         operator[](*it).load(ar);
         ar.set_context("..");
     }
 }