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 | Private Attributes
ThreadMessage< T > Class Template Reference

#include <MutexUtils.h>

Public Types

typedef T Case
 

Public Member Functions

const Caseget () const
 
void go (const Case &i)
 
const Caseoperator() () const
 

Private Attributes

boost::condition doit
 
Case it
 
SimpleLockMutex::Mutex lock
 

Detailed Description

template<typename T>
class ThreadMessage< T >

Definition at line 117 of file MutexUtils.h.

Member Typedef Documentation

template<typename T >
typedef T ThreadMessage< T >::Case

Definition at line 119 of file MutexUtils.h.

Member Function Documentation

template<typename T >
const Case& ThreadMessage< T >::get ( void  ) const
inline

Definition at line 133 of file MutexUtils.h.

References ThreadMessage< T >::it.

Referenced by Options.Options::__getitem__().

133 { return it;}
template<typename T >
void ThreadMessage< T >::go ( const Case i)
inline

Definition at line 127 of file MutexUtils.h.

References ThreadMessage< T >::doit, i, ThreadMessage< T >::it, and ThreadMessage< T >::lock.

127  {
128  SimpleLockMutex gl(lock);
129  it=i;
130  doit.notify_all();
131  }
int i
Definition: DBlmapReader.cc:9
SimpleLockMutex::Mutex lock
Definition: MutexUtils.h:137
boost::condition doit
Definition: MutexUtils.h:138
template<typename T >
const Case& ThreadMessage< T >::operator() ( ) const
inline

Definition at line 121 of file MutexUtils.h.

References ThreadMessage< T >::doit, ThreadMessage< T >::it, and ThreadMessage< T >::lock.

121  {
122  SimpleLockMutex gl(lock);
123  doit.wait(gl());
124  return it;
125  }
SimpleLockMutex::Mutex lock
Definition: MutexUtils.h:137
boost::condition doit
Definition: MutexUtils.h:138

Member Data Documentation

template<typename T >
boost::condition ThreadMessage< T >::doit
mutableprivate

Definition at line 138 of file MutexUtils.h.

Referenced by ThreadMessage< T >::go(), and ThreadMessage< T >::operator()().

template<typename T >
Case ThreadMessage< T >::it
private
template<typename T >
SimpleLockMutex::Mutex ThreadMessage< T >::lock
mutableprivate

Definition at line 137 of file MutexUtils.h.

Referenced by ThreadMessage< T >::go(), and ThreadMessage< T >::operator()().