Connect Class Reference

#include <connect.h>

Inheritance diagram for Connect:
CAFE

List of all members.

Public Member Functions

 Connect ()
HandleHelper getHandleHelper ()
HandleHelper getInfo ()
PolicyHelper getPolicyHelper ()
PolicyHelper getPolicy ()
unsigned int getNelemClient (unsigned int h)
unsigned int getNelemNative (unsigned int h)
unsigned int getNelemRequest (unsigned int h)
int getStatus ()
CAFEStatus getCafeStatus ()
CAFEStatusSeverity getCafeStatusSeverity ()
int _ca_flush_io ()
int _ca_poll ()
int _ca_pend_io (double t)
int _ca_pend_event (double t)
bool setPyCafe (bool b)
bool getPyCafe ()
int init () throw (CAFEException_init)
int init (ca_preemptive_callback_select select) throw (CAFEException_init)
int open (const string pvS, unsigned int &handle) throw (CAFEException_open)
int open (const string pvS, const std::string pvAliasS, unsigned int &handle) throw (CAFEException_open)
int open (const string *pvArrayS, unsigned int *handleArray, const unsigned int nHandles) throw (CAFEException_open)
 Establishes virtual circuits for a vector of epics process variables

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create CAFEConduit object and add to multi-index hash table
    .

int open (const char *pv, unsigned int &handle) throw (CAFEException_open)
 Establishes virtual circuit to epics process variable

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create Conduit object and add to multi-index hash table
    .

int open (const char *pv, const char *pvAlias, unsigned int &handle) throw (CAFEException_open)
 Establishes virtual circuit to epics process variable and defines its pv alias name

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create Conduit object and add to multi-index hash table
    .

int open (const char **pvArray, unsigned int *handleArray, const unsigned int nHandles) throw (CAFEException_open)
 Establishes virtual circuits for a vector of epics process variables

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create CAFEConduit object and add to multi-index hash table
    .

int open (vector< const char * >, vector< unsigned int > &) throw (CAFEException_open)
 Establishes virtual circuits for a vector of epics process variables

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create CAFEConduit object and add to multi-index hash table
    .

int open (vector< string >, vector< unsigned int > &) throw (CAFEException_open)
 Establishes virtual circuits for a vector of epics process variables

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create CAFEConduit object and add to multi-index hash table
    .

int openV (vector< string > s, vector< unsigned int > &i) throw (CAFEException_open)
void openGroupPrepare ()
void openMonitorPrepare ()
double setOpenDefaultPendTime (double _timeout)
double getOpenDefaultPendTime ()
void openGroupNowAndWait (double _timeout)
void openMonitorNow ()
void openMonitorNowAndWait (double _timeout)
void openPrepare ()
void openNowAndWait (double _timeout)
void openNow ()
void openNoWait ()
unsigned int printHandle (unsigned int h)
unsigned int printHandles (void)
unsigned int printDisconnectedHandles (void)
unsigned int getDisconnectedHandles (vector< unsigned int > &dhV, vector< string > &pvV)
void printCAFEException_pv (CAFEException_pv &e)
int closeChannels (unsigned int *handleArray, unsigned int nHandles)
 Closes connection for channel within a ca_client_context and deletes corresponding handle
The handle must be within the same context.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event handlers for subscriptions (i.e., monitors).
The Conduit handle is erased.
int closeChannels (vector< unsigned int > v)
int closeChannelsV (vector< unsigned int > v)
int close (unsigned int handle)
 Closes connection for channel within a ca_client_context and deletes corresponding handle
The handle must be within the same context.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event handlers for subscriptions (i.e. monitors).
The Conduit handle is erased.
int closeChannel (unsigned int handle)
int closeChannels ()
 Closes all channel connections within a ca_client_context and removes the corresponding handles.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event subscriptions (for monitors).
Corresponding Conduit handles are erased.
int closeChannels (ca_client_context *cctLocal)
 Closes all channel connections within the given ca_client_context and removes the corresponding handles.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event subscriptions (for monitors).
Corresponding Conduit handles are erased.
int close ()
int closeHandles (unsigned int *handleArray, unsigned int nHandles)
 Closes given channel connections (even if in other threads) and deletes their handles.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event subscriptions (for monitors).
All corresponding Conduit handles are erased.
int closeHandle (unsigned int handle)
 Closes channel connections (even if in other thread) and deletes handle.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event handlers for subscriptions (i.e. monitors).
The Conduit handle is erased.
int closeHandles ()
 Closes all channel connections (even if in other threads) and deletes all handles.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event subscriptions (for monitors).
All Conduit handles are erased.
int monitorStart (unsigned int handle, MonitorPolicy &mp)
 Monitor a PV.
int monitorStart (unsigned int handle, unsigned int &monitorID)
 Monitor a PV.
int monitorStart (unsigned int handle)
int monitorStop (unsigned int handle, MonitorPolicy mp)
 Stop monitor of a PV.
int monitorStop (unsigned int handle, unsigned int monitorID)
 Stop monitor of a PV.
int monitorStopWithID (unsigned int handle, unsigned int monitorID)
int monitorStop (unsigned int handle)
 Stop all monitors for this handle.
int monitorStop ()
 Stop all monitors.
int monitorStopAll ()
int monitorStop (ca_client_context *ccc)
 Stop all monitors for the given ca_client_context.
int monitorStart (unsigned int *handleArray, unsigned int nelem)
int monitorStart (unsigned int *handleArray, unsigned int nelem, int *statusArray, MonitorPolicy *mpV)
 Monitor an array of PV with parameters set by MonitorPolicy objects.
int monitorStart (unsigned int *handleArray, unsigned int nelem, int *statusArray, unsigned int *monitorIDArray)
 Monitor an array of PV with parameters with default policies.
int monitorStart (vector< unsigned int > handleV, vector< int > &statusV, vector< MonitorPolicy > &mpV)
 Monitor an array of PV with parameters set by MonitorPolicy objects.
int monitorStart (vector< unsigned int > handleV, vector< int > &statusV, vector< unsigned int > &monitorIDV)
 Monitor an array of PV with default MonitorPolicy object parameters.
int monitorStop (unsigned int *handleArray, unsigned int nelem, int *statusArray)
 Stop all monitors for this array of handles.
int monitorStop (vector< unsigned int > handleV, vector< int > &statusV)
 Stop all monitors for a vector of handles.
int monitorStop (unsigned int *handleArray, unsigned int nelem)
MonitorPolicycreateMonitorPolicyArray (const unsigned int nmp)
int terminate ()
 Closes all channels within a given context and all handles for all contexts
Shuts down the local channel access client context and frees allocated resources
contextDestroy is not essential as resources are normally automatically released by the system.
int terminate (ca_client_context *cctLocal)
 Closes all channels within the given context and their respective handles
Shuts down the given channel access client context and frees allocated resources
contextDestroy is not essential as resources are normally automatically released by the system.
unsigned int getHandleFromPV (const char *pv)
const char * getPVFromHandle (unsigned int handle)
unsigned int getHandleFromPVWithinGroup (const char *pv, unsigned int grh)
bool isEnum (unsigned int handle)
bool isValid (unsigned int handle)
bool allChannelsConnected ()
bool isConnected (unsigned int handle)
bool isChannelConnected (unsigned int handle)
int getChannelInfo (unsigned int handle, ChannelRegalia &channelInfo)
chid getChannelID (unsigned int handle)
ca_client_context * getClientContext (const char *pvname)
ca_client_context * getClientContext (unsigned int handle)
int attachContext (ca_client_context *ccc)
int attachContextByPVName (const char *pvname)
int attachContextByHandle (unsigned int handle)
int updateAccessRead (unsigned int handle, int ar)
int updateAccessWrite (unsigned int handle, int aw)
bool getReadAccess (unsigned int handle)
bool getWriteAccess (unsigned int handle)
void printStatusMessage (int status)
int printStatus (unsigned int handle, int status)
 print status information of given handle
int printStatusIfError (unsigned int handle, int status)
 print status information of given handle only on error
