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

#include <registry.h>

Public Types

typedef iter_t const_iterator
 

Static Public Member Functions

static bool empty ()
 
static reg_t::size_type size ()
 
static const_iterator begin ()
 
static const_iterator end ()
 
static void put (K const &key, V const &value)
 
static V const & get (K const &key)
 
static bool get (K const &key, V &value) throw ()
 

Private Types

typedef std::map< K const, V > reg_t
 
typedef reg_t::const_iterator iter_t
 

Private Member Functions

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

Static Private Member Functions

static reg_tthe_registry_ ()
 

Detailed Description

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

Definition at line 17 of file registry.h.

Member Typedef Documentation

template<class K , class V >
typedef iter_t cet::registry< K, V >::const_iterator

Definition at line 34 of file registry.h.

template<class K , class V >
typedef reg_t::const_iterator cet::registry< K, V >::iter_t
private

Definition at line 31 of file registry.h.

template<class K , class V >
typedef std::map<K const, V> cet::registry< K, V >::reg_t
private

Definition at line 30 of file registry.h.

Constructor & Destructor Documentation

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

Member Function Documentation

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

Definition at line 48 of file registry.h.

49  {
50  return the_registry_().begin();
51  }
static reg_t & the_registry_()
Definition: registry.h:66
template<class K , class V >
static bool cet::registry< K, V >::empty ( )
inlinestatic

Definition at line 37 of file registry.h.

38  {
39  return the_registry_().empty();
40  }
static reg_t & the_registry_()
Definition: registry.h:66
template<class K , class V >
static const_iterator cet::registry< K, V >::end ( )
inlinestatic

Definition at line 53 of file registry.h.

54  {
55  return the_registry_().end();
56  }
static reg_t & the_registry_()
Definition: registry.h:66
template<class K , class V >
V const & cet::registry< K, V >::get ( K const &  key)
static

Definition at line 85 of file registry.h.

86 {
87  iter_t it = the_registry_().find(key);
88  if (it == the_registry_().end())
89  throw cet::exception("cet::registry")
90  << "Key \"" << key << "\" not found in registry";
91  return it->second;
92 }
static reg_t & the_registry_()
Definition: registry.h:66
def key(type, name=None)
Definition: graph.py:13
static const_iterator end()
Definition: registry.h:53
reg_t::const_iterator iter_t
Definition: registry.h:31
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<class K , class V >
bool cet::registry< K, V >::get ( K const &  key,
V &  value 
)
throw (
)
static

Definition at line 96 of file registry.h.

96  {
97  value = get(key);
98  return true;
99 }
100 catch (cet::exception const&) {
101  return false;
102 }
def key(type, name=None)
Definition: graph.py:13
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<class K , class V >
void cet::registry< K, V >::operator= ( registry< K, V > const &  )
privatedelete
template<class K , class V >
void cet::registry< K, V >::put ( K const &  key,
V const &  value 
)
static

Definition at line 78 of file registry.h.

79 {
80  the_registry_().insert(std::make_pair(key, value));
81 }
static reg_t & the_registry_()
Definition: registry.h:66
def key(type, name=None)
Definition: graph.py:13
template<class K , class V >
static reg_t::size_type cet::registry< K, V >::size ( )
inlinestatic

Definition at line 42 of file registry.h.

43  {
44  return the_registry_().size();
45  }
static reg_t & the_registry_()
Definition: registry.h:66
template<class K , class V >
static reg_t& cet::registry< K, V >::the_registry_ ( )
inlinestaticprivate

Definition at line 66 of file registry.h.

67  {
68  static reg_t the_registry;
69  return the_registry;
70  }
std::map< K const, V > reg_t
Definition: registry.h:30

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