This is Unofficial EPICS BASE Doxygen Site
event.cpp
Go to the documentation of this file.
1 /* event.cpp */
2 /*
3  * Copyright information and license terms for this software can be
4  * found in the file LICENSE that is included with the distribution
5  */
9 #include <cstddef>
10 #include <cstdlib>
11 #include <cstddef>
12 #include <string>
13 #include <cstdio>
14 #include <stdexcept>
15 
16 #include <memory>
17 #include <vector>
18 #include <epicsThread.h>
19 #include <epicsMutex.h>
20 #include <epicsEvent.h>
21 
22 #define epicsExportSharedSymbols
23 #include <pv/noDefaultMethods.h>
24 #include <pv/pvType.h>
25 #include <pv/lock.h>
26 #include <pv/event.h>
27 
28 using std::string;
29 
30 namespace epics { namespace pvData {
31 
32 
35  id = 0;
36 }
37 
38 
39 Event::Event(bool full)
41 {
42 }
43 
45 {
46  if(id==0) throw std::logic_error(string("event was deleted"));
47  epicsEventSignal(id);
48 }
49 
50 bool Event::wait ()
51 {
52  if(id==0) throw std::logic_error(string("event was deleted"));
54  return status==epicsEventWaitOK ? true : false;
55 }
56 
57 bool Event::wait ( double timeOut )
58 {
59  if(id==0) throw std::logic_error(string("event was deleted"));
61  return status==epicsEventWaitOK ? true : false;
62 }
63 
65 {
66  if(id==0) throw std::logic_error(string("event was deleted"));
68  return status==epicsEventWaitOK ? true : false;
69 }
70 
71 }}
pvd::Status status
#define epicsEventWait(ID)
Definition: osdEvent.h:19
TODO only here because of the Lockable.
Definition: ntaggregate.cpp:16
Event(bool=false)
Definition: event.cpp:39
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 epicsEventSignal(ID)
A synonym for epicsEventTrigger().
Definition: epicsEvent.h:172
APIs for the epicsMutex mutual exclusion semaphore.
LIBCOM_API void epicsEventDestroy(epicsEventId id)
Destroy an epicsEvent and any resources it holds.
Definition: osdEvent.c:70
APIs for the epicsEvent binary semaphore.
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
C++ and C descriptions for a thread.
LIBCOM_API epicsEventId epicsEventCreate(epicsEventInitialState initialState)
Create an epicsEvent for use from C code, or return NULL.
Definition: osdEvent.c:47