1 #ifndef FWCore_Utilities_ThreadSafeRegistry_h
2 #define FWCore_Utilities_ThreadSafeRegistry_h
6 #include "boost/thread.hpp"
28 #pragma GCC visibility push(default)
33 template <
typename KEY,
typename T,
typename E=empty>
89 void print(std::ostream& os)
const;
115 template <
typename KEY,
typename T,
typename E>
118 operator<< (std::ostream& os, ThreadSafeRegistry<KEY,T,E>
const& reg) {
123 template <
typename KEY,
typename T,
typename E>
126 for (
typename collection_type::const_iterator it = c.begin(), itEnd = c.end(); it != itEnd; ++it) {
127 insertMapped(it->second);
131 template <
typename KEY,
typename T,
typename E>
134 for (
typename vector_type::const_iterator it = c.begin(), itEnd = c.end(); it != itEnd; ++it) {
139 template <
typename KEY,
typename T,
typename E>
143 return data_.empty();
146 template <
typename KEY,
typename T,
typename E>
153 template <
typename KEY,
typename T,
typename E>
160 template <
typename KEY,
typename T,
typename E>
164 return data_.begin();
167 template <
typename KEY,
typename T,
typename E>
174 template <
typename KEY,
typename T,
typename E>
177 os <<
"Registry with " <<
size() <<
" entries\n";
179 os <<
i->first <<
" " <<
i->second <<
'\n';
183 template <
typename KEY,
typename T,
typename E>
190 template <
typename KEY,
typename T,
typename E>
197 template <
typename KEY,
typename T,
typename E>
204 template <
typename KEY,
typename T,
typename E>
211 template <
typename KEY,
typename T,
typename E>
217 template <
typename KEY,
typename T,
typename E>
223 #pragma GCC visibility pop
224 #endif // FWCore_Utilities_ThreadSafeRegistry_h
static ThreadSafeRegistry * instance()
bool empty() const
Return true if there are no contained value_type objects.
bool getMapped(key_type const &k, value_type &result) const
size_type size() const
Return the number of contained value_type objects.
bool insertMapped(value_type const &v)
void print(std::ostream &os) const
Print the contents of this registry to the given ostream.
std::map< key_type, value_type > collection_type
const_iterator begin() const
collection_type::const_iterator const_iterator
void insertCollection(collection_type const &c)
ThreadSafeRegistry< KEY, T, E > & operator=(ThreadSafeRegistry< KEY, T, E > const &)
std::vector< value_type > vector_type
const_iterator end() const
collection_type & data()
Provide access to the contained collection.
tuple size
Write out results.
collection_type::size_type size_type
bool notEmpty() const
Return true if there are any contained value_type objects.