Ocean
Ocean::Signal Class Reference

This class implements a signal. More...

Public Member Functions

 Signal ()
 Creates a new signal object. More...
 
 ~Signal ()
 Destructs a signal object. More...
 
void wait () const
 Returns after the signal has been pulsed. More...
 
bool wait (const unsigned int time) const
 Returns after the signal has been pulsed or the specified time elapsed. More...
 
bool pulse ()
 Pulses this signal. More...
 
bool reset ()
 Resets the signal. More...
 
void release ()
 Pulses the signal for the last time to allow a waiting process to proceed and releases the signal. More...
 
void * handle () const
 Returns the signal handle. More...
 

Protected Member Functions

 Signal (const Signal &otherSignal)=delete
 Disabled copy constructor. More...
 
Signaloperator= (const Signal &otherSignal)=delete
 Disabled assign operator. More...
 

Protected Attributes

void * signalHandle
 Signal handle for Windows platforms. More...
 
dispatch_semaphore_t semaphoreObject
 Semaphore object for Apple platforms. More...
 
std::atomic< bool > semaphoreObjectReleased
 True, if the semaphore object has been released and should not be used anymore. More...
 
sem_t semaphoreObject
 Semaphore object for e.g., Android platforms. More...
 
bool semaphoreObjectState
 True, if the semaphore object (for e.g., Android platforms) is valid and has been initialized. More...
 

Friends

class Signals
 

Detailed Description

This class implements a signal.

Constructor & Destructor Documentation

◆ Signal() [1/2]

Ocean::Signal::Signal ( )

Creates a new signal object.

◆ ~Signal()

Ocean::Signal::~Signal ( )

Destructs a signal object.

◆ Signal() [2/2]

Ocean::Signal::Signal ( const Signal otherSignal)
protecteddelete

Disabled copy constructor.

Parameters
otherSignalObject which would be copied

Member Function Documentation

◆ handle()

void * Ocean::Signal::handle ( ) const
inline

Returns the signal handle.

Returns
Signal handle

◆ operator=()

Signal& Ocean::Signal::operator= ( const Signal otherSignal)
protecteddelete

Disabled assign operator.

Parameters
otherSignalObject which would be copied
Returns
Reference to this object

◆ pulse()

bool Ocean::Signal::pulse ( )

Pulses this signal.

Returns
True, if succeeded

◆ release()

void Ocean::Signal::release ( )

Pulses the signal for the last time to allow a waiting process to proceed and releases the signal.

◆ reset()

bool Ocean::Signal::reset ( )

Resets the signal.

Returns
True, if succeeded

◆ wait() [1/2]

void Ocean::Signal::wait ( ) const

Returns after the signal has been pulsed.

◆ wait() [2/2]

bool Ocean::Signal::wait ( const unsigned int  time) const

Returns after the signal has been pulsed or the specified time elapsed.

Parameters
timeMaximal wait time in ms
Returns
True, if the signal has been pulsed, False otherwise

Friends And Related Function Documentation

◆ Signals

friend class Signals
friend

Field Documentation

◆ semaphoreObject [1/2]

dispatch_semaphore_t Ocean::Signal::semaphoreObject
protected

Semaphore object for Apple platforms.

◆ semaphoreObject [2/2]

sem_t Ocean::Signal::semaphoreObject
mutableprotected

Semaphore object for e.g., Android platforms.

◆ semaphoreObjectReleased

std::atomic< bool > Ocean::Signal::semaphoreObjectReleased
protected

True, if the semaphore object has been released and should not be used anymore.

True, if the semaphore object (for e.g., Android platforms) has been released and should not be used anymore.

◆ semaphoreObjectState

bool Ocean::Signal::semaphoreObjectState
protected

True, if the semaphore object (for e.g., Android platforms) is valid and has been initialized.

◆ signalHandle

void* Ocean::Signal::signalHandle
protected

Signal handle for Windows platforms.


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