corelinux::EventSemaphore Class Reference

EventSemaphore implements a way to queue its caller until a certain event takes place. More...

#include <EventSemaphore.hpp>

Inheritance diagram for corelinux::EventSemaphore:

corelinux::Semaphore corelinux::AbstractSemaphore corelinux::Synchronized List of all members.

Public Member Functions

 EventSemaphore (SemaphoreGroupPtr aGroup, SemaphoreIdentifierRef aIdentifier, Counter aLimit, bool aRecursionFlag=true, bool aBalkingFlag=false) throw ( NullPointerException )
 Default constructor requires the identifier of the semaphore in the semaphore group.
virtual ~EventSemaphore (void)
 Virtual Destructor.
virtual bool isLocked (void)
 Check if semaphore instance is locked.
SemaphoreOperationStatus post (void) throw ( SemaphoreException )
 Indicate owner commitment to trigger the event after a finite amount of time.
virtual SemaphoreOperationStatus lockWithWait (void) throw ( SemaphoreException )
 Wait for the event associated with this semaphore to take place.
virtual SemaphoreOperationStatus lockWithNoWait (void) throw ( SemaphoreException )
 Check if the associated event has taken place.
virtual SemaphoreOperationStatus release (void) throw ( SemaphoreException )
 Signal the observer that an event has occured.
virtual void setLimit (Counter aLimit) throw ( SemaphoreException )
 Set the maximum number of listeners allowed on this semaphore.
virtual Counter getLimit (void) const
 Get the maximum number of listeners of this semaphore.

Protected Member Functions

 EventSemaphore (void) throw ( Assertion )
 Default constructor throws assert.
 EventSemaphore (EventSemaphoreCref) throw ( Assertion )
 Copy constructor throws assertion.
EventSemaphoreRef operator= (EventSemaphoreCref) throw ( Assertion )
 Assignment operator throws assertion.

Detailed Description

EventSemaphore implements a way to queue its caller until a certain event takes place.


Constructor & Destructor Documentation

corelinux::EventSemaphore::EventSemaphore ( SemaphoreGroupPtr  aGroup,
SemaphoreIdentifierRef  aIdentifier,
Counter  aLimit,
bool  aRecursionFlag = true,
bool  aBalkingFlag = false 
) throw ( NullPointerException )

Default constructor requires the identifier of the semaphore in the semaphore group.

Parameters:
aGroup pointer to the owning SemaphoreGroup
aIdentifier The identifier for the Semaphore from the SemaphoreGroup
aLimit the maximum number of listeners.
  • aLimit < 0 : infinite number of listeners,
  • aLimit >= 0 : finite number of listeners
Recursive true if recursion enabled
Balking true if balking enabled


Member Function Documentation

SemaphoreOperationStatus corelinux::EventSemaphore::lockWithWait ( void   )  throw ( SemaphoreException ) [virtual]

Wait for the event associated with this semaphore to take place.

Block if the event has not occured

Implements corelinux::AbstractSemaphore.

void corelinux::EventSemaphore::setLimit ( Counter  aLimit  )  throw ( SemaphoreException ) [virtual]

Set the maximum number of listeners allowed on this semaphore.

Parameters:
aLimit the maximum number of listeners.
  • aLimit < 0: infinite number of listeners,
  • aLimit >= 0: finite number of listeners,


The documentation for this class was generated from the following files:
This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium