CMS 3D CMS Logo

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_hashmap_type
 
typedef std::map< ParameterSetID, ParameterSetBlobregmap_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
 
value_type const * getMapped (key_type const &k) const
 
bool getMapped (key_type const &k, value_type &result) const
 
bool insertMapped (value_type const &v, bool forceUpdate=false)
 
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

◆ const_iterator

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

Definition at line 61 of file Registry.h.

◆ key_type

Definition at line 28 of file Registry.h.

◆ map_type

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

Definition at line 60 of file Registry.h.

◆ regmap_type

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

Definition at line 73 of file Registry.h.

◆ value_type

Definition at line 29 of file Registry.h.

Member Function Documentation

◆ begin()

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

Definition at line 63 of file Registry.h.

63 { return m_map.begin(); }

References m_map.

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

◆ clear()

void edm::pset::Registry::clear ( void  )

Not thread safe.

Definition at line 40 of file Registry.cc.

40 { m_map.clear(); }

References m_map.

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

◆ empty()

bool edm::pset::Registry::empty ( void  ) const
inline

Definition at line 67 of file Registry.h.

67 { return m_map.empty(); }

References m_map.

◆ end()

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

◆ fillMap()

void edm::pset::Registry::fillMap ( regmap_type fillme) const

Definition at line 42 of file Registry.cc.

42  {
43  fillme.clear();
44  // Note: The tracked part is in the registry.
45  for (auto const& item : m_map) {
46  fillme[item.first].pset() = item.second.toString();
47  }
48  }

References B2GTnPMonitor_cfi::item, and m_map.

Referenced by ParameterSetBlobProducer::globalBeginRunProduce(), and edm::StreamSerializer::serializeRegistry().

◆ getMapped() [1/2]

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 26 of file Registry.cc.

26  {
27  auto it = m_map.find(k);
28  bool found = it != m_map.end();
29  return found ? &(it->second) : static_cast<value_type const*>(nullptr);
30  }

References newFWLiteAna::found, dqmdumpme::k, and m_map.

◆ getMapped() [2/2]

bool edm::pset::Registry::getMapped ( key_type const &  k,
value_type result 
) const

◆ insertMapped()

bool edm::pset::Registry::insertMapped ( value_type const &  v,
bool  forceUpdate = false 
)

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 32 of file Registry.cc.

32  {
33  auto wasAdded = m_map.insert(std::make_pair(v.id(), v));
34  if (forceUpdate and not wasAdded.second) {
35  wasAdded.first->second = v;
36  }
37  return wasAdded.second;
38  }

References m_map, and findQualityFiles::v.

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

◆ instance()

Registry * edm::pset::Registry::instance ( )
static

Definition at line 12 of file Registry.cc.

12  {
13  CMS_THREAD_SAFE static Registry s_reg;
14  return &s_reg;
15  }

References CMS_THREAD_SAFE.

Referenced by CompareToObjectMapRecord::analyze(), TrackingMonitor::analyze(), edm::EventContentAnalyzer::analyze(), TrackingMonitor::bookHistograms(), edm::StreamerInputSource::deserializeAndMergeWithRegistry(), edm::edmModuleTypeEnum(), DependencyGraph::edmModuleTypeEnum(), edm::fillParameterSetBranch(), fwlite::Event::fillParameterSetRegistry(), gen::BaseHadronizer::generateLHE(), HLTConfigProvider::getDataFrom(), getHLTConfigData(), egHLT::trigTools::getMinNrObjsRequiredByFilter(), edm::getParameterSet(), edm::Event::getProcessParameterSet(), edm::getProducerParameterSet(), edm::service::TriggerNamesService::getTrigPaths(), ParameterSetBlobProducer::globalBeginRunProduce(), HLTConfigProvider::init(), edm::StreamSchedule::initializeEarlyDelete(), edm::Maker::makeModule(), edm::ParameterSetConverter::noConvertParameterSets(), FWFileEntry::openFile(), edm::parameterSet(), edm::EventBase::parameterSetForID_(), edm::ScheduleInfo::parametersForModule(), edm::ParameterSet::registerFromString(), edm::ParameterSet::registerIt(), edm::RootFile::RootFile(), edm::StreamSerializer::serializeRegistry(), TFWLiteSelectorBasic::setupNewFile(), DQMRootOutputModule::startEndFile(), TriggerOutputBranches::triggerNames(), edm::EventBase::triggerNames_(), ProvenanceDumper::work_(), edm::AsciiOutputModule::write(), and edm::EventProcessor::~EventProcessor().

◆ print()

void edm::pset::Registry::print ( std::ostream &  os) const

Definition at line 50 of file Registry.cc.

50  {
51  os << "Registry with " << size() << " entries\n";
52  for (auto const& item : *this) {
53  os << item.first << " " << item.second << '\n';
54  }
55  }

References B2GTnPMonitor_cfi::item, and size().

◆ size()

size_t edm::pset::Registry::size ( void  ) const
inline

Definition at line 69 of file Registry.h.

69 { return m_map.size(); }

References m_map.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), and print().

Member Data Documentation

◆ m_map

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

Definition at line 79 of file Registry.h.

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

findQualityFiles.v
v
Definition: findQualityFiles.py:179
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
dqmdumpme.k
k
Definition: dqmdumpme.py:60
CMS_THREAD_SAFE
#define CMS_THREAD_SAFE
Definition: thread_safety_macros.h:4
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::pset::Registry::size
size_t size() const
Definition: Registry.h:69
mps_fire.result
result
Definition: mps_fire.py:303
edm::pset::Registry::m_map
map_type m_map
Definition: Registry.h:79