This is Unofficial EPICS BASE Doxygen Site
epicsEvent.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2011 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 
40 #ifndef epicsEventh
41 #define epicsEventh
42 
43 #include "libComAPI.h"
44 
46 typedef struct epicsEventOSD *epicsEventId;
47 
49 typedef enum {
54 
56 #define epicsEventWaitStatus epicsEventStatus
57 
58 #define epicsEventWaitOK epicsEventOK
59 
60 #define epicsEventWaitError epicsEventError
61 
63 typedef enum {
67 
68 #ifdef __cplusplus
69 
78 class LIBCOM_API epicsEvent {
79 public:
87  ~epicsEvent ();
92  void trigger ();
95  void signal () { this->trigger(); }
99  void wait ();
104  bool wait ( double timeOut );
109  bool tryWait ();
114  void show ( unsigned level ) const;
115 
116  class invalidSemaphore; /* exception payload */
117 private:
118  epicsEvent ( const epicsEvent & );
119  epicsEvent & operator = ( const epicsEvent & );
120  epicsEventId id;
121 };
122 
123 extern "C" {
124 #endif /*__cplusplus */
125 
131 LIBCOM_API epicsEventId epicsEventCreate(
132  epicsEventInitialState initialState);
133 
140 LIBCOM_API epicsEventId epicsEventMustCreate (
141  epicsEventInitialState initialState);
142 
148 LIBCOM_API void epicsEventDestroy(epicsEventId id);
149 
159  epicsEventId id);
160 
166 LIBCOM_API void epicsEventMustTrigger(epicsEventId id);
167 
172 #define epicsEventSignal(ID) epicsEventMustTrigger(ID)
173 
180  epicsEventId id);
181 
187 LIBCOM_API void epicsEventMustWait(epicsEventId id);
188 
196  epicsEventId id, double timeOut);
197 
204  epicsEventId id);
205 
211 LIBCOM_API void epicsEventShow(
212  epicsEventId id, unsigned int level);
213 
214 #ifdef __cplusplus
215 }
216 #endif /*__cplusplus */
217 
218 #include "osdEvent.h"
219 
220 #endif /* epicsEventh */
struct epicsEventOSD * epicsEventId
An identifier for an epicsEvent for use with the C API.
Definition: epicsEvent.h:46
LIBCOM_API epicsEventStatus epicsEventWaitWithTimeout(epicsEventId id, double timeOut)
Wait an the event or until the specified timeout period is over.
Definition: osdEvent.c:117
LIBCOM_API void epicsEventMustWait(epicsEventId id)
Wait for an event (see epicsEventWait()).
Definition: epicsEvent.cpp:123
LIBCOM_API void epicsEventDestroy(epicsEventId id)
Destroy an epicsEvent and any resources it holds.
Definition: osdEvent.c:70
epicsEventStatus
Return status from several C API routines.
Definition: epicsEvent.h:49
epicsEventInitialState
Possible initial states of a new epicsEvent.
Definition: epicsEvent.h:63
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
LIBCOM_API epicsEventStatus epicsEventWait(epicsEventId id)
Wait for an event.
Definition: osdEvent.c:95
LIBCOM_API void epicsEventMustTrigger(epicsEventId id)
Trigger an event.
Definition: epicsEvent.cpp:116
LIBCOM_API epicsEventId epicsEventCreate(epicsEventInitialState initialState)
Create an epicsEvent for use from C code, or return NULL.
Definition: osdEvent.c:47
LIBCOM_API epicsEventId epicsEventMustCreate(epicsEventInitialState initialState)
Create an epicsEvent for use from C code.
Definition: epicsEvent.cpp:106
LIBCOM_API epicsEventStatus epicsEventTrigger(epicsEventId id)
Trigger an event i.e. ensures the next or current call to wait completes.
Definition: osdEvent.c:80
LIBCOM_API void epicsEventShow(epicsEventId id, unsigned int level)
Display information about the semaphore.
Definition: osdEvent.c:150