CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

ThreadMessage< T > Class Template Reference

#include <MutexUtils.h>

List of all members.

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.

{ 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.

                         {
    SimpleLockMutex gl(lock);
    it=i;
    doit.notify_all(); 
  }
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.

                                 {
    SimpleLockMutex gl(lock);
    doit.wait(gl());
    return it;
  }

Member Data Documentation

template<typename T >
boost::condition ThreadMessage< T >::doit [mutable, private]

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 [mutable, private]

Definition at line 137 of file MutexUtils.h.

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