EPICS ARCHIVER V4
|
One process variable. More...
#include <ProcessVariable.h>
Public Types | |
enum | State { INIT, DISCONNECTED, GETTING_INFO, CONNECTED } |
Possible states of a ProcessVariable. More... | |
Public Member Functions | |
ProcessVariable (ProcessVariableContext &ctx, const char *name) | |
Create a ProcessVariable with given name. More... | |
virtual | ~ProcessVariable () |
Destructor. More... | |
OrderedMutex & | getMutex () |
State | getState (Guard &guard) const |
bool | isConnected (Guard &guard) const |
const char * | getStateStr (Guard &guard) const |
const char * | getCAStateStr (Guard &guard) const |
DbrType | getDbrType (Guard &guard) const |
Get the DBR_TIME_... More... | |
DbrCount | getDbrCount (Guard &guard) const |
Get the array size of this PV. More... | |
const CtrlInfo & | getCtrlInfo (Guard &guard) const |
void | addStateListener (ProcessVariableStateListener *listener) |
Add a ProcessVariableStateListener. More... | |
void | removeStateListener (ProcessVariableStateListener *listener) |
Remove a ProcessVariableStateListener. More... | |
void | addValueListener (ProcessVariableValueListener *listener) |
Add a ProcessVariableValueListener. More... | |
void | removeValueListener (ProcessVariableValueListener *listener) |
Remove a ProcessVariableValueListener. More... | |
void | addListener (ProcessVariableListener *listener) |
Add a ProcessVariableListener. More... | |
void | removeListener (ProcessVariableListener *listener) |
Remove a ProcessVariableListener. More... | |
void | start (Guard &guard) |
Start the connection mechanism. More... | |
bool | isRunning (Guard &guard) |
void | getValue (Guard &guard) |
Perform a single 'get'. More... | |
void | subscribe (Guard &guard) |
Subscribe for value updates. More... | |
bool | isSubscribed (Guard &guard) const |
void | unsubscribe (Guard &guard) |
Unsubscribe, no more updates. More... | |
void | stop (Guard &guard) |
Disconnect. More... | |
![]() | |
NamedBase (const char *name) | |
Create a Named thing with given name. More... | |
const stdString & | getName () const |
One process variable.
Handles the connect/disconnect, also requests the full information (DBR_CTRL_...) and from then on get/monitor will only get the DBR_TIME_...
Locking: The ProcessVariable and the ProcessVariableContext call into the ChannelAccess client library. The CA client library also invokes callbacks in the ProcessVariable. To avoid deadlocks between ProcessVariable and CA semaphores, the ProcessVariable unlocks itself before calling any CA library. This means, however, that one should not otherwise modify the ProcessVariable while it is dealing with the CA client library. To help enforce this, the add/removeListener calls are only allowed while the ProcessVariable is not running.
Possible states of a ProcessVariable.
Enumerator | |
---|---|
INIT |
Not initialized. |
DISCONNECTED |
Not connected, but trying to connect. |
GETTING_INFO |
Received CA connection callback, getting control info. |
CONNECTED |
Fully connected. |
ProcessVariable::ProcessVariable | ( | ProcessVariableContext & | ctx, |
const char * | name | ||
) |
Create a ProcessVariable with given name.
|
virtual |
Destructor.
|
inline |
Add a ProcessVariableListener.
|
inline |
Add a ProcessVariableStateListener.
|
inline |
Add a ProcessVariableValueListener.
const char* ProcessVariable::getCAStateStr | ( | Guard & | guard | ) | const |
Get the array size of this PV.
Only valid when getState() was CONNECTED
|
virtual |
const char* ProcessVariable::getStateStr | ( | Guard & | guard | ) | const |
void ProcessVariable::getValue | ( | Guard & | guard | ) |
Perform a single 'get'.
Value gets delivered to listeners.
|
inline |
bool ProcessVariable::isRunning | ( | Guard & | guard | ) |
|
inline |
|
inline |
Remove a ProcessVariableListener.
|
inline |
Remove a ProcessVariableStateListener.
|
inline |
Remove a ProcessVariableValueListener.
void ProcessVariable::start | ( | Guard & | guard | ) |
Start the connection mechanism.
void ProcessVariable::subscribe | ( | Guard & | guard | ) |
Subscribe for value updates.
Values get delivered to listeners.
void ProcessVariable::unsubscribe | ( | Guard & | guard | ) |
Unsubscribe, no more updates.