int printStatus (unsigned int *handleArray, unsigned int nelem, int *statusArray)
 print status information of given handles
int printStatusIfError (unsigned int *handleArray, unsigned int nelem, int *statusArray)
 print status information of given handles only on error
int printStatus (vector< unsigned int > handleV, vector< int > statusV)
 print status information of given handles
int printStatusIfError (vector< unsigned int > handleV, vector< int > statusV)
 print status information of given handles only on error
int setPVAlias (unsigned int handle, const char *pv) throw (CAFEException_open)
 Defines a pv alias for pv and adds this to multi-index hash table.
PVDataHoldergetPVData (vector< unsigned int > handleArray)
 Creates a pseudo group from input handles and initalizes PVdataHolder array; \ method to be preceded by getV(v) and followed by e.g.getCachePVArrayNoWait(v, pvd).
int collectionDefine (const char *collectionName, vector< string > deviceV)
 Connect::collectionDefine: Add collection to global vector, deviceCollectionV.
int collectionDefine (const char *collectionName, vector< const char * > deviceV)
 Connect::collectionDefine: Add collection to global vector, deviceCollectionV.
int collectionDefine (const char *collectionName, pv_string_t *deviceArray, unsigned int deviceLength)
 Connect::collectionDefine: Add collection to global vector, deviceCollectionV.
int collectionFetch (const char *collectionName, vector< string > &deviceListV)
 Connect::collectionFetch - retrieves Collection.
int collectionFetch (const char *collectionName, vector< const char * > &deviceListV)
 Connect::collectionFetch - retrieves Collection.
int collectionFetch (const char *collectionName, deviceCollection &dC)
 Connect::collectionFetch - retrieves Collection.
vector< deviceCollectiongetCollections () const
int collectionMemberList (const char *collectionName, boost::shared_ptr< pv_string_t[]> &list, unsigned int &listLength)
 Connect::collectionMemberList - lists the members of the given collection
.
int collectionList (boost::shared_ptr< pv_string_t[]> &clist, unsigned int &listLength)
 Connect::collectionList - lists all collection in global vector deviceCollectionV
.
int collectionMemberList (const char *collectionName, vector< string > &list)
 Connect::collectionMemberList - lists the members of the given collection.
int collectionList (vector< string > &clist)
 Connect::collectionList - lists all collections in global vector deviceCollectionV.
int fetchIndexOfCollectionMember (const char *collectionName, const char *deviceName)
 Connect::fetchIndexOfCollectionMember.
bool isGroup (const char *)
 Connect::isGroup - Test const char * to determine if input 'name' is a garoup.
bool isCollection (const char *)
 Connect::isCollection - Test const char * to determine if input 'name' is a collection.
int groupOpen (const char *pv, unsigned int &groupHandle) throw (CAFEException_groupOpen)
 Establishes virtual circuit to epics process variable for each group member by calling Connect::open(pv, &handle).
int groupOpen (PVGroup &pvgroup, unsigned int &groupHandle) throw (CAFEException_groupOpen)
int groupClose (unsigned int groupHandle)
int groupClose ()
int groupCloseAll ()
int groupHandleErase ()
int groupHandleErase (ca_client_context *ccc)
int groupCombine (const char *newGroupName, const char *groupName1, const char *groupName2)
 Connect::groupCombine - Combines two groups to form a new group.
int groupCombine (const char *newGroupName, vector< char * > groupName)
 Connect::groupCombine - Combines individual groups to form a new group.
vector< string > generateChannelList (vector< string > inputStringV)
vector< string > getFromGlobalChannelList (vector< string >)
int groupDefine (const char *groupName, const char *collectionName, vector< string > attributeV)
 Connect::groupDefine.
int groupDefine (const char *groupName, const char *collectionName, vector< const char * > attributeV)
 Connect::groupDefine.
int groupDefine (const char *groupName, const char *collectionName, pv_string_t *attributeArray, unsigned short attributeLength)
 Connect::groupDefine.
int groupDefine (const char *groupName, const char *collectionName, pv_string_t attribute)
int groupDefine (const char *groupName, vector< string > deviceV, vector< string > attributeV)
 Connect::groupDefine.
int groupDefine (const char *groupName, vector< const char * > deviceV, vector< const char * > attributeV)
 Connect::groupDefine.
int groupDefine (const char *groupName, pv_string_t *deviceArray, unsigned int deviceLength, pv_string_t *attributeArray, unsigned short attributeLength)
 Connect::groupDefine.
int groupDefine (const char *groupName, vector< string > pvArrayV)
 Connect::groupDefine.
int groupDefine (const char *groupName, vector< const char * > pvArrayV)
 Connect::groupDefine.
int groupDefine (const char *groupName, pv_string_t *pvArray, unsigned int pvArrayLength)
 Connect::groupDefine.
int groupMemberList (const char *groupName, boost::shared_ptr< pv_string_t[]> &list, unsigned int &listLength)
 Connect::groupMemberList - lists the members of the given group
User responsible for deleting list array.
int groupList (boost::shared_ptr< pv_string_t[]> &glist, unsigned int &listLength)
 Connect::groupList - lists all groups in global vector PVGroupV
.
int groupMemberList (const char *groupName, vector< string > &list)
 Connect::groupMemberList - lists the members of the given group.
int groupList (vector< string > &glist)
 Connect::groupList - lists all groups in global vector PVGroupV.
int fetchIndexOfGroupMember (const char *groupName, const char *pv)
 Connect::fetchIndexOfGroupMember.
void setDeviceAttributeDeliminator (std::string d)
std::string getDeviceAttributeDeliminator () const

Public Attributes

ChannelOpenPolicy channelOpenPolicy
ChannelOpenPolicy channelClosePolicy
ChannelOpenPolicy channelMonitorPolicy
ChannelOpenPolicy channelOpenGroupPolicy

Protected Member Functions

int createChannel (unsigned int handle, const char *pv, chid &pCh)
int createHandle (const char *pv, ca_client_context *ccc, unsigned int &handle) throw (CAFEException_pv)
int contextDestroy ()
 Shuts down a channel access client context and frees allocated resources Not essential as resources are normally automatically released by the system. This invokes the connection_handler callback function.
int contextDestroy (ca_client_context *cctLocal)
 Closes channels for the given channel access client context.
Shuts down the 'local' channel access client context and frees allocated resources
Note that in thread:stop, these two contexts are different!!
Not essential as resources are normally automatically released by the system.
This invokes the connection_handler callback function.
unsigned short epicsVersion (unsigned short &major, unsigned short &minor, unsigned short &patch)
int createChannelWithinGroup (unsigned int handle, const char *pv, chid &pCh)
int createHandleWithinGroup (const char *pv, ca_client_context *ccc, unsigned int &_handle) throw (CAFEException_pv)
 Connect::createHandleWithinGroup.

Static Protected Member Functions

static void callbackHandlerAccessRights (struct access_rights_handler_args args)
static void callbackHandlerException (struct exception_handler_args args)

Protected Attributes

int status
CAFEStatus cafeStatus
CAFEStatusSeverity cafeStatusSeverity
cafeConduit_set::iterator itcs
cafeGroup_set::iterator itgs
CAFEDataTypeCode cafeDataTypeCode
ExceptionsHelper exceptionsHelper
ChannelCreatePolicy channelCreatePolicy
PolicyHelper policyHelper
HandleHelper handleHelper
Helper helper
std::string deviceAttributeDeliminator
bool pyCafeFlag

Constructor & Destructor Documentation

Connect::Connect (  )  [inline]

Member Function Documentation

int Connect::_ca_flush_io (  )  [inline]
int Connect::_ca_pend_event ( double  t  )  [inline]
int Connect::_ca_pend_io ( double  t  )  [inline]
int Connect::_ca_poll (  )  [inline]
bool Connect::allChannelsConnected (  )  [inline]

References cs, and itcs.

int Connect::attachContext ( ca_client_context *  ccc  )  [inline]

References ECAFE_NULLCONTEXT.

