libglass::Barrier Class Reference

#include <barrier.h>

Inheritance diagram for libglass::Barrier:

libglass::PluginInterface

List of all members.

Classes

struct  _syncdata

Public Member Functions

 Barrier (unsigned int num, unsigned int group=0, bool active=false) throw (Exception)
 ~Barrier ()
unsigned int getNumber (void) const
unsigned int getGroup (void) const
bool sync (void)
bool disable (void)
bool enable (void)

Friends

class BarrierBase


Detailed Description

Barrier class.

Definition at line 258 of file barrier.h.


Constructor & Destructor Documentation

libglass::Barrier::Barrier ( unsigned int  num,
unsigned int  group = 0,
bool  active = false 
) throw (Exception)

Provides a barrier.

Parameters:
num The barrier number.
group The barrier group.
active Should the barrier be considered active before its first synchronization?

libglass::Barrier::~Barrier (  ) 

Destructor.


Member Function Documentation

bool libglass::Barrier::disable ( void   ) 

Disables this barrier temporarily. Useful if this node should skip a few barriers, without locking everybody else.

Return values:
true 
false 
See also:
sync(), enable().

bool libglass::Barrier::enable ( void   ) 

Enables this barrier temporarily. Useful if this node should skip a few barriers, without locking everybody else.

Return values:
true 
false 
See also:
sync(), disable().

unsigned int libglass::Barrier::getGroup ( void   )  const [inline]

Returns the number of this barrier.

Returns:
The number of this barrier.

Definition at line 310 of file barrier.h.

unsigned int libglass::Barrier::getNumber ( void   )  const [inline]

Returns the number of this barrier.

Returns:
The number of this barrier.

Definition at line 304 of file barrier.h.

bool libglass::Barrier::sync ( void   ) 

Synchronization method.

Blocks until all nodes that own this barrier synchronize. This function is reentrant and can be used by several threads as a synchronization point.

Return values:
true If the synchronization was successful.
false Not successfull. The node probably did not synchronize.
See also:
disable(), enable().


Friends And Related Function Documentation

friend class BarrierBase [friend]

Definition at line 282 of file barrier.h.


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

Generated on Fri May 28 13:19:01 2010 for libGlass by  doxygen 1.5.8