11 namespace accumulators {
14 void register_predefined_serializable_types();
21 std::lock_guard<std::mutex> guard(m_types_mutex);
22 if (m_types.empty()) {
23 detail::register_predefined_serializable_types();
30 m_storage.
insert(make_pair(name, std::shared_ptr<T>(
new T())));
31 return *(m_storage.find(name)->second);
37 throw std::out_of_range(
"No observable found with the name: " + name +
ALPS_STACKTRACE);
38 return *(m_storage.find(name)->second);
43 return m_storage.find(name) != m_storage.
end();
49 throw std::out_of_range(
"There already exists an accumulator with the name: " + name +
ALPS_STACKTRACE);
50 m_storage.insert(make_pair(name, ptr));
56 os << it->first <<
": " << *(it->second) << std::endl;
void insert(std::string const &name, std::shared_ptr< T > ptr)
std::ostream & print(std::ostream &s, const dict_value &dv, bool terse)
std::map< std::string, std::shared_ptr< T > >::const_iterator const_iterator