Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
CondVar< T > Class Template Reference

Condition variable. More...

#include <CondVar.h>

Inheritance diagram for CondVar< T >:
Collaboration diagram for CondVar< T >:

Public Member Functions

 CondVar (Mutex *mutex, const T &value)
 Initialize using value.
 CondVar (const CondVar &)
 Initialize using another condition variable's value.
 ~CondVar ()
manipulators
CondVaroperator= (const CondVar &cv)
 Assigns the value of cv to this.
CondVaroperator= (const T &v)
 Assigns value to this.
Public Member Functions inherited from CondVarBase
 CondVarBase (Mutex *mutex)
 ~CondVarBase ()
void lock () const
 Lock the condition variable's mutex.
void unlock () const
 Unlock the condition variable's mutex.
void signal ()
 Signal the condition variable.
void broadcast ()
 Signal the condition variable.
bool wait (double timeout=-1.0) const
 Wait on the condition variable.
bool wait (Stopwatch &timer, double timeout) const
 Wait on the condition variable.
MutexgetMutex () const
 Get the mutex.

accessors

 operator const volatile T & () const
 Get the variable's value.

Detailed Description

template<class T>
class CondVar< T >

Condition variable.

A condition variable with storage for type T.

Constructor & Destructor Documentation

◆ CondVar() [1/2]

template<class T>
CondVar< T >::CondVar ( Mutex * mutex,
const T & value )
inline

Initialize using value.

◆ CondVar() [2/2]

template<class T>
CondVar< T >::CondVar ( const CondVar< T > & cv)
inline

Initialize using another condition variable's value.

◆ ~CondVar()

template<class T>
CondVar< T >::~CondVar ( )
inlinedefault

Member Function Documentation

◆ operator const volatile T &()

template<class T>
CondVar< T >::operator const volatile T & ( ) const
inline

Get the variable's value.

Get the variable's value. The condition variable should be locked before calling this method.

◆ operator=() [1/2]

template<class T>
CondVar< T > & CondVar< T >::operator= ( const CondVar< T > & cv)
inline

Assigns the value of cv to this.

Set the variable's value. The condition variable should be locked before calling this method.

◆ operator=() [2/2]

template<class T>
CondVar< T > & CondVar< T >::operator= ( const T & v)
inline

Assigns value to this.

Set the variable's value. The condition variable should be locked before calling this method.


The documentation for this class was generated from the following file: