Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

clSemaphore Class Reference

Class implementation of POSIX counting semaphores. More...

#include <Semaphore.hh>

List of all members.

Public Member Functions

 clSemaphore ()
 Constructor; create and initialize the semaphore.

 clSemaphore (unsigned int uiSemValue)
 Constructor; create and initialize the semaphore.

 ~clSemaphore ()
 Destructor; destroy the semaphore.

bool Initialize (unsigned int uiSemValue)
 Initialize the semaphore to specified value.

void Wait ()
 Wait until semaphore count becomes non-zero and then decrement the count.

bool TryWait ()
 Test if semaphore count is non-zero, if it is, then count is decremented.

bool Post ()
 Post (increment) semaphore.

int GetValue ()
 Get value of semaphore.


Private Attributes

sem_t semSemaphore


Detailed Description

Class implementation of POSIX counting semaphores.

Definition at line 37 of file Semaphore.hh.


Constructor & Destructor Documentation

clSemaphore::clSemaphore  )  [inline]
 

Constructor; create and initialize the semaphore.

Semaphore value is initialized to zero.

Definition at line 49 of file Semaphore.hh.

References semSemaphore.

clSemaphore::clSemaphore unsigned int  uiSemValue  )  [inline]
 

Constructor; create and initialize the semaphore.

Semaphore is initialized to caller specified value.

Parameters:
uiSemValue Initial semaphore value

Definition at line 61 of file Semaphore.hh.

References semSemaphore.

clSemaphore::~clSemaphore  )  [inline]
 

Destructor; destroy the semaphore.

Definition at line 70 of file Semaphore.hh.

References semSemaphore.


Member Function Documentation

bool clSemaphore::Initialize unsigned int  uiSemValue  )  [inline]
 

Initialize the semaphore to specified value.

This can be used to explicitly set the semaphore value.

Parameters:
uiSemValue New value of semaphore
Returns:
Success

Definition at line 83 of file Semaphore.hh.

References semSemaphore.

void clSemaphore::Wait  )  [inline]
 

Wait until semaphore count becomes non-zero and then decrement the count.

Definition at line 100 of file Semaphore.hh.

References semSemaphore.

bool clSemaphore::TryWait  )  [inline]
 

Test if semaphore count is non-zero, if it is, then count is decremented.

Definition at line 113 of file Semaphore.hh.

References semSemaphore.

bool clSemaphore::Post  )  [inline]
 

Post (increment) semaphore.

Returns:
Success

Definition at line 131 of file Semaphore.hh.

References semSemaphore.

int clSemaphore::GetValue  )  [inline]
 

Get value of semaphore.

Returns:
Semaphore count

Definition at line 148 of file Semaphore.hh.

References semSemaphore.


Member Data Documentation

sem_t clSemaphore::semSemaphore [private]
 

Definition at line 40 of file Semaphore.hh.

Referenced by clSemaphore(), GetValue(), Initialize(), Post(), TryWait(), Wait(), and ~clSemaphore().


The documentation for this class was generated from the following file:
Generated on Tue Mar 2 19:47:14 2004 for libDSP by doxygen 1.3.6