LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::thread_safe_registry_via_id< K, M > Class Template Reference

#include "thread_safe_registry_via_id.h"

Public Types

using collection_type = tbb::concurrent_unordered_map< K, M, detail::hash_to_size_t< K >>
 
using value_type = typename collection_type::value_type
 

Static Public Member Functions

template<typename C >
static void put (C const &container)
 
static auto emplace (value_type const &value)
 
static auto emplace (K const &key, M const &mapped)
 
static bool empty ()
 
static collection_type const & get ()
 
static bool get (K const &key, M &mapped)
 

Static Private Member Functions

static auto & instance ()
 

Detailed Description

template<typename K, typename M>
class art::thread_safe_registry_via_id< K, M >

Definition at line 55 of file thread_safe_registry_via_id.h.

Member Typedef Documentation

template<typename K , typename M >
using art::thread_safe_registry_via_id< K, M >::collection_type = tbb::concurrent_unordered_map<K, M, detail::hash_to_size_t<K>>

Definition at line 58 of file thread_safe_registry_via_id.h.

template<typename K , typename M >
using art::thread_safe_registry_via_id< K, M >::value_type = typename collection_type::value_type

Definition at line 59 of file thread_safe_registry_via_id.h.

Member Function Documentation

template<typename K , typename M >
auto art::thread_safe_registry_via_id< K, M >::emplace ( value_type const &  value)
static
template<typename K , typename M >
auto art::thread_safe_registry_via_id< K, M >::emplace ( K const &  key,
M const &  mapped 
)
static

Definition at line 98 of file thread_safe_registry_via_id.h.

99  {
100  return instance().emplace(key, mapped);
101  }
template<typename K , typename M >
bool art::thread_safe_registry_via_id< K, M >::empty ( void  )
static

Definition at line 105 of file thread_safe_registry_via_id.h.

Referenced by art::Principal::Principal().

106  {
107  return instance().empty();
108  }
template<typename K , typename M >
bool art::thread_safe_registry_via_id< K, M >::get ( K const &  key,
M &  mapped 
)
static

Definition at line 119 of file thread_safe_registry_via_id.h.

120  {
121  auto& me = instance();
122  auto it = me.find(k);
123  if (it != me.cend()) {
124  mapped = it->second;
125  return true;
126  }
127  return false;
128  }
template<typename K , typename M >
static auto& art::thread_safe_registry_via_id< K, M >::instance ( )
inlinestaticprivate

Definition at line 71 of file thread_safe_registry_via_id.h.

72  {
73  static collection_type me;
74  return me;
75  }
tbb::concurrent_unordered_map< K, M, detail::hash_to_size_t< K >> collection_type
template<typename K , typename M >
template<typename C >
void art::thread_safe_registry_via_id< K, M >::put ( C const &  container)
static

Definition at line 81 of file thread_safe_registry_via_id.h.

References e.

82  {
83  auto& me = instance();
84  for (auto const& e : container) {
85  me.emplace(e);
86  }
87  }
Float_t e
Definition: plot.C:34

The documentation for this class was generated from the following file: