Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
cet::registry_via_id< K, V > Class Template Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/cetlib/v3_06_01/source/cetlib/registry_via_id.h"

Public Types

typedef std::map< K const, V > collection_type
 
typedef collection_type::key_type key_type
 
typedef collection_type::mapped_type mapped_type
 
typedef collection_type::value_type value_type
 
typedef collection_type::size_type size_type
 
typedef collection_type::const_iterator const_iterator
 

Public Member Functions

template<class FwdIt >
auto put (FwdIt b, FwdIt e) -> std::enable_if_t< std::is_same< typename std::iterator_traits< FwdIt >::value_type, mapped_type >::value, void >
 

Static Public Member Functions

static bool empty ()
 
static size_type size ()
 
static const_iterator begin ()
 
static const_iterator end ()
 
static const_iterator cbegin ()
 
static const_iterator cend ()
 
static detail::must_have_id< K, V >::type put (V const &value)
 
template<class FwdIt >
static std::enable_if_t< std::is_same< typename std::iterator_traits< FwdIt >::value_type, mapped_type >::value, voidput (FwdIt begin, FwdIt end)
 
template<class FwdIt >
static std::enable_if_t< std::is_same< typename std::iterator_traits< FwdIt >::value_type, value_type >::value, voidput (FwdIt begin, FwdIt end)
 
static void put (collection_type const &c)
 
static collection_type const & get () noexcept
 
static V const & get (K const &key)
 
static bool get (K const &key, V &value) noexcept
 

Private Member Functions

 registry_via_id ()=delete
 
 registry_via_id (registry_via_id const &)=delete
 
void operator= (registry_via_id const &)=delete
 

Static Private Member Functions

static collection_typethe_registry_ ()
 

Detailed Description

template<class K, class V>
class cet::registry_via_id< K, V >

Definition at line 21 of file registry_via_id.h.

Member Typedef Documentation

template<class K , class V >
typedef std::map<K const, V> cet::registry_via_id< K, V >::collection_type

Definition at line 41 of file registry_via_id.h.

template<class K , class V >
typedef collection_type::const_iterator cet::registry_via_id< K, V >::const_iterator

Definition at line 46 of file registry_via_id.h.

template<class K , class V >
typedef collection_type::key_type cet::registry_via_id< K, V >::key_type

Definition at line 42 of file registry_via_id.h.

template<class K , class V >
typedef collection_type::mapped_type cet::registry_via_id< K, V >::mapped_type

Definition at line 43 of file registry_via_id.h.

template<class K , class V >
typedef collection_type::size_type cet::registry_via_id< K, V >::size_type

Definition at line 45 of file registry_via_id.h.

template<class K , class V >
typedef collection_type::value_type cet::registry_via_id< K, V >::value_type

Definition at line 44 of file registry_via_id.h.

Constructor & Destructor Documentation

template<class K , class V >
cet::registry_via_id< K, V >::registry_via_id ( )
privatedelete
template<class K , class V >
cet::registry_via_id< K, V >::registry_via_id ( registry_via_id< K, V > const &  )
privatedelete

Member Function Documentation

template<class K , class V >
static const_iterator cet::registry_via_id< K, V >::begin ( )
inlinestatic

Definition at line 62 of file registry_via_id.h.

63  {
64  return the_registry_().begin();
65  }
static collection_type & the_registry_()
template<class K , class V >
static const_iterator cet::registry_via_id< K, V >::cbegin ( )
inlinestatic

Definition at line 72 of file registry_via_id.h.

73  {
74  return the_registry_().cbegin();
75  }
static collection_type & the_registry_()
template<class K , class V >
static const_iterator cet::registry_via_id< K, V >::cend ( )
inlinestatic

Definition at line 77 of file registry_via_id.h.

References plot_validation_datamc::c, and febshutoff_auto::end.

78  {
79  return the_registry_().cend();
80  }
static collection_type & the_registry_()
template<class K , class V >
static bool cet::registry_via_id< K, V >::empty ( )
inlinestatic

Definition at line 50 of file registry_via_id.h.

51  {
52  return the_registry_().empty();
53  }
static collection_type & the_registry_()
template<class K , class V >
static const_iterator cet::registry_via_id< K, V >::end ( )
inlinestatic

