#include <ThreadSafeRegistry.h>
Public Types | |
typedef std::map< key_type, value_type > | collection_type |
typedef collection_type::const_iterator | const_iterator |
typedef E | extra_type |
typedef KEY | key_type |
typedef collection_type::size_type | size_type |
typedef T | value_type |
typedef std::vector< value_type > | vector_type |
Public Member Functions | |
const_iterator | begin () const |
collection_type & | data () |
Provide access to the contained collection. | |
collection_type const & | data () const |
bool | empty () const |
Return true if there are no contained value_type objects. | |
const_iterator | end () const |
extra_type const & | extra () const |
extra_type & | extra () |
value_type const * | getMapped (key_type const &k) const |
bool | getMapped (key_type const &k, value_type &result) const |
void | insertCollection (collection_type const &c) |
void | insertCollection (vector_type const &c) |
bool | insertMapped (value_type const &v) |
bool | notEmpty () const |
Return true if there are any contained value_type objects. | |
void | print (std::ostream &os) const |
Print the contents of this registry to the given ostream. | |
size_type | size () const |
Return the number of contained value_type objects. | |
Static Public Member Functions | |
static ThreadSafeRegistry * | instance () |
Private Member Functions | |
ThreadSafeRegistry< KEY, T, E > & | operator= (ThreadSafeRegistry< KEY, T, E > const &) |
ThreadSafeRegistry () | |
ThreadSafeRegistry (ThreadSafeRegistry< KEY, T, E > const &) | |
~ThreadSafeRegistry () | |
Private Attributes | |
collection_type | data_ |
extra_type | extra_ |
Static Private Attributes | |
static ThreadSafeRegistry * | instance_ = 0 |
static boost::mutex | registry_mutex |
Definition at line 33 of file ThreadSafeRegistry.h.
typedef std::map<key_type, value_type> edm::detail::ThreadSafeRegistry< KEY, T, E >::collection_type |
Definition at line 38 of file ThreadSafeRegistry.h.
typedef collection_type::const_iterator edm::detail::ThreadSafeRegistry< KEY, T, E >::const_iterator |
Definition at line 41 of file ThreadSafeRegistry.h.
typedef E edm::detail::ThreadSafeRegistry< KEY, T, E >::extra_type |
Definition at line 37 of file ThreadSafeRegistry.h.
typedef KEY edm::detail::ThreadSafeRegistry< KEY, T, E >::key_type |
Definition at line 35 of file ThreadSafeRegistry.h.
typedef collection_type::size_type edm::detail::ThreadSafeRegistry< KEY, T, E >::size_type |
Definition at line 39 of file ThreadSafeRegistry.h.
typedef T edm::detail::ThreadSafeRegistry< KEY, T, E >::value_type |
Definition at line 36 of file ThreadSafeRegistry.h.
typedef std::vector<value_type> edm::detail::ThreadSafeRegistry< KEY, T, E >::vector_type |
Definition at line 43 of file ThreadSafeRegistry.h.
edm::detail::ThreadSafeRegistry< KEY, T, E >::ThreadSafeRegistry | ( | ) | [private] |
Definition at line 285 of file ThreadSafeRegistry.h.
: data_() { }
edm::detail::ThreadSafeRegistry< KEY, T, E >::~ThreadSafeRegistry | ( | ) | [private] |
Definition at line 291 of file ThreadSafeRegistry.h.
{ }
edm::detail::ThreadSafeRegistry< KEY, T, E >::ThreadSafeRegistry | ( | ThreadSafeRegistry< KEY, T, E > const & | ) | [private] |
ThreadSafeRegistry< KEY, T, E >::const_iterator edm::detail::ThreadSafeRegistry< KEY, T, E >::begin | ( | void | ) | const [inline] |
Allow iteration through the contents of the registry. Only const access is provided to the entries of the registry.
Definition at line 236 of file ThreadSafeRegistry.h.
Referenced by edm::pset::fillMap(), egHLT::trigTools::getMinNrObjsRequiredByFilter(), HLTConfigProvider::init(), DQMRootOutputModule::startEndFile(), and edm::RootOutputFile::writeParentageRegistry().
{ return data_.begin(); }
ThreadSafeRegistry< KEY, T, E >::collection_type & edm::detail::ThreadSafeRegistry< KEY, T, E >::data | ( | ) | [inline] |
Provide access to the contained collection.
Definition at line 259 of file ThreadSafeRegistry.h.
Referenced by edm::EventProcessor::~EventProcessor().
{ return data_; }
ThreadSafeRegistry< KEY, T, E >::collection_type const & edm::detail::ThreadSafeRegistry< KEY, T, E >::data | ( | ) | const [inline] |
Definition at line 280 of file ThreadSafeRegistry.h.
{ return data_; }
bool edm::detail::ThreadSafeRegistry< KEY, T, E >::empty | ( | void | ) | const [inline] |
Return true if there are no contained value_type objects.
Definition at line 215 of file ThreadSafeRegistry.h.
{ return data_.empty(); }
ThreadSafeRegistry< KEY, T, E >::const_iterator edm::detail::ThreadSafeRegistry< KEY, T, E >::end | ( | void | ) | const [inline] |
Definition at line 243 of file ThreadSafeRegistry.h.
Referenced by edm::pset::fillMap(), egHLT::trigTools::getMinNrObjsRequiredByFilter(), HLTConfigProvider::init(), DQMRootOutputModule::startEndFile(), and edm::RootOutputFile::writeParentageRegistry().
{ return data_.end(); }
ThreadSafeRegistry< KEY, T, E >::extra_type const & edm::detail::ThreadSafeRegistry< KEY, T, E >::extra | ( | ) | const [inline] |
Definition at line 273 of file ThreadSafeRegistry.h.
{ return extra_; }
ThreadSafeRegistry< KEY, T, E >::extra_type & edm::detail::ThreadSafeRegistry< KEY, T, E >::extra | ( | ) | [inline] |
Provide access to the appendage "extra". The ThreadSafeRegistry doesn't know what this is for, but instantiations of the template can use it.
Definition at line 266 of file ThreadSafeRegistry.h.
Referenced by edm::pset::getProcessParameterSetID(), and edm::EventProcessor::~EventProcessor().
{ return extra_; }
bool edm::detail::ThreadSafeRegistry< KEY, T, E >::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 153 of file ThreadSafeRegistry.h.
References newFWLiteAna::found, i, and CommonMethods::lock().
Referenced by edm::Principal::fillPrincipal(), HLTConfigProvider::getDataFrom(), edm::Event::getProcessParameterSet(), edm::getProcessParameterSet(), edm::service::TriggerNamesService::getTrigPaths(), HLTConfigProvider::init(), edm::Provenance::processConfigurationID(), DQMRootOutputModule::startEndFile(), edm::EventBase::triggerNames_(), and ProvenanceDumper::work_().
{ bool found; const_iterator i; { // This scope limits the lifetime of the lock to the shorted // required interval. boost::mutex::scoped_lock lock(registry_mutex); i = data_.find(k); found = (i != data_.end()); } if (found) result = i->second; return found; }
ThreadSafeRegistry< KEY, T, E >::value_type const * edm::detail::ThreadSafeRegistry< KEY, T, E >::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 169 of file ThreadSafeRegistry.h.
References newFWLiteAna::found, i, and CommonMethods::lock().
{ bool found; const_iterator i; { // This scope limits the lifetime of the lock to the shorted // required interval. boost::mutex::scoped_lock lock(registry_mutex); i = data_.find(k); found = (i != data_.end()); } return found ? &(i->second) : static_cast<value_type const*> (0); }
void edm::detail::ThreadSafeRegistry< KEY, T, E >::insertCollection | ( | vector_type const & | c | ) |
Definition at line 206 of file ThreadSafeRegistry.h.
{ for (typename vector_type::const_iterator it = c.begin(), itEnd = c.end(); it != itEnd; ++it) { insertMapped(*it); } }
void edm::detail::ThreadSafeRegistry< KEY, T, E >::insertCollection | ( | collection_type const & | c | ) |
put the value_type objects in the given collection into the registry.
Definition at line 198 of file ThreadSafeRegistry.h.
{ for (typename collection_type::const_iterator it = c.begin(), itEnd = c.end(); it != itEnd; ++it) { insertMapped(it->second); } }
bool edm::detail::ThreadSafeRegistry< KEY, T, E >::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 184 of file ThreadSafeRegistry.h.
References CommonMethods::lock(), and v.
Referenced by edm::StreamerInputSource::deserializeAndMergeWithRegistry(), fwlite::Event::fillParameterSetRegistry(), HLTConfigProvider::getDataFrom(), edm::RootFile::RootFile(), DQMRootSource::setupFile(), TFWLiteSelectorBasic::setupNewFile(), and ProvenanceDumper::work_().
ThreadSafeRegistry< KEY, T, E > * edm::detail::ThreadSafeRegistry< KEY, T, E >::instance | ( | ) | [static] |
Definition at line 140 of file ThreadSafeRegistry.h.
References CommonMethods::lock().
Referenced by edm::RunPrincipal::addToProcessHistory(), GsfElectronBaseProducer::checkEcalSeedingParameters(), GsfElectronProducer::checkPfTranslatorParameters(), edm::RunPrincipal::checkProcessHistory(), edm::StreamerInputSource::deserializeAndMergeWithRegistry(), edm::StreamerInputSource::deserializeEvent(), edm::OutputModule::fillDependencyGraph(), fwlite::Event::fillParameterSetRegistry(), edm::Principal::fillPrincipal(), edm::fillProductRegistryTransients(), HLTConfigProvider::getDataFrom(), egHLT::trigTools::getMinNrObjsRequiredByFilter(), edm::getParameterSet(), edm::Event::getProcessParameterSet(), edm::getProcessParameterSet(), edm::service::TriggerNamesService::getTrigPaths(), HLTConfigProvider::init(), edm::ParameterSetConverter::noConvertParameterSets(), edm::ParameterSet::ParameterSet(), edm::ScheduleInfo::parametersForModule(), edm::ProductProvenance::parentage(), edm::Provenance::processConfigurationID(), edm::ProductProvenance::ProductProvenance(), edm::ParameterSet::registerIt(), edm::Provenance::releaseVersion(), edm::RootFile::RootFile(), edm::Schedule::Schedule(), edm::StreamSerializer::serializeEvent(), edm::StreamerOutputModuleBase::serializeRegistry(), edm::StreamSerializer::serializeRegistry(), DQMRootSource::setupFile(), TFWLiteSelectorBasic::setupNewFile(), DQMRootOutputModule::startEndFile(), edm::EventBase::triggerNames_(), ProvenanceDumper::work_(), edm::RootOutputFile::writeParameterSetRegistry(), edm::RootOutputFile::writeParentageRegistry(), edm::RootOutputFile::writeProcessConfigurationRegistry(), edm::RootOutputFile::writeProcessHistoryRegistry(), and edm::EventProcessor::~EventProcessor().
bool edm::detail::ThreadSafeRegistry< KEY, T, E >::notEmpty | ( | ) | const [inline] |
Return true if there are any contained value_type objects.
Definition at line 222 of file ThreadSafeRegistry.h.
References relativeConstraints::empty.
Referenced by edm::Principal::fillPrincipal().
{ return !empty(); }
ThreadSafeRegistry<KEY,T,E>& edm::detail::ThreadSafeRegistry< KEY, T, E >::operator= | ( | ThreadSafeRegistry< KEY, T, E > const & | ) | [private] |
void edm::detail::ThreadSafeRegistry< KEY, T, E >::print | ( | std::ostream & | os | ) | const |
Print the contents of this registry to the given ostream.
Definition at line 249 of file ThreadSafeRegistry.h.
References begin, end, i, and findQualityFiles::size.
ThreadSafeRegistry< KEY, T, E >::size_type edm::detail::ThreadSafeRegistry< KEY, T, E >::size | ( | void | ) | const [inline] |
Return the number of contained value_type objects.
Definition at line 229 of file ThreadSafeRegistry.h.
{ return data_.size(); }
collection_type edm::detail::ThreadSafeRegistry< KEY, T, E >::data_ [private] |
Definition at line 110 of file ThreadSafeRegistry.h.
extra_type edm::detail::ThreadSafeRegistry< KEY, T, E >::extra_ [private] |
Definition at line 111 of file ThreadSafeRegistry.h.
ThreadSafeRegistry< KEY, T, E > * edm::detail::ThreadSafeRegistry< KEY, T, E >::instance_ = 0 [static, private] |
Definition at line 113 of file ThreadSafeRegistry.h.
boost::mutex edm::detail::ThreadSafeRegistry< KEY, T, E >::registry_mutex [static, private] |
Definition at line 115 of file ThreadSafeRegistry.h.