Home C-Bits Package Documentation Project Page

Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

cbits::SignalObject Class Reference

Used by an event producer to notify event consumers of the occurrence of a significant event. More...

#include <SignalObject.h>

Inheritance diagram for cbits::SignalObject:

[legend]
List of all members.

Public Methods

const bool wait (const long msec=0)
 Wait for a signal. More...

const bool notify ()
 Send signal to a object waiting for a signal. More...

const bool notifyAll ()
 Send signal to all objects waiting for a signal. More...

virtual ~SignalObject ()
 Destructor. More...


Static Public Methods

SignalObject * create ()
 Create a new SignalObject. More...


Protected Methods

 SignalObject ()
virtual const bool impl_wait (const long msec=0)=0
virtual const bool impl_notify ()=0
virtual const bool impl_notify_all ()=0

Private Methods

 SignalObject (const SignalObject &)
SignalObject & operator= (const SignalObject &)

Detailed Description

Used by an event producer to notify event consumers of the occurrence of a significant event.

The event producer(s) and the event consumers must all have a reference to the same SignalObject instance.

The event consumers 'wait' for the event (see SignalObject::wait) while the event producer sends notice when the event occurs (see SignalObject::notify and SignalObject::notifyAll).

Implementation Note:

A SignalObject derived class must be implemented for each new platform. The protected, pure virtual impl_XXX methods (see below) must be implemented in the derived class.


Constructor & Destructor Documentation

SignalObject::~SignalObject   [virtual]
 

Destructor.

SignalObject::SignalObject   [protected]
 

cbits::SignalObject::SignalObject const SignalObject &    [private]
 


Member Function Documentation

SignalObject * SignalObject::create   [static]
 

Create a new SignalObject.

Returns:
new SignalObject instance.

virtual const bool cbits::SignalObject::impl_notify   [protected, pure virtual]
 

Implemented in cbits::SignalObject_PTHREAD.

virtual const bool cbits::SignalObject::impl_notify_all   [protected, pure virtual]
 

Implemented in cbits::SignalObject_PTHREAD.

virtual const bool cbits::SignalObject::impl_wait const long    msec = 0 [protected, pure virtual]
 

Implemented in cbits::SignalObject_PTHREAD.

const bool SignalObject::notify  
 

Send signal to a object waiting for a signal.

Returns:
true if signal was sent; false otherwise.

const bool SignalObject::notifyAll  
 

Send signal to all objects waiting for a signal.

Returns:
true if signal was sent; false otherwise.

SignalObject& cbits::SignalObject::operator= const SignalObject &    [private]
 

const bool SignalObject::wait const long    msec = 0
 

Wait for a signal.

Returns:
true if signal was received; false, otherwise.
Parameters:
msec  Maximum number of milliseconds to wait. A value of msec less than or equal to zero is interpreted as 'wait forever'.


The documentation for this class was generated from the following files:
Generated by
doxygen
Hosted by
SourceForge