Definition at line 67 of file registry_via_id.h.

68  {
69  return the_registry_().end();
70  }
static collection_type & the_registry_()
template<class K , class V >
static collection_type const& cet::registry_via_id< K, V >::get ( )
inlinestaticnoexcept

Definition at line 106 of file registry_via_id.h.

References K, and findDuplicateFiles::key.

107  {
108  return the_registry_();
109  }
static collection_type & the_registry_()
template<class K , class V >
V const & cet::registry_via_id< K, V >::get ( K const &  key)
static

Definition at line 171 of file registry_via_id.h.

References febshutoff_auto::end, and it.

172 {
174  if (it == the_registry_().end())
175  throw cet::exception("cet::registry_via_id")
176  << "Key \"" << key << "\" not found in registry";
177  return it->second;
178 }
collection_type::const_iterator const_iterator
set< int >::iterator it
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
static const_iterator end()
static collection_type & the_registry_()
template<class K , class V >
bool cet::registry_via_id< K, V >::get ( K const &  key,
V &  value 
)
staticnoexcept

Definition at line 182 of file registry_via_id.h.

References febshutoff_auto::end, it, findDuplicateFiles::key, and fillBadChanDBTables::result.

183 {
184  bool result;
186  if (it == the_registry_().end()) {
187  result = false;
188  } else {
189  value = it->second;
190  result = true;
191  }
192  return result;
193 }
collection_type::const_iterator const_iterator
set< int >::iterator it
static const_iterator end()
static collection_type & the_registry_()
const XML_Char int const XML_Char * value
Definition: expat.h:331
template<class K , class V >
void cet::registry_via_id< K, V >::operator= ( registry_via_id< K, V > const &  )
privatedelete
template<class K , class V >
cet::detail::must_have_id< K, V >::type cet::registry_via_id< K, V >::put ( V const &  value)
static

Definition at line 129 of file registry_via_id.h.

References K.

Referenced by cet::registry_via_id< K, V >::put().

130 {
131  K id = value.id();
132  the_registry_().emplace(id, value);
133  return id;
134 }
::xsd::cxx::tree::id< char, ncname > id
Definition: Database.h:165
Double_t K
static collection_type & the_registry_()
const XML_Char int const XML_Char * value
Definition: expat.h:331
template<class K , class V >
template<class FwdIt >
static std::enable_if_t< std::is_same<typename std::iterator_traits<FwdIt>::value_type, mapped_type>::value, void> cet::registry_via_id< K, V >::put ( FwdIt  begin,
FwdIt  end 
)
static
template<class K , class V >
template<class FwdIt >
static std::enable_if_t< std::is_same<typename std::iterator_traits<FwdIt>::value_type, value_type>::value, void> cet::registry_via_id< K, V >::put ( FwdIt  begin,
FwdIt  end 
)
static
template<class K , class V >
void cet::registry_via_id< K, V >::put ( collection_type const &  c)
inlinestatic

Definition at line 161 of file registry_via_id.h.

162 {
163  put(c.cbegin(), c.cend());
164 }
static detail::must_have_id< K, V >::type put(V const &value)
template<class K , class V >
template<class FwdIt >
auto cet::registry_via_id< K, V >::put ( FwdIt  b,
FwdIt  e 
) -> std::enable_if_t< std::is_same<typename std::iterator_traits<FwdIt>::value_type, mapped_type>::value, void>
inline

Definition at line 139 of file registry_via_id.h.

References b, e, and cet::registry_via_id< K, V >::put().

143 {
144  for (; b != e; ++b)
145  (void)put(*b);
146 }
const hit & b
Definition: hits.cxx:21
static detail::must_have_id< K, V >::type put(V const &value)
Float_t e
Definition: plot.C:35
template<class K , class V >
static size_type cet::registry_via_id< K, V >::size ( void  )
inlinestatic

Definition at line 55 of file registry_via_id.h.

56  {
57  return the_registry_().size();
58  }
static collection_type & the_registry_()
template<class K , class V >
static collection_type& cet::registry_via_id< K, V >::the_registry_ ( )
inlinestaticprivate

Definition at line 116 of file registry_via_id.h.

117  {
118  static collection_type the_registry;
119  return the_registry;
120  }
std::map< K const, V > collection_type

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