Public Types | Static Public Member Functions | Static Private Member Functions | List of all members
art::thread_safe_registry_via_id< K, M > Class Template Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/canvas/v3_06_01/source/canvas/Persistency/Provenance/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 53 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 56 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 57 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

Definition at line 89 of file thread_safe_registry_via_id.h.

90  {
91  return instance().emplace(value);
92  }
const XML_Char int const XML_Char * value
Definition: expat.h:331
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 96 of file thread_safe_registry_via_id.h.

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

Definition at line 103 of file thread_safe_registry_via_id.h.

104  {
105  return instance().empty();
106  }
template<typename K , typename M >
auto art::thread_safe_registry_via_id< K, M >::get ( )
static

Definition at line 110 of file thread_safe_registry_via_id.h.

111  {
112  return instance();
113  }
template<typename K , typename M >
bool art::thread_safe_registry_via_id< K, M >::get ( K const &  key,
M &  mapped 
)
static

Definition at line 117 of file thread_safe_registry_via_id.h.

References it.

118  {
119  auto& me = instance();
120  auto it = me.find(k);
121  if (it != me.cend()) {
122  mapped = it->second;
123  return true;
124  }
125  return false;
126  }
set< int >::iterator it
Definition: NueSkimmer.h:24
template<typename K , typename M >
static auto& art::thread_safe_registry_via_id< K, M >::instance ( )
inlinestaticprivate

Definition at line 69 of file thread_safe_registry_via_id.h.

70  {
71  static collection_type me;
72  return me;
73  }
Definition: NueSkimmer.h:24
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 79 of file thread_safe_registry_via_id.h.

References e.

80  {
81  auto& me = instance();
82  for (auto const& e : container) {
83  me.emplace(e);
84  }
85  }
Definition: NueSkimmer.h:24
::xsd::cxx::tree::type container
Definition: Database.h:112
Float_t e
Definition: plot.C:35

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