int Connect::attachContextByHandle ( unsigned int  handle  )  [inline]
int Connect::attachContextByPVName ( const char *  pvname  )  [inline]
void Connect::callbackHandlerAccessRights ( struct access_rights_handler_args  args  )  [static, protected]

Callback function for callbackHandlerAccessRights
Modifies Conduit object accordingly
Callback handler for the event of a change of R/W access rights
R3.14 documentation states that the callback handler is called

  • whenever CA connects the channel, immediately BEFORE the channel's connection handler is called
  • whenever CA disconnects the channel, immediately AFTER the channel's disconnect callback handler is called
  • once immediately after installation if the channel is connected
  • whenever the access rights of a connected channel changes
    Parameters:
    args output: access_rights_handler_args parameters

References cafeMutex, cs, long, and MUTEX.

Referenced by createChannel(), and createChannelWithinGroup().

void Connect::callbackHandlerException ( struct exception_handler_args  args  )  [static, protected]

Callback function for callbackHandlerException Modifies CAFEConduit object accordingly

Parameters:
args output: exception_handler_args parameters

References long, and PVNAME_SIZE.

Referenced by createChannel(), and createChannelWithinGroup().

int Connect::close (  )  [inline]
int Connect::close ( unsigned int  handle  ) 

Closes connection for channel within a ca_client_context and deletes corresponding handle
The handle must be within the same context.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event handlers for subscriptions (i.e. monitors).
The Conduit handle is erased.

Parameters:
handle input
Returns:
ECA_NORMAL if all OK

References cafeMutex, channelClosePolicy, cs, ECAFE_INVALID_HANDLE, ECAFE_NULLCONTEXT, ECAFE_WRONG_CA_CONTEXT, ChannelOpenPolicy::getTimeout(), ICAFE_NORMAL, itcs, MUTEX, and status.

int Connect::closeChannel ( unsigned int  handle  )  [inline]

References close().

int Connect::closeChannels ( ca_client_context *  cctLocal  ) 

Closes all channel connections within the given ca_client_context and removes the corresponding handles.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event subscriptions (for monitors).
Corresponding Conduit handles are erased.

Returns:
ECA_NORMAL if all OK; error if one or more channelIDs fail to close

References cafeMutex, channelClosePolicy, cs, ECAFE_NULLCONTEXT, ChannelOpenPolicy::getTimeout(), ICAFE_NORMAL, itcs, MUTEX, and status.

int Connect::closeChannels (  ) 

Closes all channel connections within a ca_client_context and removes the corresponding handles.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event subscriptions (for monitors).
Corresponding Conduit handles are erased.

Returns:
ECA_NORMAL if all OK; error if one or more channelIDs fail to close

References ECAFE_NULLCONTEXT.

Referenced by close(), closeChannels(), closeChannelsV(), contextDestroy(), and terminate().

int Connect::closeChannels ( vector< unsigned int v  )  [inline]

References closeChannels(), and status.

int Connect::closeChannels ( unsigned int handleArray,
unsigned int  nHandles 
)

Closes connection for channel within a ca_client_context and deletes corresponding handle
The handle must be within the same context.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event handlers for subscriptions (i.e., monitors).
The Conduit handle is erased.

Parameters:
handleArray input: array of handles
nHandles input: size of array
Returns:
ECA_NORMAL if all OK else first encountered error

References cafeMutex, channelClosePolicy, cs, ECAFE_NULLCONTEXT, ChannelOpenPolicy::getTimeout(), ICAFE_NORMAL, MUTEX, and status.

int Connect::closeChannelsV ( vector< unsigned int v  )  [inline]

References closeChannels(), and status.

int Connect::closeHandle ( unsigned int  handle  ) 

Closes channel connections (even if in other thread) and deletes handle.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event handlers for subscriptions (i.e. monitors).
The Conduit handle is erased.

Parameters:
handle input
Returns:
ECA_NORMAL if all OK

References cafeMutex, channelClosePolicy, cs, ECAFE_INVALID_HANDLE, ChannelOpenPolicy::getTimeout(), ICAFE_NORMAL, itcs, MUTEX, and status.

int Connect::closeHandles (  ) 

Closes all channel connections (even if in other threads) and deletes all handles.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event subscriptions (for monitors).
All Conduit handles are erased.

Returns:
ECA_NORMAL if all OK; error if one or more channelIDs fail to close

References cafeMutex, channelClosePolicy, cs, ChannelOpenPolicy::getTimeout(), itcs, MUTEX, and status.

Referenced by groupClose(), and terminate().

int Connect::closeHandles ( unsigned int handleArray,
unsigned int  nHandles 
)

Closes given channel connections (even if in other threads) and deletes their handles.
Note that this does NOT cause the channel's disconnect handler to be called.
It does however invoke event subscriptions (for monitors).
All corresponding Conduit handles are erased.

Parameters:
handleArray input: unsigned int *
nHandles input: unsigned int
Returns:
ECA_NORMAL if all OK; error if one or more channelIDs fail to close

References cafeMutex, channelClosePolicy, cs, ChannelOpenPolicy::getTimeout(), ICAFE_NORMAL, itcs, MUTEX, and status.

int Connect::collectionDefine ( const char *  collectionName,
pv_string_t deviceList,
unsigned int  deviceListLength 
)

Connect::collectionDefine: Add collection to global vector, deviceCollectionV.

Parameters:
collectionName input: define collection name
deviceList input: array of pv_string_t that comprises the collection of devices
deviceListLength input: size of deviceList array
Returns:
ICAFE_NORMAL

References deviceCollection::cMembers, deviceCollectionV, collectionMember::deviceName, ECAFE_COLLECTION_PREV_DEF, ICAFE_NORMAL, and deviceCollection::name.

int Connect::collectionDefine ( const char *  collectionName,
vector< const char * >  deviceListV 
)

Connect::collectionDefine: Add collection to global vector, deviceCollectionV.

Parameters:
collectionName input: define collection name
deviceListV input: vector list of const char * that comprise the collection of devices
Returns:
ICAFE_NORMAL

References deviceCollection::cMembers, deviceCollectionV, collectionMember::deviceName, ECAFE_COLLECTION_PREV_DEF, ICAFE_NORMAL, and deviceCollection::name.

int Connect::collectionDefine ( const char *  collectionName,
vector< string >  deviceListV 
)

Connect::collectionDefine: Add collection to global vector, deviceCollectionV.

Parameters:
collectionName input: define collection name
deviceListV input: vector list of strings that comprise the collection of devices
Returns:
ICAFE_NORMAL

References deviceCollection::cMembers, deviceCollectionV, collectionMember::deviceName, ECAFE_COLLECTION_PREV_DEF, ICAFE_NORMAL, and deviceCollection::name.

int Connect::collectionFetch ( const char *  collectionName,
deviceCollection dC 
)

Connect::collectionFetch - retrieves Collection.

Parameters:
collectionName input: collection name
dC ouput: deviceCollection class
Returns:
ICAFE_NORMAL else ECAFE_UNKNOWN_COLLECTION

References deviceCollectionV, ECAFE_UNKNOWN_COLLECTION, helper, ICAFE_NORMAL, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

int Connect::collectionFetch ( const char *  collectionName,
vector< const char * > &  deviceListV 
)

Connect::collectionFetch - retrieves Collection.

Parameters:
collectionName input: collection name
deviceListV ouput: vector of const char * containing collection members
Returns:
ICAFE_NORMAL else ECAFE_UNKNOWN_COLLECTION, ECAFE_EMPTY_COLLECTION

References deviceCollectionV, ECAFE_EMPTY_COLLECTION, ECAFE_UNKNOWN_COLLECTION, helper, ICAFE_NORMAL, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

int Connect::collectionFetch ( const char *  collectionName,
vector< string > &  deviceListV 
)

Connect::collectionFetch - retrieves Collection.

Parameters:
collectionName input: collection name
deviceListV ouput: vector of strings containing collection members
Returns:
ICAFE_NORMAL else ECAFE_UNKNOWN_COLLECTION, ECAFE_EMPTY_COLLECTION

References deviceCollectionV, ECAFE_EMPTY_COLLECTION, ECAFE_UNKNOWN_COLLECTION, helper, ICAFE_NORMAL, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

Referenced by groupDefine().

int Connect::collectionList ( vector< string > &  clist  ) 

Connect::collectionList - lists all collections in global vector deviceCollectionV.

Parameters:
clist output: vector of collection names (string)
Returns:
ICAFE_NORMAL

References deviceCollectionV, and ICAFE_NORMAL.

int Connect::collectionList ( boost::shared_ptr< pv_string_t[]> &  clist,
unsigned int listLength 
)

Connect::collectionList - lists all collection in global vector deviceCollectionV
.

Parameters:
clist output: array of collection names (pv_string_t)
listLength output: length of clist array
Returns:
ICAFE_NORMAL

References deviceCollectionV, and ICAFE_NORMAL.

int Connect::collectionMemberList ( const char *  collectionName,
vector< string > &  list 
)

Connect::collectionMemberList - lists the members of the given collection.

Parameters:
collectionName input: name of collection
list output: vector of devices (string)
Returns:
ICAFE_NORMAL is all OK else, ECAFE_UNKNOWN_COLLECTION

References deviceCollectionV, ECAFE_UNKNOWN_COLLECTION, helper, ICAFE_NORMAL, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

int Connect::collectionMemberList ( const char *  collectionName,
boost::shared_ptr< pv_string_t[]> &  list,
unsigned int listLength 
)

Connect::collectionMemberList - lists the members of the given collection
.

Parameters:
collectionName input: name of Collection
list output: array of device names (pv_string_t)
listLength,: length of list array
Returns:
ICAFE_NORMAL is all OK else, ECAFE_UNKNOWN_COLLECTION

References deviceCollectionV, ECAFE_UNKNOWN_COLLECTION, helper, ICAFE_NORMAL, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

int Connect::contextDestroy ( ca_client_context *  cctLocal  )  [protected]

Closes channels for the given channel access client context.
Shuts down the 'local' channel access client context and frees allocated resources
Note that in thread:stop, these two contexts are different!!
Not essential as resources are normally automatically released by the system.
This invokes the connection_handler callback function.

Returns:
ECA_NORMAL if all OK or ECAFE_NULLCONTEXT if ca client context does not exist

References closeChannels(), ECAFE_NULLCONTEXT, and ICAFE_NORMAL.

int Connect::contextDestroy (  )  [protected]

Shuts down a channel access client context and frees allocated resources Not essential as resources are normally automatically released by the system. This invokes the connection_handler callback function.

Returns:
ECA_NORMAL if all OK or ECAFE_NULLCONTEXT if ca client context does not exist

References closeChannels(), ECAFE_NULLCONTEXT, and ICAFE_NORMAL.

Referenced by terminate().

int Connect::createChannel ( unsigned int  handle,
const char *  pv,
chid &  pCh 
) [protected]

Connect::createChannel

Establishes virtual circuit to epics process variable

Parameters:
handle input
pv input: process variable
pCh output: channel identifier (chid)
Returns:
status ECA_NORMAL if all OK else ECA_BADTYPE, ECA_STRTOBIG, ECA_ALLOCMEM

References __METHOD__, ADD_EXCEPTION_EVENT, cafeMutex, cafeStatus, callbackHandlerAccessRights(), callbackHandlerException(), channelCreatePolicy, channelOpenPolicy, cs, ECAFE_INVALID_HANDLE, CAFENUM::FLUSH_AFTER_EACH_CHANNEL_CREATION, ChannelOpenPolicy::flushSendBufferNow(), ChannelCreatePolicy::getHandler(), ChannelCreatePolicy::getPriority(), ChannelOpenPolicy::getWhenToFlushSendBuffer(), MUTEX, CAFEStatus::report(), and status.

int Connect::createChannelWithinGroup ( unsigned int  _handle,
const char *  pv,
chid &  pCh 
) [protected]

Connect::createChannelWithinGroup (as for createChannel)

Establishes virtual circuit to epics process variable

Parameters:
_handle input
pv input: process variable
pCh output: channel identifier (chid)
Returns:
status ECA_NORMAL if all OK else ECA_BADTYPE, ECA_STRTOBIG, ECA_ALLOCMEM

References __METHOD__, ADD_EXCEPTION_EVENT, cafeMutex, cafeStatus, callbackHandlerAccessRights(), callbackHandlerException(), channelCreatePolicy, cs, ECAFE_INVALID_HANDLE, ChannelCreatePolicy::getHandler(), ChannelCreatePolicy::getPriority(), MUTEX, CAFEStatus::report(), and status.

int Connect::createHandle ( const char *  pv,
ca_client_context *  ccc,
unsigned int handle 
) throw (CAFEException_pv) [protected]

Connect::createHandle

Creates handle and calls createChannel to establish virtual circuit to epics process variable

Parameters:
pv input: process variable
ccc input: ca_client_context
handle input: handle
Exceptions:
CAFEException_pv if unable to create channel virtual circuit
Returns:
status ICAFE_NORMAL if all OK

Conduit cc = *(p.first);

_handle=cc.getHandle();

References __METHOD__, cafeMutex, close(), cs, ECAFE_HASH_UNIQUEID_EXISTS, ECAFE_NULLCHID, Conduit::handleNext, and MUTEX.

int Connect::createHandleWithinGroup ( const char *  pv,
ca_client_context *  ccc,
unsigned int _handle 
) throw (CAFEException_pv) [protected]

Connect::createHandleWithinGroup.

Parameters:
pv input: process variable
ccc input: ca_client_context
_handle input: handle
Returns:
status

References __METHOD__, cafeMutex, close(), cs, ECAFE_HASH_UNIQUEID_EXISTS, ECAFE_NULLCHID, Conduit::handleNext, ICAFE_NORMAL, and MUTEX.

MonitorPolicy* Connect::createMonitorPolicyArray ( const unsigned int  nmp  )  [inline]
unsigned short Connect::epicsVersion ( unsigned short &  major,
unsigned short &  minor,
unsigned short &  patch 
) [protected]

Connect::epicsVersion

Establishes virtual circuit to epics process variable

Parameters:
major input
minor input
patch input
Returns:
31412 for v3.14.12

References EPICS_MAJOR, EPICS_MINOR, and EPICS_PATCH.

int Connect::fetchIndexOfCollectionMember ( const char *  collectionName,
const char *  deviceName 
)

Connect::fetchIndexOfCollectionMember.

Parameters:
collectionName input: collection name
deviceName input: (const char *) device name
Returns:
index of device in collection; else -1 if error

References deviceCollectionV, helper, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

int Connect::fetchIndexOfGroupMember ( const char *  groupName,
const char *  pv 
)

Connect::fetchIndexOfGroupMember.

Parameters:
groupName input: group name
pv input: (const char *) process variable
Returns:
index of pvdata for pv within group; else -1 if error

References helper, PVGroupV, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

vector<string> Connect::generateChannelList ( vector< string >  inputStringV  )  [inline]
CAFEStatus Connect::getCafeStatus (  )  [inline]

References cafeStatus.

Referenced by printStatusMessage().

CAFEStatusSeverity Connect::getCafeStatusSeverity (  )  [inline]

References cafeStatusSeverity.

chid Connect::getChannelID ( unsigned int  handle  )  [inline]

References cs.

int Connect::getChannelInfo ( unsigned int  handle,
ChannelRegalia channelInfo 
) [inline]
ca_client_context* Connect::getClientContext ( unsigned int  handle  )  [inline]
ca_client_context* Connect::getClientContext ( const char *  pvname  )  [inline]
vector<deviceCollection> Connect::getCollections (  )  const [inline]

References deviceCollectionV.

std::string Connect::getDeviceAttributeDeliminator (  )  const [inline]
unsigned int Connect::getDisconnectedHandles ( vector< unsigned int > &  dhV,
vector< string > &  pvV 
) [inline]
vector< string > Connect::getFromGlobalChannelList ( vector< string >  searchList  ) 

