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::ThreadSafeIndexedRegistry< T, E > Class Template Reference

#include <ThreadSafeIndexedRegistry.h>

Public Types

typedef std::vector< value_typecollection_type
 
typedef
collection_type::const_iterator 
const_iterator
 
typedef E extra_type
 
typedef collection_type::size_type size_type
 
typedef T value_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
 
void getMapped (size_type index, value_type &result) const
 
void insertCollection (collection_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 ThreadSafeIndexedRegistryinstance ()
 

Private Member Functions

ThreadSafeIndexedRegistry< T, E > & operator= (ThreadSafeIndexedRegistry< T, E > const &)
 
 ThreadSafeIndexedRegistry ()
 
 ThreadSafeIndexedRegistry (ThreadSafeIndexedRegistry< T, E > const &)
 
 ~ThreadSafeIndexedRegistry ()
 

Private Attributes

collection_type data_
 
extra_type extra_
 

Detailed Description

template<typename T, typename E = Empty>
class edm::detail::ThreadSafeIndexedRegistry< T, E >

Definition at line 24 of file ThreadSafeIndexedRegistry.h.

Member Typedef Documentation

template<typename T, typename E = Empty>
typedef std::vector<value_type> edm::detail::ThreadSafeIndexedRegistry< T, E >::collection_type

Definition at line 28 of file ThreadSafeIndexedRegistry.h.

template<typename T, typename E = Empty>
typedef collection_type::const_iterator edm::detail::ThreadSafeIndexedRegistry< T, E >::const_iterator

Definition at line 31 of file ThreadSafeIndexedRegistry.h.

template<typename T, typename E = Empty>
typedef E edm::detail::ThreadSafeIndexedRegistry< T, E >::extra_type

Definition at line 27 of file ThreadSafeIndexedRegistry.h.

template<typename T, typename E = Empty>
typedef collection_type::size_type edm::detail::ThreadSafeIndexedRegistry< T, E >::size_type

Definition at line 29 of file ThreadSafeIndexedRegistry.h.

template<typename T, typename E = Empty>
typedef T edm::detail::ThreadSafeIndexedRegistry< T, E >::value_type

Definition at line 26 of file ThreadSafeIndexedRegistry.h.

Constructor & Destructor Documentation

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

Definition at line 181 of file ThreadSafeIndexedRegistry.h.

181  :
182  data_()
183  { }
template<typename T , typename E >
edm::detail::ThreadSafeIndexedRegistry< T, E >::~ThreadSafeIndexedRegistry ( )
private

Definition at line 187 of file ThreadSafeIndexedRegistry.h.

188  { }
template<typename T, typename E = Empty>
edm::detail::ThreadSafeIndexedRegistry< T, E >::ThreadSafeIndexedRegistry ( ThreadSafeIndexedRegistry< T, E > const &  )
private

Member Function Documentation

template<typename T , typename E >
ThreadSafeIndexedRegistry< T, E >::const_iterator edm::detail::ThreadSafeIndexedRegistry< 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 132 of file ThreadSafeIndexedRegistry.h.

132  {
133  return data_.begin();
134  }
template<typename T , typename E >
ThreadSafeIndexedRegistry< T, E >::collection_type & edm::detail::ThreadSafeIndexedRegistry< T, E >::data ( )
inline
template<typename T , typename E >
ThreadSafeIndexedRegistry< T, E >::collection_type const & edm::detail::ThreadSafeIndexedRegistry< T, E >::data ( ) const
inline

Definition at line 176 of file ThreadSafeIndexedRegistry.h.

176  {
177  return data_;
178  }
template<typename T , typename E >
bool edm::detail::ThreadSafeIndexedRegistry< T, E >::empty ( void  ) const
inline

Return true if there are no contained value_type objects.

Definition at line 111 of file ThreadSafeIndexedRegistry.h.

111  {
112  return data_.empty();
113  }
template<typename T , typename E >
ThreadSafeIndexedRegistry< T, E >::const_iterator edm::detail::ThreadSafeIndexedRegistry< T, E >::end ( void  ) const
inline

Definition at line 139 of file ThreadSafeIndexedRegistry.h.

139  {
140  return data_.end();
141  }
template<typename T , typename E >
ThreadSafeIndexedRegistry< T, E >::extra_type & edm::detail::ThreadSafeIndexedRegistry< T, E >::extra ( )
inline

Provide access to the appendage "extra". The ThreadSafeIndexedRegistry doesn't know what this is for, but instantiations of the template can use it.

Definition at line 162 of file ThreadSafeIndexedRegistry.h.

Referenced by edm::EventPrincipal::branchIDToProductID(), edm::BranchIDListHelper::clearRegistries(), edm::BranchIDListHelper::fixBranchListIndexes(), edm::BranchIDListHelper::updateFromInput(), and edm::BranchIDListHelper::updateRegistries().

162  {
163  return extra_;
164  }
template<typename T , typename E >
ThreadSafeIndexedRegistry< T, E >::extra_type const & edm::detail::ThreadSafeIndexedRegistry< T, E >::extra ( ) const
inline

Definition at line 169 of file ThreadSafeIndexedRegistry.h.

169  {
170  return extra_;
171  }
template<typename T, typename E = Empty>
void edm::detail::ThreadSafeIndexedRegistry< T, E >::getMapped ( size_type  index,
value_type result 
) const

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

template<typename T , typename E >
void edm::detail::ThreadSafeIndexedRegistry< T, E >::insertCollection ( collection_type const &  c)

put the value_type objects in the given collection into the registry.

Definition at line 102 of file ThreadSafeIndexedRegistry.h.

102  {
103  for (typename collection_type::const_iterator it = c.begin(), itEnd = c.end(); it != itEnd; ++it) {
104  insertMapped(*it);
105  }
106  }
bool insertMapped(value_type const &v)
template<typename T, typename E = Empty>
bool edm::detail::ThreadSafeIndexedRegistry< T, E >::insertMapped ( value_type const &  v)

put the given value_type object into the registry.

Referenced by edm::BranchIDListHelper::updateFromInput(), and edm::BranchIDListHelper::updateRegistries().

template<typename T, typename E = Empty>
static ThreadSafeIndexedRegistry* edm::detail::ThreadSafeIndexedRegistry< T, E >::instance ( )
static
template<typename T , typename E >
bool edm::detail::ThreadSafeIndexedRegistry< T, E >::notEmpty ( ) const
inline

Return true if there are any contained value_type objects.

Definition at line 118 of file ThreadSafeIndexedRegistry.h.

References relativeConstraints::empty.

118  {
119  return !empty();
120  }
bool empty() const
Return true if there are no contained value_type objects.
template<typename T, typename E = Empty>
ThreadSafeIndexedRegistry<T, E>& edm::detail::ThreadSafeIndexedRegistry< T, E >::operator= ( ThreadSafeIndexedRegistry< T, E > const &  )
private
template<typename T , typename E >
void edm::detail::ThreadSafeIndexedRegistry< T, E >::print ( std::ostream &  os) const

Print the contents of this registry to the given ostream.

Definition at line 145 of file ThreadSafeIndexedRegistry.h.

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

145  {
146  os << "Registry with " << size() << " entries\n";
147  for (const_iterator i = begin(), e = end(); i != e; ++i) {
148  os << i - begin() << " " << i << '\n';
149  }
150  }
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 T , typename E >
ThreadSafeIndexedRegistry< T, E >::size_type edm::detail::ThreadSafeIndexedRegistry< T, E >::size ( void  ) const
inline

Return the number of contained value_type objects.

Definition at line 125 of file ThreadSafeIndexedRegistry.h.

125  {
126  return data_.size();
127  }

Member Data Documentation

template<typename T, typename E = Empty>
collection_type edm::detail::ThreadSafeIndexedRegistry< T, E >::data_
private

Definition at line 87 of file ThreadSafeIndexedRegistry.h.

template<typename T, typename E = Empty>
extra_type edm::detail::ThreadSafeIndexedRegistry< T, E >::extra_
private

Definition at line 88 of file ThreadSafeIndexedRegistry.h.