EPICS ARCHIVER V4
|
Context for ProcessVariable instances. More...
#include <ProcessVariableContext.h>
Public Member Functions | |
ProcessVariableContext () | |
Create the context. More... | |
virtual | ~ProcessVariableContext () |
Destructor. More... | |
OrderedMutex & | getMutex () |
void | attach (Guard &guard) |
Attach current thread to this context. More... | |
bool | isAttached (Guard &guard) |
void | incRef (Guard &guard) |
Add another reference. More... | |
void | decRef (Guard &guard) |
Remove a reference. More... | |
size_t | getRefs (Guard &guard) |
void | requestFlush (Guard &guard) |
Request a CA 'flush'. More... | |
bool | isFlushRequested (Guard &guard) |
void | flush (Guard &guard) |
Perform the CA flush. More... | |
Context for ProcessVariable instances.
ChannelAccess assigns PVs to contexts. This one helps to use the same context across threads, and keeps track of the required CA 'flush'.
Uses a reference count to check that all PVs were cleared by the time the context is destroyed.
ProcessVariableContext::ProcessVariableContext | ( | ) |
Create the context.
|
virtual |
Destructor.
void ProcessVariableContext::attach | ( | Guard & | guard | ) |
Attach current thread to this context.
Except for the thread that created the context, all other threads that wish to use the context need to 'attach'. Unclear what happens when you don't, or when you attach more than once.
GenericException | when detecting an error. |
void ProcessVariableContext::decRef | ( | Guard & | guard | ) |
Remove a reference.
void ProcessVariableContext::flush | ( | Guard & | guard | ) |
Perform the CA flush.
Somebody, somehow should monitor 'isFlushRequested' and invoke 'flush' whenever requested.
|
virtual |
size_t ProcessVariableContext::getRefs | ( | Guard & | guard | ) |
void ProcessVariableContext::incRef | ( | Guard & | guard | ) |
Add another reference.
bool ProcessVariableContext::isAttached | ( | Guard & | guard | ) |
bool ProcessVariableContext::isFlushRequested | ( | Guard & | guard | ) |
void ProcessVariableContext::requestFlush | ( | Guard & | guard | ) |
Request a CA 'flush'.
A 'connect' or 'get' often only becomes effective after a 'flush', but we don't want to 'flush' after every such operation because that would degrade performance. So this call requests a flush at a later time.