References globalChannelList.

Referenced by generateChannelList().

unsigned int Connect::getHandleFromPV ( const char *  pv  )  [inline]

References HandleHelper::getHandleFromPV(), and handleHelper.

Referenced by main().

unsigned int Connect::getHandleFromPVWithinGroup ( const char *  pv,
unsigned int  grh 
) [inline]
HandleHelper Connect::getHandleHelper (  )  [inline]

References handleHelper.

Referenced by CAFE::getCache(), main(), and CAFE::snapshot2XML().

HandleHelper Connect::getInfo (  )  [inline]

References handleHelper.

Referenced by CAFE::snapshot2XML().

unsigned int Connect::getNelemClient ( unsigned int  h  )  [inline]
unsigned int Connect::getNelemNative ( unsigned int  h  )  [inline]

References HandleHelper::getNelemNative(), and handleHelper.

Referenced by main().

unsigned int Connect::getNelemRequest ( unsigned int  h  )  [inline]

References HandleHelper::getNelemRequest(), and handleHelper.

Referenced by main().

double Connect::getOpenDefaultPendTime (  )  [inline]
PolicyHelper Connect::getPolicy (  )  [inline]

References policyHelper.

PolicyHelper Connect::getPolicyHelper (  )  [inline]

References policyHelper.

PVDataHolder * Connect::getPVData ( vector< unsigned int handleArray  ) 
const char* Connect::getPVFromHandle ( unsigned int  handle  )  [inline]

References HandleHelper::getPVFromHandle(), and handleHelper.

Referenced by main().

bool Connect::getPyCafe (  )  [inline]

References pyCafeFlag.

bool Connect::getReadAccess ( unsigned int  handle  )  [inline]

References cs.

int Connect::getStatus ( void   )  [inline]

References status.

Referenced by CAFE::snapshot2XML().

bool Connect::getWriteAccess ( unsigned int  handle  )  [inline]

References cs.

int Connect::groupClose (  ) 

Closes all channel connections associated within a group, for all groupHandles. Note that this does NOT cause the channel's disconnect handler to be called. It does however invoke event subscriptions (for monitors). All Conduit handles are erased.

Returns:
ICAFE_NORMAL if all OK

References HandleHelper::getGroupHandleFromGroupName(), handleHelper, ICAFE_NORMAL, and PVGroupV.

Referenced by groupCloseAll().

int Connect::groupClose ( unsigned int  groupHandle  ) 

Closes all channel connections associated within a group, indentified by it's groupHandle. Note that this does NOT cause the channel's disconnect handler to be called. It does however invoke event subscriptions (for monitors). All Conduit handles are erased.

Parameters:
groupHandle input
Returns:
ICAFE_NORMAL if all OK

References cafeMutex, closeHandles(), ECAFE_INVALID_GROUP_HANDLE, HandleHelper::getGroupNameFromGroupHandle(), gs, handleHelper, ICAFE_NORMAL, MUTEX, and PVGroupV.

int Connect::groupCloseAll (  )  [inline]

References groupClose().

int Connect::groupCombine ( const char *  newGroupName,
vector< char * >  groupNameV 
)

Connect::groupCombine - Combines individual groups to form a new group.

Parameters:
newGroupName input: new group name
groupNameV input: vector of groups
Returns:
ICAFE_NORMAL is all OK else, ECAFE_GROUP_PREV_DEF, ECAFE_UNKNOWN_GROUP

References ECAFE_GROUP_PREV_DEF, ECAFE_UNKNOWN_GROUP, helper, ICAFE_NORMAL, MemberMap::insert(), PVGroup::memberMap, PVGroup::name, PVGroup::npv, PVGroup::pvdata, PVGroupV, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

int Connect::groupCombine ( const char *  newGroupName,
const char *  groupName1,
const char *  groupName2 
)

Connect::groupCombine - Combines two groups to form a new group.

Parameters:
newGroupName input: new group name
groupName1 input: already existing group
groupName2 input: already existing group
Returns:
ICAFE_NORMAL is all OK else, ECAFE_GROUP_PREV_DEF, ECAFE_UNKNOWN_GROUP

References ECAFE_GROUP_PREV_DEF, ECAFE_UNKNOWN_GROUP, helper, ICAFE_NORMAL, MemberMap::insert(), PVGroup::memberMap, PVGroup::name, PVGroup::npv, PVGroup::pvdata, PVGroupV, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

int Connect::groupDefine ( const char *  groupName,
pv_string_t pvArray,
unsigned int  pvArrayLength 
)

Connect::groupDefine.

Parameters:
groupName input: new group name
pvArray input: array of process variables (pv_string_t)
pvArrayLength,: length of pvArray
Returns:
ICAFE_NORMAL is all OK else, ECAFE_GROUP_PREV_DEF

References deviceAttributeDeliminator, ECAFE_GROUP_PREV_DEF, ChannelDeviceAttribute::getAttribute(), ChannelDeviceAttribute::getDevice(), helper, ICAFE_NORMAL, ChannelDeviceAttribute::init(), MemberMap::insert(), PVGroup::memberMap, PVGroup::name, PVGroup::npv, PVGroup::pvdata, PVGroupV, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

int Connect::groupDefine ( const char *  groupName,
vector< const char * >  pvArrayV 
)

Connect::groupDefine.

Parameters:
groupName input: new group name
pvArrayV input: vector of process varaibles (const char *)
Returns:
ICAFE_NORMAL is all OK else, ECAFE_GROUP_PREV_DEF

References groupDefine(), and status.

int Connect::groupDefine ( const char *  groupName,
vector< string >  pvArrayV 
)

Connect::groupDefine.

Parameters:
groupName input: new group name
pvArrayV input: vector of process varaibles (string)
Returns:
ICAFE_NORMAL is all OK else, ECAFE_GROUP_PREV_DEF

References groupDefine(), and status.

int Connect::groupDefine ( const char *  groupName,
pv_string_t deviceArray,
unsigned int  nDevice,
pv_string_t attributeArray,
unsigned short  nAttribute 
)

Connect::groupDefine.

Parameters:
groupName input: new group name
deviceArray input: array of devices (pv_string_t)
nDevice input : size of device array
attributeArray input: array of attributes (pv_string_t *)
nAttribute input: size of attribute array
Returns:
ICAFE_NORMAL is all OK else, ECAFE_GROUP_PREV_DEF

References deviceAttributeDeliminator, groupDefine(), and status.

int Connect::groupDefine ( const char *  groupName,
vector< const char * >  deviceV,
vector< const char * >  attributeV 
)

Connect::groupDefine.

Parameters:
groupName input: new group name
deviceV input: vector of devices (const char *)
attributeV input: vector of attributes (const char *)
Returns:
ICAFE_NORMAL is all OK else, ECAFE_GROUP_PREV_DEF

References deviceAttributeDeliminator, groupDefine(), and status.

int Connect::groupDefine ( const char *  groupName,
vector< string >  deviceV,
vector< string >  attributeV 
)

Connect::groupDefine.

Parameters:
groupName input: new group name
deviceV input: vector of devices (string)
attributeV input: vector of attributes (strig)
Returns:
ICAFE_NORMAL is all OK else, ECAFE_GROUP_PREV_DEF

References deviceAttributeDeliminator, groupDefine(), and status.

int Connect::groupDefine ( const char *  groupName,
const char *  collectionName,
pv_string_t  attribute 
) [inline]

References groupDefine().

int Connect::groupDefine ( const char *  groupName,
const char *  collectionName,
pv_string_t attributeArray,
unsigned short  attributeLength 
)

Connect::groupDefine.

Parameters:
groupName input: new group name
collectionName input: name of already existing collection
attributeArray input: array of attributes (pv_string_t *)
attributeLength input: size of input array
Returns:
ICAFE_NORMAL is all OK else, ECAFE_GROUP_PREV_DEF, ECAFE_UNKNOWN_COLLECTION, ECAFE_EMPTY_COLLECTION

