CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::detail::ThreadSafeRegistry< KEY, T, E > Class Template Reference

#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_typevector_type
 

Public Member Functions

const_iterator begin () const
 
collection_typedata ()
 Provide access to the contained collection. More...
 
collection_type const & data () const
 
bool empty () const
 Return true if there are no contained value_type objects. More...
 
const_iterator end () const
 
extra_typeextra ()
 
extra_type const & extra () const
 
bool getMapped (key_type const &k, value_type &result) const
 
value_type const * getMapped (key_type const &k) 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. More...
 
void print (std::ostream &os) const
 Print the contents of this registry to the given ostream. More...
 
size_type size () const
 Return the number of contained value_type objects. More...
 

Static Public Member Functions

static ThreadSafeRegistryinstance ()
 

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_
 

Detailed Description

template<typename KEY, typename T, typename E = empty>
class edm::detail::ThreadSafeRegistry< KEY, T, E >

Definition at line 34 of file ThreadSafeRegistry.h.

Member Typedef Documentation

template<typename KEY, typename T, typename E = empty>
typedef std::map<key_type, value_type> edm::detail::ThreadSafeRegistry< KEY, T, E >::collection_type

Definition at line 39 of file ThreadSafeRegistry.h.

template<typename KEY, typename T, typename E = empty>
typedef collection_type::const_iterator edm::detail::ThreadSafeRegistry< KEY, T, E >::const_iterator

Definition at line 42 of file ThreadSafeRegistry.h.

template<typename KEY, typename T, typename E = empty>
typedef E edm::detail::ThreadSafeRegistry< KEY, T, E >::extra_type

Definition at line 38 of file ThreadSafeRegistry.h.

template<typename KEY, typename T, typename E = empty>
typedef KEY edm::detail::ThreadSafeRegistry< KEY, T, E >::key_type

Definition at line 36 of file ThreadSafeRegistry.h.

template<typename KEY, typename T, typename E = empty>
typedef collection_type::size_type edm::detail::ThreadSafeRegistry< KEY, T, E >::size_type

Definition at line 40 of file ThreadSafeRegistry.h.

template<typename KEY, typename T, typename E = empty>
typedef T edm::detail::ThreadSafeRegistry< KEY, T, E >::value_type

Definition at line 37 of file ThreadSafeRegistry.h.

template<typename KEY, typename T, typename E = empty>
typedef std::vector<value_type> edm::detail::ThreadSafeRegistry< KEY, T, E >::vector_type

Definition at line 44 of file ThreadSafeRegistry.h.

Constructor & Destructor Documentation

template<typename KEY , typename T , typename E >
edm::detail::ThreadSafeRegistry< KEY, T, E >::ThreadSafeRegistry ( )
private

Definition at line 212 of file ThreadSafeRegistry.h.

212  :
213  data_()
214  { }
template<typename KEY , typename T , typename E >
edm::detail::ThreadSafeRegistry< KEY, T, E >::~ThreadSafeRegistry ( )
private

Definition at line 218 of file ThreadSafeRegistry.h.

219  { }
template<typename KEY, typename T, typename E = empty>
edm::detail::ThreadSafeRegistry< KEY, T, E >::ThreadSafeRegistry ( ThreadSafeRegistry< KEY, T, E > const &  )
private

Member Function Documentation

template<typename KEY , typename T , typename E >
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 163 of file ThreadSafeRegistry.h.

Referenced by edm::pset::fillMap(), egHLT::trigTools::getMinNrObjsRequiredByFilter(), HLTConfigProvider::init(), DQMRootOutputModule::startEndFile(), and edm::RootOutputFile::writeParameterSetRegistry().

163  {
164  return data_.begin();
165  }
template<typename KEY , typename T , typename E >
ThreadSafeRegistry< KEY, T, E >::collection_type & edm::detail::ThreadSafeRegistry< KEY, T, E >::data ( )
inline
template<typename KEY , typename T , typename E >
ThreadSafeRegistry< KEY, T, E >::collection_type const & edm::detail::ThreadSafeRegistry< KEY, T, E >::data ( ) const
inline

Definition at line 207 of file ThreadSafeRegistry.h.

Referenced by cuy.FindIssue::__init__().

207  {
208  return data_;
209  }
template<typename KEY , typename T , typename E >
bool edm::detail::ThreadSafeRegistry< KEY, T, E >::empty ( void  ) const
inline

Return true if there are no contained value_type objects.

Definition at line 142 of file ThreadSafeRegistry.h.

142  {
143  return data_.empty();
144  }
template<typename KEY , typename T , typename E >
ThreadSafeRegistry< KEY, T, E >::const_iterator edm::detail::ThreadSafeRegistry< KEY, T, E >::end ( void  ) const
inline
template<typename KEY , typename T , typename E >
ThreadSafeRegistry< KEY, T, E >::extra_type & edm::detail::ThreadSafeRegistry< KEY, T, E >::extra ( )
inline
template<typename KEY , typename T , typename E >
ThreadSafeRegistry< KEY, T, E >::extra_type const & edm::detail::ThreadSafeRegistry< KEY, T, E >::extra ( ) const
inline

Definition at line 200 of file ThreadSafeRegistry.h.

200  {
201  return extra_;
202  }
template<typename KEY, typename T, typename E = empty>
bool edm::detail::ThreadSafeRegistry< KEY, T, E >::getMapped ( key_type const &  k,
value_type result 
) const
template<typename KEY, typename T, typename E = empty>
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.

