PVData C++  8.0.2
event.h
1 /* event.h */
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  */
6 /**
7  * @author mrk
8  */
9 #ifndef EVENT_H
10 #define EVENT_H
11 
12 #include <memory>
13 #include <vector>
14 
15 #include <epicsEvent.h>
16 #include <shareLib.h>
17 
18 #include <pv/pvType.h>
19 #include <pv/sharedPtr.h>
20 
21 
22 namespace epics { namespace pvData {
23 
24 class Event;
25 typedef std::tr1::shared_ptr<Event> EventPtr;
26 
27 /**
28  * @brief C++ wrapper for epicsEvent from EPICS base.
29  *
30  */
31 class epicsShareClass Event {
32 public:
34  /**
35  * Constructor
36  */
37  explicit Event(bool = false);
38  /**
39  * Destructor.
40  */
41  ~Event();
42  /**
43  * Signal the event i.e. ensures that the next or current call to wait completes.
44  */
45  void signal();
46  /**
47  * wait
48  * @return (false,true) if (some error, event signaled).
49  * The next wait or tryWait will clear signal.
50  */
51  bool wait (); /* blocks until full */
52  /**
53  * wait for up to timeOut seconds.
54  * @param timeOut max number of seconds to wait
55  * @return (false, true) if (timeout or error, event signaled).
56  */
57  bool wait ( double timeOut ); /* false if empty at time out */
58  /**
59  * See if a signal has been called.
60  * @return (false, true) if (timeout or error, event signaled).
61  */
62  bool tryWait (); /* false if empty */
63 private:
65 };
66 
67 }}
68 #endif /* EVENT_H */
#define POINTER_DEFINITIONS(clazz)
Definition: sharedPtr.h:198
virtual void serialize(ByteBuffer *buffer, SerializableControl *flusher, std::size_t offset, std::size_t count) const =0
C++ wrapper for epicsEvent from EPICS base.
Definition: event.h:31