EPICS Base 7.0.8.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
epicsEvent Class Reference

A binary semaphore. More...

#include <epicsEvent.h>

Public Member Functions

 epicsEvent (epicsEventInitialState initial=epicsEventEmpty)
 Constructor.
 
 ~epicsEvent ()
 Destroy the epicsEvent and any resources it holds. No calls to wait() can be active when this call is made.
 
void trigger ()
 Trigger the event i.e. ensures the next or current call to wait completes. This method may be called from a vxWorks or RTEMS interrupt handler.
 
void signal ()
 Signal is a synonym for trigger().
 
void wait ()
 Wait for the event.
 
bool wait (double timeout)
 Wait for the event or until the specified timeout.
 
bool tryWait ()
 Similar to wait() except that if the event is currently empty the call will return immediately.
 
void show (unsigned level) const
 Display information about the semaphore.
 

Detailed Description

An epicsEvent is a binary semaphore that can be empty or full. When empty, a wait() issued before the next call to trigger() will block. When full, the next call to wait() will empty the event and return immediately. Multiple calls to trigger() may occur between wait() calls but will have the same effect as a single trigger(), filling the event.

Definition at line 79 of file epicsEvent.h.

Constructor & Destructor Documentation

◆ epicsEvent()

epicsEvent::epicsEvent ( epicsEventInitialState  initial = epicsEventEmpty)
Parameters
initialState when created, empty (the default) or full.

Member Function Documentation

◆ signal()

void epicsEvent::signal ( )
inline

Definition at line 96 of file epicsEvent.h.

◆ wait() [1/2]

void epicsEvent::wait ( )
Note
Blocks until full.

◆ wait() [2/2]

bool epicsEvent::wait ( double  timeout)
Parameters
timeoutThe timeout delay in seconds. A timeout of zero is equivalent to calling tryWait(); NaN or any value too large to be represented to the target OS is equivalent to no timeout.
Returns
True if the event was triggered, False if it timed out.

◆ tryWait()

bool epicsEvent::tryWait ( )
Returns
True if the event was full (triggered), False if empty.

◆ show()

void epicsEvent::show ( unsigned  level) const
Note
The information displayed is architecture dependent.
Parameters
levelAn unsigned int for the level of information to be displayed.

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