template<typename KEY , typename T , typename E >
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 125 of file ThreadSafeRegistry.h.

Referenced by edm::RootFile::RootFile(), and TFWLiteSelectorBasic::setupNewFile().

125  {
126  for (typename collection_type::const_iterator it = c.begin(), itEnd = c.end(); it != itEnd; ++it) {
127  insertMapped(it->second);
128  }
129  }
bool insertMapped(value_type const &v)
template<typename KEY , typename T , typename E >
void edm::detail::ThreadSafeRegistry< KEY, T, E >::insertCollection ( vector_type const &  c)

Definition at line 133 of file ThreadSafeRegistry.h.

133  {
134  for (typename vector_type::const_iterator it = c.begin(), itEnd = c.end(); it != itEnd; ++it) {
135  insertMapped(*it);
136  }
137  }
bool insertMapped(value_type const &v)
template<typename KEY, typename T, typename E = empty>
bool edm::detail::ThreadSafeRegistry< KEY, T, E >::insertMapped ( value_type const &  v)
template<typename KEY, typename T, typename E = empty>
static ThreadSafeRegistry* edm::detail::ThreadSafeRegistry< KEY, T, E >::instance ( )
static

Referenced by ProvenanceDumper::addAncestors(), CompareToObjectMapRecord::analyze(), edm::HistoryAppender::appendToProcessHistory(), edm::SubProcess::beginRun(), GsfElectronBaseProducer::checkEcalSeedingParameters(), GsfElectronProducer::checkPfTranslatorParameters(), edm::DaqProvenanceHelper::daqInit(), edm::StreamerInputSource::deserializeAndMergeWithRegistry(), edm::StreamerInputSource::deserializeEvent(), edm::OutputModule::fillDependencyGraph(), edm::RootFile::fillIndexIntoFile(), fwlite::Event::fillParameterSetRegistry(), edm::Principal::fillPrincipal(), edm::fillProductRegistryTransients(), HLTConfigProvider::getDataFrom(), egHLT::trigTools::getMinNrObjsRequiredByFilter(), edm::getParameterSet(), edm::getProcessParameterSet(), edm::Event::getProcessParameterSet(), edm::service::TriggerNamesService::getTrigPaths(), HLTConfigProvider::HLTConfigCounterSentry::HLTConfigCounterSentry(), HLTConfigProvider::init(), edm::Schedule::initializeEarlyDelete(), edm::PrincipalCache::insert(), edm::LHEProvenanceHelper::lheInit(), edm::PrincipalCache::merge(), edm::ParameterSetConverter::noConvertParameterSets(), edm::ParameterSet::ParameterSet(), edm::ScheduleInfo::parametersForModule(), edm::ProductProvenance::parentage(), edm::Provenance::processConfigurationID(), edm::ProductProvenance::ProductProvenance(), edm::RootFile::readEntryDescriptionTree(), edm::RootFile::readEvent(), edm::RootFile::readParentageTree(), edm::OldProvenanceReader::readProvenance(), edm::InputSource::reducedProcessHistoryID(), edm::FullHistoryToReducedHistoryMap::reduceProcessHistoryID(), edm::IndexIntoFile::reduceProcessHistoryIDs(), 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::writeLuminosityBlock(), edm::RootOutputFile::writeOne(), edm::RootOutputFile::writeParameterSetRegistry(), edm::RootOutputFile::writeParentageRegistry(), edm::RootOutputFile::writeProcessConfigurationRegistry(), edm::RootOutputFile::writeProcessHistoryRegistry(), edm::RootOutputFile::writeRun(), edm::EventProcessor::~EventProcessor(), and HLTConfigProvider::HLTConfigCounterSentry::~HLTConfigCounterSentry().

template<typename KEY , typename T , typename E >
bool edm::detail::ThreadSafeRegistry< KEY, T, E >::notEmpty ( ) const
inline

Return true if there are any contained value_type objects.

Definition at line 149 of file ThreadSafeRegistry.h.

References relativeConstraints::empty.

149  {
150  return !empty();
151  }
bool empty() const
Return true if there are no contained value_type objects.
template<typename KEY, typename T, typename E = empty>
ThreadSafeRegistry<KEY,T,E>& edm::detail::ThreadSafeRegistry< KEY, T, E >::operator= ( ThreadSafeRegistry< KEY, T, E > const &  )
private
template<typename KEY , typename T , typename E >
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 176 of file ThreadSafeRegistry.h.

References begin, alignCSCRings::e, end, i, and findQualityFiles::size.

176  {
177  os << "Registry with " << size() << " entries\n";
178  for (const_iterator i=begin(), e=end(); i!=e; ++i) {
179  os << i->first << " " << i->second << '\n';
180  }
181  }
int i
Definition: DBlmapReader.cc:9
size_type size() const
Return the number of contained value_type objects.
collection_type::const_iterator const_iterator
template<typename KEY , typename T , typename E >
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 156 of file ThreadSafeRegistry.h.

156  {
157  return data_.size();
158  }

Member Data Documentation

template<typename KEY, typename T, typename E = empty>
collection_type edm::detail::ThreadSafeRegistry< KEY, T, E >::data_
private

Definition at line 111 of file ThreadSafeRegistry.h.

template<typename KEY, typename T, typename E = empty>
extra_type edm::detail::ThreadSafeRegistry< KEY, T, E >::extra_
private

Definition at line 112 of file ThreadSafeRegistry.h.