xvr2::ConditionVar Class Reference

#include <ConditionVar.h>

Inheritance diagram for xvr2::ConditionVar:

Inheritance graph
[legend]

List of all members.


Detailed Description

Condition variables is another type of synchronization device unlike the Mutex how locks and unlocks a thread, this devide does somethings a bit different, this one waits for a condition to be reached, if the condition in fact has been accomplished it will lock and unlock a thread or a set of threads that might be waiting for a conditiond to be reached on that specific ConditionVar object.

Definition at line 34 of file ConditionVar.h.


Public Types

enum  SchedPolicy { NORMAL, ROUND_ROBIN, FIFO }
 Please use this set of constants to define or stablish a thread execution policy. More...

Public Member Functions

 ConditionVar ()
 ~ConditionVar ()
void signal ()
 This will restart just one of the threads that are waiting for the condition to be reached.
void broadcast ()
 This will restart all the threads that are waiting for the condition to be reached.
void wait (Mutex *mutex)
 This will unlock the Mutex mutex and will wait for this condition variable to be signaled.
void timedWait (Mutex *mutex, long seconds=1, long nanoseconds=0)
 This will unlock the Mutex mutex and will wait for this condition variable to be signaled.
virtual const char * getClassName ()
 Returns the name of the current class.
virtual std::string toString ()

Static Public Member Functions

static void wait (ConditionVar *cv, Mutex *mutex)
 This is the static version of the wait method.
static void timedWait (ConditionVar *cv, Mutex *mutex, long seconds=1, long nanoseconds=0)
 This is the static version of the timedWait method.
static void debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)
 Will print a debug message to the screen.
static void debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)

Protected Member Functions

void init ()
void destroy ()

Protected Attributes

std::string __cls_name

Friends

std::ostream & operator<< (std::ostream &stream, const Object &s)

Member Enumeration Documentation

enum xvr2::Threading::SchedPolicy [inherited]

Please use this set of constants to define or stablish a thread execution policy.

Enumerator:
NORMAL  Default scheduling policy, non-realtime.
ROUND_ROBIN  Round Robin based realtime scheduling policy.
FIFO  First In First Out based realtime scheduling policy.

Definition at line 30 of file Threading.h.


Constructor & Destructor Documentation

xvr2::ConditionVar::ConditionVar (  ) 

xvr2::ConditionVar::~ConditionVar (  ) 


Member Function Documentation

void xvr2::ConditionVar::init (  )  [protected]

void xvr2::ConditionVar::destroy (  )  [protected]

void xvr2::ConditionVar::signal (  ) 

This will restart just one of the threads that are waiting for the condition to be reached.

void xvr2::ConditionVar::broadcast (  ) 

This will restart all the threads that are waiting for the condition to be reached.

void xvr2::ConditionVar::wait ( Mutex mutex  ) 

This will unlock the Mutex mutex and will wait for this condition variable to be signaled.

void xvr2::ConditionVar::timedWait ( Mutex mutex,
long  seconds = 1,
long  nanoseconds = 0 
)

This will unlock the Mutex mutex and will wait for this condition variable to be signaled.

static void xvr2::ConditionVar::wait ( ConditionVar cv,
Mutex mutex 
) [static]

This is the static version of the wait method.

static void xvr2::ConditionVar::timedWait ( ConditionVar cv,
Mutex mutex,
long  seconds = 1,
long  nanoseconds = 0 
) [static]

This is the static version of the timedWait method.

virtual const char* xvr2::Object::getClassName (  )  [virtual, inherited]

Returns the name of the current class.

static void xvr2::Object::debugmsg ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

Will print a debug message to the screen.

static void xvr2::Object::debugmsgln ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

virtual std::string xvr2::Object::toString (  )  [virtual, inherited]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Object s 
) [friend, inherited]


Member Data Documentation

std::string xvr2::Object::__cls_name [protected, inherited]

Definition at line 30 of file Object.h.


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

Generated on Fri Jun 20 22:55:50 2008 for X-VR2 SDK by  doxygen 1.5.5