EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | List of all members
ProcessVariableContext Class Reference

Context for ProcessVariable instances. More...

#include <ProcessVariableContext.h>

Inheritance diagram for ProcessVariableContext:
Guardable

Public Member Functions

 ProcessVariableContext ()
 Create the context. More...
 
virtual ~ProcessVariableContext ()
 Destructor. More...
 
OrderedMutexgetMutex ()
 
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...
 

Detailed Description

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.

Constructor & Destructor Documentation

ProcessVariableContext::ProcessVariableContext ( )

Create the context.

virtual ProcessVariableContext::~ProcessVariableContext ( )
virtual

Destructor.

Member Function Documentation

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.

Exceptions
GenericExceptionwhen 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.

OrderedMutex& ProcessVariableContext::getMutex ( )
virtual
See Also
Guardable

Implements Guardable.

size_t ProcessVariableContext::getRefs ( Guard guard)
Returns
Returns current reference count.
void ProcessVariableContext::incRef ( Guard guard)

Add another reference.

bool ProcessVariableContext::isAttached ( Guard guard)
Returns
Returns 'true' if the current thread is attached.
See Also
attach()
bool ProcessVariableContext::isFlushRequested ( Guard guard)
Returns
Returns true if a flush was requested.
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.

See Also
flush()

The documentation for this class was generated from the following file: