CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
edm::pset::Registry Class Reference

#include <Registry.h>

Classes

struct  key_hash
 

Public Types

typedef map_type::const_iterator const_iterator
 
typedef edm::ParameterSetID key_type
 
typedef
tbb::concurrent_unordered_map
< key_type, value_type,
key_hash
map_type
 
typedef std::map
< ParameterSetID,
ParameterSetBlob
regmap_type
 
typedef edm::ParameterSet value_type
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 Not thread safe. More...
 
bool empty () const
 
const_iterator end () const
 
void fillMap (regmap_type &fillme) const
 
bool getMapped (key_type const &k, value_type &result) const
 
value_type const * getMapped (key_type const &k) const
 
bool insertMapped (value_type const &v)
 
void print (std::ostream &os) const
 
size_t size () const
 

Static Public Member Functions

static Registryinstance ()
 

Private Attributes

map_type m_map
 

Detailed Description

Definition at line 26 of file Registry.h.

Member Typedef Documentation

typedef map_type::const_iterator edm::pset::Registry::const_iterator

Definition at line 63 of file Registry.h.

Definition at line 28 of file Registry.h.

typedef tbb::concurrent_unordered_map<key_type,value_type,key_hash> edm::pset::Registry::map_type

Definition at line 62 of file Registry.h.

Fill the given map with the persistent form of each ParameterSet in the registry.

Definition at line 83 of file Registry.h.

Definition at line 29 of file Registry.h.

Member Function Documentation

const_iterator edm::pset::Registry::begin ( void  ) const
inline

Definition at line 65 of file Registry.h.

References m_map.

Referenced by egHLT::trigTools::getMinNrObjsRequiredByFilter(), HLTConfigProvider::init(), and DQMRootOutputModule::startEndFile().

65  {
66  return m_map.begin();
67  }
map_type m_map
Definition: Registry.h:89
void edm::pset::Registry::clear ( void  )

Not thread safe.

Definition at line 44 of file Registry.cc.

References m_map.

Referenced by edm::EventProcessor::~EventProcessor().

44  {
45  m_map.clear();
46  }
map_type m_map
Definition: Registry.h:89
bool edm::pset::Registry::empty ( void  ) const
inline

Definition at line 73 of file Registry.h.

References m_map.

73  {
74  return m_map.empty();
75  }
map_type m_map
Definition: Registry.h:89
const_iterator edm::pset::Registry::end ( void  ) const
inline
void edm::pset::Registry::fillMap ( regmap_type fillme) const

Definition at line 49 of file Registry.cc.

References m_map.

Referenced by edm::StreamSerializer::serializeRegistry().

49  {
50  fillme.clear();
51  // Note: The tracked part is in the registry.
52  for (auto const& item : m_map) {
53  fillme[item.first].pset() = item.second.toString();
54  }
55  }
map_type m_map
Definition: Registry.h:89
bool edm::pset::Registry::getMapped ( key_type const &  k,
value_type result 
) const

Retrieve the value_type object with the given key. If we return 'true', then 'result' carries the value_type object. If we return 'false, no matching key was found, and the value of 'result' is undefined.

Definition at line 22 of file Registry.cc.

References newFWLiteAna::found, and m_map.

Referenced by CompareToObjectMapRecord::analyze(), getHLTConfigData(), edm::getProcessParameterSet(), edm::Event::getProcessParameterSet(), edm::service::TriggerNamesService::getTrigPaths(), HLTConfigProvider::init(), edm::StreamSchedule::initializeEarlyDelete(), edm::parameterSet(), edm::ScheduleInfo::parametersForModule(), edm::EventBase::triggerNames_(), and ProvenanceDumper::work_().

22  {
23  auto it = m_map.find(k);
24  bool found = it != m_map.end();
25  if(found) {
26  result = it->second;
27  }
28  return found;
29  }
tuple result
Definition: query.py:137
map_type m_map
Definition: Registry.h:89
Registry::value_type const * edm::pset::Registry::getMapped ( key_type const &  k) const

Retrieve a pointer to the value_type object with the given key. If there is no object associated with the given key 0 is returned.

Definition at line 32 of file Registry.cc.

References newFWLiteAna::found, and m_map.

32  {
33  auto it = m_map.find(k);
34  bool found = it != m_map.end();
35  return found? &(it->second) : static_cast<value_type const*>(nullptr);
36  }
map_type m_map
Definition: Registry.h:89
bool edm::pset::Registry::insertMapped ( value_type const &  v)

Insert the given value_type object into the registry. If there was already a value_type object with the same key, we don't change it. This should be OK, since it should have the same contents if the key is the same. Return 'true' if we really added the new value_type object, and 'false' if the value_type object was already present.

Definition at line 39 of file Registry.cc.

References edm::ParameterSet::id(), m_map, and findQualityFiles::v.

Referenced by edm::StreamerInputSource::deserializeAndMergeWithRegistry(), fwlite::Event::fillParameterSetRegistry(), edm::ParameterSetConverter::noConvertParameterSets(), edm::ParameterSet::registerFromString(), edm::ParameterSet::registerIt(), edm::RootFile::RootFile(), TFWLiteSelectorBasic::setupNewFile(), and ProvenanceDumper::work_().

39  {
40  return m_map.insert(std::make_pair(v.id(),v)).second;
41  }
map_type m_map
Definition: Registry.h:89
Registry * edm::pset::Registry::instance ( )
static
void edm::pset::Registry::print ( std::ostream &  os) const

Definition at line 58 of file Registry.cc.

References size().

58  {
59  os << "Registry with " << size() << " entries\n";
60  for(auto const& item : *this) {
61  os << item.first << " " << item.second << '\n';
62  }
63  }
size_t size() const
Definition: Registry.h:77
size_t edm::pset::Registry::size ( void  ) const
inline

Definition at line 77 of file Registry.h.

References m_map.

Referenced by print().

77  {
78  return m_map.size();
79  }
map_type m_map
Definition: Registry.h:89

Member Data Documentation

map_type edm::pset::Registry::m_map
private

Definition at line 89 of file Registry.h.

Referenced by begin(), clear(), empty(), end(), fillMap(), getMapped(), insertMapped(), and size().