This is Unofficial EPICS BASE Doxygen Site
epics::pvData::Event Class Reference

C++ wrapper for epicsEvent from EPICS base. More...

#include "event.h"

Public Member Functions

 POINTER_DEFINITIONS (Event)
 
 Event (bool=false)
 
 ~Event ()
 
void signal ()
 
bool wait ()
 
bool wait (double timeOut)
 
bool tryWait ()
 

Detailed Description

C++ wrapper for epicsEvent from EPICS base.

Definition at line 31 of file event.h.

Constructor & Destructor Documentation

epics::pvData::Event::Event ( bool  full = false)
explicit

Constructor

Definition at line 39 of file event.cpp.

41 {
42 }
LIBCOM_API epicsEventId epicsEventCreate(epicsEventInitialState initialState)
Create an epicsEvent for use from C code, or return NULL.
Definition: osdEvent.c:47
epics::pvData::Event::~Event ( )

Destructor.

Definition at line 33 of file event.cpp.

33  {
35  id = 0;
36 }
LIBCOM_API void epicsEventDestroy(epicsEventId id)
Destroy an epicsEvent and any resources it holds.
Definition: osdEvent.c:70

Member Function Documentation

epics::pvData::Event::POINTER_DEFINITIONS ( Event  )
void epics::pvData::Event::signal ( )

Signal the event i.e. ensures that the next or current call to wait completes.

Definition at line 44 of file event.cpp.

45 {
46  if(id==0) throw std::logic_error(string("event was deleted"));
47  epicsEventSignal(id);
48 }
#define epicsEventSignal(ID)
A synonym for epicsEventTrigger().
Definition: epicsEvent.h:172
bool epics::pvData::Event::tryWait ( )

See if a signal has been called.

Returns
(false, true) if (timeout or error, event signaled).

Definition at line 64 of file event.cpp.

65 {
66  if(id==0) throw std::logic_error(string("event was deleted"));
68  return status==epicsEventWaitOK ? true : false;
69 }
pvd::Status status
LIBCOM_API epicsEventStatus epicsEventTryWait(epicsEventId id)
Similar to wait() except that if the event is currenly empty the call will return immediately with st...
Definition: osdEvent.c:145
#define epicsEventWaitOK
Old name provided for backwards compatibility.
Definition: epicsEvent.h:58
#define epicsEventWaitStatus
Old name provided for backwards compatibility.
Definition: epicsEvent.h:56
bool epics::pvData::Event::wait ( )

wait

Returns
(false,true) if (some error, event signaled). The next wait or tryWait will clear signal.

Definition at line 50 of file event.cpp.

51 {
52  if(id==0) throw std::logic_error(string("event was deleted"));
54  return status==epicsEventWaitOK ? true : false;
55 }
pvd::Status status
#define epicsEventWait(ID)
Definition: osdEvent.h:19
#define epicsEventWaitOK
Old name provided for backwards compatibility.
Definition: epicsEvent.h:58
#define epicsEventWaitStatus
Old name provided for backwards compatibility.
Definition: epicsEvent.h:56
bool epics::pvData::Event::wait ( double  timeOut)

wait for up to timeOut seconds.

Parameters
timeOutmax number of seconds to wait
Returns
(false, true) if (timeout or error, event signaled).

Definition at line 57 of file event.cpp.

58 {
59  if(id==0) throw std::logic_error(string("event was deleted"));
61  return status==epicsEventWaitOK ? true : false;
62 }
pvd::Status status
LIBCOM_API epicsEventStatus epicsEventWaitWithTimeout(epicsEventId id, double timeOut)
Wait an the event or until the specified timeout period is over.
Definition: osdEvent.c:117
#define epicsEventWaitOK
Old name provided for backwards compatibility.
Definition: epicsEvent.h:58
#define epicsEventWaitStatus
Old name provided for backwards compatibility.
Definition: epicsEvent.h:56

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