eq::base::Monitor< T > Class Template Reference

A monitor primitive. More...

#include <monitor.h>

Inheritance diagram for eq::base::Monitor< T >:
Inheritance graph
[legend]
Collaboration diagram for eq::base::Monitor< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Monitor ()
 Constructs a new monitor with a default value of 0.
 Monitor (const T &value)
 Constructs a new monitor with a given default value.
EQ_PT_EXPORT ~Monitor ()
 Destructs the monitor.
Changing the monitored value.



EQ_PT_EXPORT Monitoroperator++ ()
 Increment the monitored value, prefix only.
EQ_PT_EXPORT Monitoroperator-- ()
 Decrement the monitored value, prefix only.
Monitoroperator= (const T &value)
 Assign a new value.
EQ_PT_EXPORT void set (const T &value)
 Set a new value.
Monitor the value.



EQ_PT_EXPORT const T & waitEQ (const T &value) const
 Block until the monitor has the given value.
EQ_PT_EXPORT const T & waitNE (const T &value) const
 Block until the monitor has not the given value.
EQ_PT_EXPORT const T & waitGE (const T &value) const
 Block until the monitor has a value greater or equal to the given value.
EQ_PT_EXPORT const T & waitLE (const T &value) const
 Block until the monitor has a value less or equal to the given value.
Comparison Operators. @version 1.0



bool operator== (const T &value) const
bool operator!= (const T &value) const
bool operator< (const T &value) const
bool operator> (const T &value) const
bool operator<= (const T &value) const
bool operator>= (const T &value) const
bool operator== (const Monitor< T > &rhs) const
bool operator!= (const Monitor< T > &rhs) const
bool operator< (const Monitor< T > &rhs) const
bool operator> (const Monitor< T > &rhs) const
bool operator<= (const Monitor< T > &rhs) const
bool operator>= (const Monitor< T > &rhs) const
Data Access.



const T & operator-> () const
const T & get () const
operator+ (const T &value) const

Detailed Description

template<typename T>
class eq::base::Monitor< T >

A monitor primitive.

A monitor has a value, which can be monitored to reach a certain state. The caller is blocked until the condition is fulfilled. The concept is similar to a pthread condition, with more usage convenience.

Template instantiations for uint32_t and bool are at the end of monitor.cpp. Monitors for other types can be created by including pthread.h before this file. pthread.h is not automatically included to avoid hard to resolve type conflicts with other header files on Windows.

Definition at line 58 of file monitor.h.


Constructor & Destructor Documentation

template<typename T>
eq::base::Monitor< T >::Monitor (  )  [inline]

Constructs a new monitor with a default value of 0.

Version:
1.0

Definition at line 62 of file monitor.h.

template<typename T>
eq::base::Monitor< T >::Monitor ( const T &  value  )  [inline]

Constructs a new monitor with a given default value.

Version:
1.0

Definition at line 65 of file monitor.h.

template<typename T>
EQ_PT_EXPORT eq::base::Monitor< T >::~Monitor (  ) 

Destructs the monitor.

Version:
1.0

Member Function Documentation

template<typename T>
EQ_PT_EXPORT Monitor& eq::base::Monitor< T >::operator++ (  ) 

Increment the monitored value, prefix only.

Version:
1.0
template<typename T>
EQ_PT_EXPORT Monitor& eq::base::Monitor< T >::operator-- (  ) 

Decrement the monitored value, prefix only.

Version:
1.0
template<typename T>
Monitor& eq::base::Monitor< T >::operator= ( const T &  value  )  [inline]

Assign a new value.

Version:
1.0

Definition at line 78 of file monitor.h.

template<typename T>
EQ_PT_EXPORT void eq::base::Monitor< T >::set ( const T &  value  ) 

Set a new value.

Version:
1.0
template<typename T>
EQ_PT_EXPORT const T& eq::base::Monitor< T >::waitEQ ( const T &  value  )  const

Block until the monitor has the given value.

Returns:
the value when reaching the condition.
Version:
1.0

Referenced by eq::net::Barrier::enter(), and eq::Pipe::waitExited().

Here is the caller graph for this function:

template<typename T>
EQ_PT_EXPORT const T& eq::base::Monitor< T >::waitNE ( const T &  value  )  const

Block until the monitor has not the given value.

Returns:
the value when reaching the condition.
Version:
1.0

Referenced by eq::base::Thread::join(), and eq::base::Thread::start().

Here is the caller graph for this function:

template<typename T>
EQ_PT_EXPORT const T& eq::base::Monitor< T >::waitGE ( const T &  value  )  const

Block until the monitor has a value greater or equal to the given value.

Returns:
the value when reaching the condition.
Version:
1.0

Referenced by eq::Compositor::assembleFramesUnsorted(), eq::Config::finishFrame(), eq::Pipe::waitFrameFinished(), eq::Pipe::waitFrameLocal(), eq::Node::waitFrameStarted(), eq::Node::waitInitialized(), and eq::FrameData::waitReady().

Here is the caller graph for this function:

template<typename T>
EQ_PT_EXPORT const T& eq::base::Monitor< T >::waitLE ( const T &  value  )  const

Block until the monitor has a value less or equal to the given value.

Returns:
the value when reaching the condition.
Version:
1.0
template<typename T>
const T& eq::base::Monitor< T >::operator-> (  )  const [inline]
Returns:
the current value.
Version:
1.0

Definition at line 147 of file monitor.h.

template<typename T>
const T& eq::base::Monitor< T >::get (  )  const [inline]
template<typename T>
T eq::base::Monitor< T >::operator+ ( const T &  value  )  const [inline]
Returns:
the current plus the given value.
Version:
1.0

Definition at line 153 of file monitor.h.


The documentation for this class was generated from the following file:
Generated on Sat Feb 6 13:08:09 2010 for Equalizer 0.9.1 by  doxygen 1.6.1