Project: engagement_recognition

License: BSD

Dependencies:

Used by: None

All Packages

Semaphore Class Reference

#include <semaphore.h>

Inheritance diagram for Semaphore:

List of all members.

Public Member Functions

int getValue ()
void post ()
 Semaphore (int value)
bool timedWait (double time)
bool tryWait ()
void wait ()

Private Attributes

sem_t semaphore_
int value_

Detailed Description

The Semaphore class extends the semaphore object in order to make using a semaphore easier.

Author:
Brett Ponsler (bponsler (at) wpi (dot) edu)

Definition at line 47 of file semaphore.h.


Constructor & Destructor Documentation

Semaphore::Semaphore ( int  value  ) 

Constructor for the Semaphore class with a starting value.

Parameters:
value The value

Definition at line 41 of file semaphore.cpp.


Member Function Documentation

int Semaphore::getValue (  ) 

Return the value of the Semaphore.

Returns:
The value

Definition at line 118 of file semaphore.cpp.

void Semaphore::post (  ) 

Post the Semaphore.

Definition at line 59 of file semaphore.cpp.

bool Semaphore::timedWait ( double  time  ) 

Wait on the semaphore for a specified amount of time.

Parameters:
time The time to wait (in seconds)
Returns:
False if the duration passed, true if posted

Definition at line 80 of file semaphore.cpp.

bool Semaphore::tryWait (  ) 

Try to wait on the semaphore.

Returns:
Success of waiting

Definition at line 71 of file semaphore.cpp.

void Semaphore::wait (  ) 

Post the Semaphore.

Definition at line 65 of file semaphore.cpp.


Member Data Documentation

sem_t Semaphore::semaphore_ [private]

The actual posix semaphore for this class.

Definition at line 51 of file semaphore.h.

int Semaphore::value_ [private]

Keep track of the semaphore value.

Definition at line 54 of file semaphore.h.


The documentation for this class was generated from the following files:
  • engagement_recognition/src/recognition/semaphores/semaphore.h
  • engagement_recognition/src/recognition/semaphores/semaphore.cpp

engagement_recognition
Author(s): Brett Ponsler (bponsler (at) wpi (dot) edu)
autogenerated on Fri Sep 9 10:35:49 2011