CMS 3D CMS Logo

MTmap< K, T > Class Template Reference

a thread-safe "map" More...

#include <Utilities/Threads/interface/MTmap.h>

List of all members.

Public Types

typedef SMAP::const_iterator const_iterator
typedef T data_type
typedef SMAP::iterator iterator
typedef SMAP::key_type key_type
typedef std::map< K, T,
std::less< K > > 
SMAP
typedef SMAP::value_type value_type

Public Member Functions

const SMAPbackdoor () const
SMAPbackdoor ()
const_iterator begin () const
iterator begin ()
void clear ()
bool empty () const
const_iterator end () const
iterator end ()
void erase (iterator pos)
const_iterator find (const K &k) const
iterator find (const K &k)
std::pair< iterator, boolinsert (const value_type &elem)
 MTmap ()
 constructor
LockMutex::Mutexmutex () const
T & operator[] (const K &k)
size_t size () const
 ~MTmap ()
 destructor

Protected Attributes

SMAP me
LockMutex::Mutex mutex_


Detailed Description

template<class K, class T>
class MTmap< K, T >

a thread-safe "map"

Definition at line 12 of file MTmap.h.


Member Typedef Documentation

template<class K, class T>
typedef SMAP::const_iterator MTmap< K, T >::const_iterator

Definition at line 16 of file MTmap.h.

template<class K, class T>
typedef T MTmap< K, T >::data_type

Definition at line 20 of file MTmap.h.

template<class K, class T>
typedef SMAP::iterator MTmap< K, T >::iterator

Definition at line 17 of file MTmap.h.

template<class K, class T>
typedef SMAP::key_type MTmap< K, T >::key_type

Definition at line 19 of file MTmap.h.

template<class K, class T>
typedef std::map< K, T, std::less<K> > MTmap< K, T >::SMAP

Definition at line 15 of file MTmap.h.

template<class K, class T>
typedef SMAP::value_type MTmap< K, T >::value_type

Definition at line 18 of file MTmap.h.


Constructor & Destructor Documentation

template<class K, class T>
MTmap< K, T >::MTmap (  )  [inline]

constructor

Definition at line 23 of file MTmap.h.

00023 {}

template<class K, class T>
MTmap< K, T >::~MTmap (  )  [inline]

destructor

Definition at line 27 of file MTmap.h.

00027 {}


Member Function Documentation

template<class K, class T>
const SMAP& MTmap< K, T >::backdoor (  )  const [inline]

Definition at line 74 of file MTmap.h.

References MTmap< K, T >::me.

00074 { return me;}

template<class K, class T>
SMAP& MTmap< K, T >::backdoor (  )  [inline]

Definition at line 73 of file MTmap.h.

References MTmap< K, T >::me.

00073 { return me;}

template<class K, class T>
const_iterator MTmap< K, T >::begin ( void   )  const [inline]

Definition at line 53 of file MTmap.h.

References MTmap< K, T >::me.

00053                                {
00054     return me.begin();
00055   }

template<class K, class T>
iterator MTmap< K, T >::begin ( void   )  [inline]

Definition at line 49 of file MTmap.h.

References MTmap< K, T >::me.

Referenced by ThreadObjects< T >::begin().

00049                    {
00050     return me.begin();
00051   }

template<class K, class T>
void MTmap< K, T >::clear ( void   )  [inline]

Definition at line 83 of file MTmap.h.

References a, MTmap< K, T >::me, and MTmap< K, T >::mutex_.

00083                {
00084     LockMutex a(mutex_);
00085     me.clear();
00086   }

template<class K, class T>
bool MTmap< K, T >::empty ( void   )  const [inline]

Definition at line 69 of file MTmap.h.

References MTmap< K, T >::me.

00069                      {
00070     return me.empty();
00071   }

template<class K, class T>
const_iterator MTmap< K, T >::end ( void   )  const [inline]

Definition at line 61 of file MTmap.h.

References MTmap< K, T >::me.

00061                              {
00062     return me.end();
00063   }

template<class K, class T>
iterator MTmap< K, T >::end ( void   )  [inline]

Definition at line 57 of file MTmap.h.

References MTmap< K, T >::me.

Referenced by ThreadObjects< T >::end().

00057                  {
00058     return me.end();
00059   }

template<class K, class T>
void MTmap< K, T >::erase ( iterator  pos  )  [inline]

Definition at line 78 of file MTmap.h.

References a, MTmap< K, T >::me, and MTmap< K, T >::mutex_.

Referenced by ThreadObjects< T >::erase().

00078                            {
00079     LockMutex a(mutex_);
00080     me.erase(pos);
00081   }

template<class K, class T>
const_iterator MTmap< K, T >::find ( const K &  k  )  const [inline]

Definition at line 34 of file MTmap.h.

References a, MTmap< K, T >::me, and MTmap< K, T >::mutex_.

00034                                         {
00035     LockMutex a(mutex_);
00036     return me.find(k);
00037   }

template<class K, class T>
iterator MTmap< K, T >::find ( const K &  k  )  [inline]

Definition at line 29 of file MTmap.h.

References a, MTmap< K, T >::me, and MTmap< K, T >::mutex_.

Referenced by ThreadObjects< T >::find().

00029                             {
00030     LockMutex a(mutex_);
00031     return me.find(k);
00032   }

template<class K, class T>
std::pair<iterator,bool> MTmap< K, T >::insert ( const value_type elem  )  [inline]

Definition at line 44 of file MTmap.h.

References a, MTmap< K, T >::me, and MTmap< K, T >::mutex_.

Referenced by ThreadObjects< T >::insert().

00044                                                          {
00045     LockMutex a(mutex_);
00046     return me.insert(elem);
00047   }

template<class K, class T>
LockMutex::Mutex& MTmap< K, T >::mutex (  )  const [inline]

Definition at line 76 of file MTmap.h.

References MTmap< K, T >::mutex_.

00076 { return mutex_;}

template<class K, class T>
T& MTmap< K, T >::operator[] ( const K &  k  )  [inline]

Definition at line 39 of file MTmap.h.

References a, MTmap< K, T >::me, and MTmap< K, T >::mutex_.

00039                              {
00040     LockMutex a(mutex_);
00041     return me[k];
00042   }

template<class K, class T>
size_t MTmap< K, T >::size ( void   )  const [inline]

Definition at line 65 of file MTmap.h.

References MTmap< K, T >::me.

00065                       {
00066     return me.size();
00067   }


Member Data Documentation

template<class K, class T>
SMAP MTmap< K, T >::me [protected]

Definition at line 90 of file MTmap.h.

Referenced by MTmap< K, T >::backdoor(), MTmap< K, T >::begin(), MTmap< K, T >::clear(), MTmap< K, T >::empty(), MTmap< K, T >::end(), MTmap< K, T >::erase(), MTmap< K, T >::find(), MTmap< K, T >::insert(), MTmap< K, T >::operator[](), and MTmap< K, T >::size().

template<class K, class T>
LockMutex::Mutex MTmap< K, T >::mutex_ [mutable, protected]

Definition at line 92 of file MTmap.h.

Referenced by MTmap< K, T >::clear(), MTmap< K, T >::erase(), MTmap< K, T >::find(), MTmap< K, T >::insert(), MTmap< K, T >::mutex(), and MTmap< K, T >::operator[]().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:28:25 2009 for CMSSW by  doxygen 1.5.4