EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
ProcessVariableContext.h
1 #ifndef PROCESSVARIABLECONTEXT_H_
2 #define PROCESSVARIABLECONTEXT_H_
3 
4 // Tools
5 #include "tools/Guard.h"
6 
19 {
20 public:
23 
25  virtual ~ProcessVariableContext();
26 
29 
39  void attach(Guard &guard);
40 
45  bool isAttached(Guard &guard);
46 
48  void incRef(Guard &guard);
49 
51  void decRef(Guard &guard);
52 
54  size_t getRefs(Guard &guard);
55 
64  void requestFlush(Guard &guard);
65 
67  bool isFlushRequested(Guard &guard);
68 
74  void flush(Guard &guard);
75 private:
76  // The mutex
77  OrderedMutex mutex;
78 
79  // The context
80  struct ca_client_context *ca_context;
81 
82  // The reference count
83  size_t refs;
84 
85  bool flush_requested;
86 };
87 
88 #endif /*PROCESSVARIABLECONTEXT_H_*/
bool isFlushRequested(Guard &guard)
A mutex with informational name and lock order.
Definition: OrderedMutex.h:34
bool isAttached(Guard &guard)
void incRef(Guard &guard)
Add another reference.
Automatically takes and releases an epicsMutex.
Definition: Guard.h:63
void requestFlush(Guard &guard)
Request a CA 'flush'.
Interface for something that can be protected by a Guard.
Definition: Guard.h:49
Context for ProcessVariable instances.
Definition: ProcessVariableContext.h:18
OrderedMutex & getMutex()
ProcessVariableContext()
Create the context.
void attach(Guard &guard)
Attach current thread to this context.
virtual ~ProcessVariableContext()
Destructor.
void flush(Guard &guard)
Perform the CA flush.
size_t getRefs(Guard &guard)
void decRef(Guard &guard)
Remove a reference.