References collectionFetch(), groupDefine(), and ICAFE_NORMAL.

int Connect::groupDefine ( const char *  groupName,
const char *  collectionName,
vector< const char * >  attributeV 
)

Connect::groupDefine.

Parameters:
groupName input: new group name
collectionName input: name of already existing collection
attributeV input: vector of attributes (const char *)
Returns:
ICAFE_NORMAL is all OK else, ECAFE_GROUP_PREV_DEF, ECAFE_UNKNOWN_COLLECTION, ECAFE_EMPTY_COLLECTION

References collectionFetch(), groupDefine(), and ICAFE_NORMAL.

int Connect::groupDefine ( const char *  groupName,
const char *  collectionName,
vector< string >  attributeV 
)

Connect::groupDefine.

Parameters:
groupName input: new group name
collectionName input: name of already existing collection
attributeV input: vector of attributes (string)
Returns:
ICAFE_NORMAL is all OK else, ECAFE_GROUP_PREV_DEF, ECAFE_UNKNOWN_COLLECTION, ECAFE_EMPTY_COLLECTION

References collectionFetch(), and ICAFE_NORMAL.

Referenced by groupDefine().

int Connect::groupHandleErase ( ca_client_context *  ccc  ) 

Erases groupHandle (assumes associated connections are already closed) All Groupconduit handles are erased withingt the give ca_client_context

Parameters:
ccc input: ca_client_context *
Returns:
ICAFE_NORMAL always

References cafeMutex, gs, ICAFE_NORMAL, itgs, and MUTEX.

int Connect::groupHandleErase (  ) 

Erases groupHandles All Groupconduit handles are erased

Returns:
ICAFE_NORMAL if all OK

References cafeMutex, gs, ICAFE_NORMAL, itgs, and MUTEX.

Referenced by terminate().

int Connect::groupList ( vector< string > &  glist  ) 

Connect::groupList - lists all groups in global vector PVGroupV.

Parameters:
glist output: vector of group names (string)
Returns:
ICAFE_NORMAL

References ICAFE_NORMAL, and PVGroupV.

int Connect::groupList ( boost::shared_ptr< pv_string_t[]> &  glist,
unsigned int listLength 
)

Connect::groupList - lists all groups in global vector PVGroupV
.

Parameters:
glist output: shared_ptr to array of group names (pv_string_t)
listLength,: length of glist array
Returns:
ICAFE_NORMAL

References ICAFE_NORMAL, and PVGroupV.

int Connect::groupMemberList ( const char *  groupName,
vector< string > &  list 
)

Connect::groupMemberList - lists the members of the given group.

Parameters:
groupName input: group name
list output: vector of process variables (string)
Returns:
ICAFE_NORMAL is all OK else, ECAFE_UNKNOWN_GROUP

References ECAFE_UNKNOWN_GROUP, helper, ICAFE_NORMAL, PVGroupV, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

int Connect::groupMemberList ( const char *  groupName,
boost::shared_ptr< pv_string_t[]> &  list,
unsigned int listLength 
)

Connect::groupMemberList - lists the members of the given group
User responsible for deleting list array.

Parameters:
groupName input: group name
list output: shared_ptr to array of process variables (pv_string_t)
listLength,: length of list array
Returns:
ICAFE_NORMAL is all OK else, ECAFE_UNKNOWN_GROUP

References ECAFE_UNKNOWN_GROUP, helper, ICAFE_NORMAL, PVGroupV, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

Referenced by CAFE::group2XML().

int Connect::groupOpen ( PVGroup pvgroup,
unsigned int groupHandle 
) throw (CAFEException_groupOpen)

Establishes virtual circuit to epics process variable for each group member by calling Connect::open(pv, &handle)

Parameters:
pvgroup input/output: PVGroup object
groupHandle output: (unique) group handle
Exceptions:
CAFEException re-throws CAFEException from open
Returns:
status ECA_NORMAL if OK
int Connect::groupOpen ( const char *  groupName,
unsigned int groupHandle 
) throw (CAFEException_groupOpen)

Establishes virtual circuit to epics process variable for each group member by calling Connect::open(pv, &handle).

Parameters:
groupName input: (unique) name of the group
groupHandle output: (unique) group handle
Exceptions:
CAFEException_groupOpen re-throws CAFEException from open
Returns:
status ECA_NORMAL if OK

References __METHOD__, cafeMutex, cs, DEFAULT_TIMEOUT_SG_PEND_EVENT, ECAFE_HASH_UNIQUEID_EXISTS, ECAFE_UNKNOWN_GROUP, CAFENUM::FLUSH_AFTER_EACH_GROUP_CREATION, CAFEException_groupOpen::groupEx, PVGroup::groupHandle, gs, CAFEException_pv::handle, ICAFE_NORMAL, init(), MUTEX, NMEMBER_PER_SEC_SG_PEND_EVENT, PVGroup::npv, CAFEException_pv::pv, PVHolder::pv, PVGroup::pvdata, PVGroupV, CAFEException_pv::statusCode, and CAFEException_pv::statusCodeText.

int Connect::init ( ca_preemptive_callback_select  select  )  throw (CAFEException_init)

Called once prior to making any channel access calls

Parameters:
select input: enum ca_preemptive_callback_select
{ca_disable_preemptive_callback=0, ca_enable_preemptive_callback=1}
Exceptions:
CAFEbad_allocMem ECA_ALLOCMEM if memory space could not be allocated
Returns:
status ECA_NORMAL if OK else else throws an exception

References __METHOD__, and initPyCafe().

int Connect::init (  )  throw (CAFEException_init)

Called once prior to making any channel access calls
Specifies that preemptive callback is allowed: ca_enable_preemptive_callback

Exceptions:
CAFEException_init ECA_ALLOCMEM if memory space could not be allocated
Returns:
status ECA_NORMAL if OK else throws an exception

References __METHOD__, status, and CAFEException_init::what().

Referenced by groupOpen(), and main().

bool Connect::isChannelConnected ( unsigned int  handle  )  [inline]

References cs.

Referenced by isConnected().

bool Connect::isCollection ( const char *  collectionID  ) 

Connect::isCollection - Test const char * to determine if input 'name' is a collection.

Parameters:
collectionID input: collection name
Returns:
trool or false

References deviceCollectionV, helper, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

bool Connect::isConnected ( unsigned int  handle  )  [inline]

References isChannelConnected().

bool Connect::isEnum ( unsigned int  handle  )  [inline]
bool Connect::isGroup ( const char *  groupID  ) 

Connect::isGroup - Test const char * to determine if input 'name' is a garoup.

Parameters:
groupID input: group name
Returns:
true or false

References helper, PVGroupV, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

bool Connect::isValid ( unsigned int  handle  )  [inline]

References cs, and itcs.

int Connect::monitorStart ( vector< unsigned int handleV,
vector< int > &  statusV,
vector< unsigned int > &  monitorIDV 
)

Monitor an array of PV with default MonitorPolicy object parameters.

Parameters:
handleV input: Array of handles to conduit object
statusV output: Array of statuses
monitorIDV output: Array of unique MonitorIDs
Returns:
overallStatus: ICAFE_NORMAL if all OK else the first ECAFE error encountered

References channelMonitorPolicy, CAFENUM::FLUSH_DESIGNATED_TO_CLIENT, ChannelOpenPolicy::flushSendBufferNow(), ChannelOpenPolicy::getWhenToFlushSendBuffer(), ICAFE_NORMAL, monitorStart(), and ChannelOpenPolicy::setWhenToFlushSendBuffer().

int Connect::monitorStart ( vector< unsigned int handleV,
vector< int > &  statusV,
vector< MonitorPolicy > &  mpV 
)

Monitor an array of PV with parameters set by MonitorPolicy objects.

Parameters:
handleV input: Array of handles to conduit object
statusV output: Array of statuses
mpV input/output: Array of MonitorPolicy objects
identifying the monitor subscription
Returns:
overallStatus: ICAFE_NORMAL if all OK else the first ECAFE error encountered

