CMS 3D CMS Logo

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>

List of all members.

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.
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_typeextra ()
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 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.

                                                    : 
      data_()
    { }
template<typename KEY , typename T , typename E >
edm::detail::ThreadSafeRegistry< KEY, T, E >::~ThreadSafeRegistry ( ) [private]

Definition at line 218 of file ThreadSafeRegistry.h.

    { }
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(), and DQMRootOutputModule::startEndFile().

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

Provide access to the contained collection.

Definition at line 186 of file ThreadSafeRegistry.h.

                                      {
      return data_;
    }
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.

                                            {
      return data_;
    }
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.

                                             {
      return data_.empty();
    }
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 const & edm::detail::ThreadSafeRegistry< KEY, T, E >::extra ( ) const [inline]

Definition at line 200 of file ThreadSafeRegistry.h.

                                             {
      return extra_;
    }
template<typename KEY , typename T , typename E >
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 193 of file ThreadSafeRegistry.h.

Referenced by edm::pset::getProcessParameterSetID().

                                       {
      return extra_;
    }
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 ( vector_type const &  c)

Definition at line 133 of file ThreadSafeRegistry.h.

                                                                      {
      for (typename vector_type::const_iterator it = c.begin(), itEnd = c.end(); it != itEnd; ++it) {
        insertMapped(*it);
      }
    }
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.

                                                                          {
      for (typename collection_type::const_iterator it = c.begin(), itEnd = c.end(); it != itEnd; ++it) {
        insertMapped(it->second);
      }
    }
template<typename KEY, typename T, typename E = empty>
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.

Referenced by edm::StreamerInputSource::deserializeAndMergeWithRegistry(), fwlite::Event::fillParameterSetRegistry(), HLTConfigProvider::getDataFrom(), edm::RootFile::RootFile(), DQMRootSource::setupFile(), TFWLiteSelectorBasic::setupNewFile(), ProvenanceDumper::work_(), and edm::RootOutputFile::writeParentageRegistry().

template<typename KEY, typename T, typename E = empty>
static ThreadSafeRegistry* edm::detail::ThreadSafeRegistry< KEY, T, E >::instance ( ) [static]
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.

                                                {
      return !empty();
    }
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.

                                                           {
      os << "Registry with " << size() << " entries\n";
      for (const_iterator i=begin(), e=end(); i!=e; ++i) {
          os << i->first << " " << i->second << '\n';
      }
    }
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.

                                            {
      return data_.size();
    }

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.