pvAccessCPP  7.1.5
pvaDefs.h
1 #ifndef PVADEFS_H
2 #define PVADEFS_H
3 
4 #include <epicsTypes.h>
5 #include <epicsMutex.h>
6 #include <epicsGuard.h>
7 
8 namespace epics {
9 namespace pvAccess {
10 
11 /**
12  * Globally unique ID.
13  */
14 struct ServerGUID {
15  char value[12];
16 };
17 
18 typedef epicsInt32 pvAccessID;
19 
20 class AtomicBoolean
21 {
22 public:
23  AtomicBoolean() : val(false) {}
24 
25  void set() {
26  epicsGuard<epicsMutex> G(mutex);
27  val = true;
28  }
29  void clear() {
30  epicsGuard<epicsMutex> G(mutex);
31  val = false;
32  }
33 
34  bool get() const {
35  epicsGuard<epicsMutex> G(mutex);
36  return val;
37  }
38 private:
39  bool val;
40  mutable epicsMutex mutex;
41 };
42 
43 }}
44 
45 #endif // PVADEFS_H
Globally unique ID.
Definition: pvaDefs.h:14