References __METHOD__, channelMonitorPolicy, CAFENUM::FLUSH_DESIGNATED_TO_CLIENT, ChannelOpenPolicy::flushSendBufferNow(), ChannelOpenPolicy::getWhenToFlushSendBuffer(), ICAFE_NORMAL, monitorStart(), and ChannelOpenPolicy::setWhenToFlushSendBuffer().

int Connect::monitorStart ( unsigned int handleArray,
unsigned int  nelem,
int statusArray,
unsigned int monitorIDArray 
)

Monitor an array of PV with parameters with default policies.

Parameters:
handleArray input: Array of handles to conduit object
nelem input: Number of elements in the Array
statusArray,: Array of statuses
monitorIDArray output: Array of MonitorIDs to be used by monitorStop
Returns:
overallStatus: ICAFE_NORMAL if all OK else the first ECAFE error encountered

References channelMonitorPolicy, CAFENUM::FLUSH_DESIGNATED_TO_CLIENT, ChannelOpenPolicy::flushSendBufferNow(), ChannelOpenPolicy::getWhenToFlushSendBuffer(), ICAFE_NORMAL, monitorStart(), and ChannelOpenPolicy::setWhenToFlushSendBuffer().

int Connect::monitorStart ( unsigned int handleArray,
unsigned int  nelem,
int statusArray,
MonitorPolicy mpArray 
)

Monitor an array of PV with parameters set by MonitorPolicy objects.

Parameters:
handleArray input: Array of handles to conduit object
nelem input: Number of elements in the Array
statusArray,: Array of statuses
mpArray input/output: Array of MonitorPolicy objects
identifying the monitor subscription
Returns:
overallStatus: ICAFE_NORMAL if all OK else the first ECAFE error encountered

References channelMonitorPolicy, CAFENUM::FLUSH_DESIGNATED_TO_CLIENT, ChannelOpenPolicy::flushSendBufferNow(), ChannelOpenPolicy::getWhenToFlushSendBuffer(), ICAFE_NORMAL, monitorStart(), and ChannelOpenPolicy::setWhenToFlushSendBuffer().

int Connect::monitorStart ( unsigned int handleArray,
unsigned int  nelem 
) [inline]

References monitorStart(), and status.

int Connect::monitorStart ( unsigned int  handle  )  [inline]

References monitorStart().

int Connect::monitorStart ( unsigned int  handle,
unsigned int monitorID 
)
int Connect::monitorStart ( unsigned int  handle,
MonitorPolicy mp 
)
int Connect::monitorStop ( unsigned int handleArray,
unsigned int  nelem 
) [inline]

References monitorStop(), and status.

int Connect::monitorStop ( vector< unsigned int handleV,
vector< int > &  statusV 
)

Stop all monitors for a vector of handles.

Parameters:
handleV input: vector of handles
statusV output: vector of statuses
Returns:
overallStatus: ICAFE_NORMAL if all OK else ECAFE error of first reported failure

References ICAFE_NORMAL, and monitorStop().

int Connect::monitorStop ( unsigned int handleArray,
unsigned int  nelem,
int statusArray 
)

Stop all monitors for this array of handles.

Parameters:
handleArray input: array of handle
nelem input: array of elements
statusArray output: array of statuses
Returns:
overallStatus: ICAFE_NORMAL if all OK else ECAFE error of first reported failure

References ICAFE_NORMAL, and monitorStop().

int Connect::monitorStop ( ca_client_context *  cctLocal  ) 

Stop all monitors for the given ca_client_context.

Returns:
ICAFE_NORMAL if all OK else ECAFE error

References channelClosePolicy, cs, ECAFE_NULLCONTEXT, ChannelOpenPolicy::getTimeout(), itcs, monitorStop(), and status.

int Connect::monitorStop (  ) 

Stop all monitors.

Returns:
ICAFE_NORMAL if all OK else ECAFE error

References channelClosePolicy, cs, ChannelOpenPolicy::getTimeout(), itcs, and status.

Referenced by CAFE::groupMonitorStop(), monitorStop(), monitorStopAll(), monitorStopWithID(), and terminate().

int Connect::monitorStop ( unsigned int  handle  ) 
int Connect::monitorStop ( unsigned int  handle,
unsigned int  monitorID 
)

Stop monitor of a PV.

Parameters:
handle input: handle
monitorID input: monitorID identifying the monitor subscription
Returns:
ICAFE_NORMAL if all OK else ECAFE error

References __METHOD__, cafeMutex, cafeStatus, channelMonitorPolicy, cs, ECAFE_INVALID_HANDLE, ECAFE_NULLEVID, CAFENUM::FLUSH_AFTER_EACH_CHANNEL_SUBSCRIPTION, ChannelOpenPolicy::flushSendBufferNow(), ChannelOpenPolicy::getWhenToFlushSendBuffer(), ICAFE_NORMAL, MUTEX, CAFEStatus::report(), and status.

int Connect::monitorStop ( unsigned int  handle,
MonitorPolicy  mp 
)

Stop monitor of a PV.

Parameters:
handle input: handle
mp input: MonitorPolicy identifying the monitor subscription
Returns:
ICAFE_NORMAL if all OK else ECAFE error

References MonitorPolicy::getMonitorID(), and monitorStop().

Referenced by Instant< CTYPE >::matchMany(), Instant< CTYPE >::setAndMatch(), and Instant< CTYPE >::setAndMatchMany().

int Connect::monitorStopAll (  )  [inline]

References monitorStop().

int Connect::monitorStopWithID ( unsigned int  handle,
unsigned int  monitorID 
) [inline]

References monitorStop().

int Connect::open ( vector< string >  pvV,
vector< unsigned int > &  handleV 
) throw (CAFEException_open)

Establishes virtual circuits for a vector of epics process variables

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create CAFEConduit object and add to multi-index hash table
    .

Parameters:
pvV input: vector of process variables (string)
handleV output: vector of reference handle to Conduit objects
Exceptions:
CAFEException_open if unable to create channel virtual circuit
Returns:
status ICAFE_NORMAL if OK

References CAFENUM::FLUSH_AFTER_EACH_CHANNEL_CREATION, CAFENUM::FLUSH_DESIGNATED_TO_CLIENT, and ICAFE_NORMAL.

int Connect::open ( vector< const char * >  pvV,
vector< unsigned int > &  handleV 
) throw (CAFEException_open)

Establishes virtual circuits for a vector of epics process variables

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create CAFEConduit object and add to multi-index hash table
    .

Parameters:
pvV input: vector of process variables (char *)
handleV output: vector of reference handle to Conduit objects
Exceptions:
CAFEException_open if unable to create channel virtual circuit
Returns:
status ICAFE_NORMAL if OK

References CAFENUM::FLUSH_AFTER_EACH_CHANNEL_CREATION, CAFENUM::FLUSH_DESIGNATED_TO_CLIENT, and ICAFE_NORMAL.

int Connect::open ( const char **  pvArray,
unsigned int handleArray,
const unsigned int  nHandles 
) throw (CAFEException_open)

Establishes virtual circuits for a vector of epics process variables

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create CAFEConduit object and add to multi-index hash table
    .

Parameters:
pvArray input: array of process variables (PVNAME_SIZE)
handleArray output: array of reference handle to Conduit objects
nHandles input: size of pvArray
Exceptions:
CAFEException_open if unable to create channel virtual circuit
Returns:
status ICAFE_NORMAL if OK

References CAFENUM::FLUSH_AFTER_EACH_CHANNEL_CREATION, CAFENUM::FLUSH_DESIGNATED_TO_CLIENT, and ICAFE_NORMAL.

int Connect::open ( const char *  _pv,
const char *  _pvAlias,
unsigned int handle 
) throw (CAFEException_open)

Establishes virtual circuit to epics process variable and defines its pv alias name

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create Conduit object and add to multi-index hash table
    .

Parameters:
_pv input: process variable
_pvAlias input: process variable alias
handle output: reference handle to Conduit object
Exceptions:
CAFEException_pvOpen if unable to create channel virtual circuit
Returns:
status ICAFE_NORMAL if OK
int Connect::open ( const char *  _pv,
unsigned int handle 
) throw (CAFEException_open)

Establishes virtual circuit to epics process variable

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create Conduit object and add to multi-index hash table
    .

Parameters:
_pv input: process variable
handle output: reference handle to Conduit object
Exceptions:
CAFEException_pvOpen if unable to create channel virtual circuit
Returns:
status ICAFE_NORMAL if OK

References __METHOD__, ICAFE_NORMAL, CAFEException_open::pvEx, and PVNAME_SIZE.

int Connect::open ( const string *  pvArrayS,
unsigned int handleArray,
const unsigned int  nHandles 
) throw (CAFEException_open)

Establishes virtual circuits for a vector of epics process variables

  • Check if handle already exists for given pv/ca_client_context
  • If yes, nothing further to do, else create channel
  • Determine connection status and properties of the pv
  • Create CAFEConduit object and add to multi-index hash table
    .

Parameters:
pvArrayS input: array of process variables givenas "strings"
handleArray output: array of reference handle to Conduit objects
nHandles input: size of pvArray
Exceptions:
CAFEException_open if unable to create channel virtual circuit
Returns:
status ICAFE_NORMAL if OK

References CAFENUM::FLUSH_AFTER_EACH_CHANNEL_CREATION, CAFENUM::FLUSH_DESIGNATED_TO_CLIENT, and ICAFE_NORMAL.

int Connect::open ( const string  pvS,
const std::string  pvAliasS,
unsigned int handle 
) throw (CAFEException_open) [inline]

References open().

int Connect::open ( const string  pvS,
unsigned int handle 
) throw (CAFEException_open) [inline]
void Connect::openGroupNowAndWait ( double  _timeout  )  [inline]
void Connect::openGroupPrepare (  )  [inline]
void Connect::openMonitorNow (  )  [inline]
void Connect::openMonitorNowAndWait ( double  _timeout  )  [inline]
void Connect::openMonitorPrepare (  )  [inline]
void Connect::openNow (  )  [inline]
void Connect::openNoWait (  )  [inline]
void Connect::openNowAndWait ( double  _timeout  )  [inline]
void Connect::openPrepare (  )  [inline]
int Connect::openV ( vector< string >  s,
vector< unsigned int > &  i 
) throw (CAFEException_open) [inline]

References open().

void Connect::printCAFEException_pv ( CAFEException_pv e  )  [inline]
unsigned int Connect::printDisconnectedHandles ( void   )  [inline]
unsigned int Connect::printHandle ( unsigned int  h  )  [inline]
unsigned int Connect::printHandles ( void   )  [inline]
int Connect::printStatus ( vector< unsigned int handleV,
vector< int statusV 
)

print status information of given handles

Parameters:
handleV input: vector of handles to conduit objects
statusV input: vector of statuses
Returns:
ECA_NORMAL if all OK else ECAFE_INVALID_HANDLE (if one or more handles are invalid)

References ICAFE_NORMAL, and printStatus().

int Connect::printStatus ( unsigned int handleArray,
unsigned int  nelem,
int statusArray 
)

print status information of given handles

Parameters:
handleArray input: array of handles to conduit objects
nelem input: size of array of handles
statusArray input: array of statuses
Returns:
ECA_NORMAL if all OK else ECAFE_INVALID_HANDLE (if one or more handles are invalid)

References ICAFE_NORMAL, and printStatus().

int Connect::printStatus ( unsigned int  handle,
int  status 
)

print status information of given handle

Parameters:
handle input: handle to Conduit object
status input: reporting status
Returns:
ECA_NORMAL if all OK else ECAFE_INVALID_HANDLE

References cafeStatus, cs, ECAFE_INVALID_HANDLE, ICAFE_NORMAL, and CAFEStatus::report().

Referenced by main(), printStatus(), and printStatusIfError().

int Connect::printStatusIfError ( vector< unsigned int handleV,
vector< int statusV 
)

print status information of given handles only on error

Parameters:
handleV input: vector of Handles to Conduit objects
statusV input: vector of statuses
Returns:
ECA_NORMAL if all OK else ECAFE_INVALID_HANDLE (if one or more handles are invalid)

References ICAFE_NORMAL, and printStatus().

int Connect::printStatusIfError ( unsigned int handleArray,
unsigned int  nelem,
int statusArray 
)

print status information of given handles only on error

Parameters:
handleArray input: array of Handles to Conduit objects
nelem input: size of array of handles
statusArray input: array of statuses
Returns:
ECA_NORMAL if all OK else ECAFE_INVALID_HANDLE (if one or more handles are invalid)

References ICAFE_NORMAL, and printStatus().

int Connect::printStatusIfError ( unsigned int  handle,
int  status 
)

print status information of given handle only on error

Parameters:
handle input: handle to Conduit object
status input: reporting status
Returns:
ECA_NORMAL if all OK else ECAFE_INVALID_HANDLE

References ICAFE_NORMAL, and printStatus().

void Connect::printStatusMessage ( int  status  )  [inline]
void Connect::setDeviceAttributeDeliminator ( std::string  d  )  [inline]
double Connect::setOpenDefaultPendTime ( double  _timeout  )  [inline]
int Connect::setPVAlias ( unsigned int  handle,
const char *  _pvAlias 
) throw (CAFEException_open)

Defines a pv alias for pv and adds this to multi-index hash table.

Parameters:
handle input: handle
_pvAlias input: process variable alias
Exceptions:
CAFEException_pvOopen if unable to set an alias
Returns:
status ICAFE_NORMAL if OK

References __METHOD__, cafeMutex, cs, ECAFE_INVALID_HANDLE, ECAFE_PVALIAS_INVALID, ECAFE_PVALIAS_PREV_DEF, ICAFE_NORMAL, MUTEX, CAFEException_open::pvEx, PVNAME_SIZE, and Helper::removeLeadingAndTrailingSpaces().

bool Connect::setPyCafe ( bool  b  )  [inline]

References pyCafeFlag.

int Connect::terminate ( ca_client_context *  cctLocal  ) 

Closes all channels within the given context and their respective handles
Shuts down the given channel access client context and frees allocated resources
contextDestroy is not essential as resources are normally automatically released by the system.

Returns:
ECA_NORMAL if all OK or ECAFE_NULLCONTEXT if ca client context does not exist

References cafeStatus, closeChannels(), contextDestroy(), ECAFE_NULLCONTEXT, groupHandleErase(), ICAFE_NORMAL, monitorStop(), and CAFEStatus::report().

int Connect::terminate (  ) 

Closes all channels within a given context and all handles for all contexts
Shuts down the local channel access client context and frees allocated resources
contextDestroy is not essential as resources are normally automatically released by the system.

Returns:
ECA_NORMAL if all OK or ECAFE_NULLCONTEXT if ca client context does not exist

References cafeStatus, closeHandles(), contextDestroy(), deviceCollectionV, ECAFE_NULLCONTEXT, globalChannelList, groupHandleErase(), ConduitGroup::groupHandleNext, groupPseudoMap, Conduit::handleNext, ICAFE_NORMAL, MonitorPolicy::idNext, monitorStop(), PVGroupPseudo, PVGroupV, and CAFEStatus::report().

Referenced by main().

int Connect::updateAccessRead ( unsigned int  handle,
int  ar 
) [inline]
int Connect::updateAccessWrite ( unsigned int  handle,
int  aw 
) [inline]

Member Data Documentation

Referenced by getCafeStatusSeverity().

std::string Connect::deviceAttributeDeliminator [protected]

Referenced by printCAFEException_pv().

Helper Connect::helper [protected]
cafeConduit_set::iterator Connect::itcs [protected]
cafeGroup_set::iterator Connect::itgs [protected]

Referenced by groupHandleErase().

bool Connect::pyCafeFlag [protected]

Referenced by Connect(), getPyCafe(), and setPyCafe().

int Connect::status [protected]

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

Generated on 3 May 2017 for CAFE by  doxygen 1.6.1