This is Unofficial EPICS BASE Doxygen Site
oldChannelNotify Struct Reference

#include "oldAccess.h"

+ Inheritance diagram for oldChannelNotify:
+ Collaboration diagram for oldChannelNotify:

Public Member Functions

 oldChannelNotify (epicsGuard< epicsMutex > &, struct ca_client_context &, const char *pName, caCh *pConnCallBackIn, void *pPrivateIn, capri priority)
 
void destructor (CallbackGuard &cbGuard, epicsGuard< epicsMutex > &mutexGuard)
 
unsigned getName (epicsGuard< epicsMutex > &, char *pBuf, unsigned bufLen) const throw ()
 
void show (epicsGuard< epicsMutex > &, unsigned level) const
 
void initiateConnect (epicsGuard< epicsMutex > &)
 
void read (epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, cacReadNotify &notify, cacChannel::ioid *pId=0)
 
void write (epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pValue, cacWriteNotify &, cacChannel::ioid *pId=0)
 
void ioCancel (CallbackGuard &callbackGuard, epicsGuard< epicsMutex > &mutualExclusionGuard, const cacChannel::ioid &)
 
void ioShow (epicsGuard< epicsMutex > &guard, const cacChannel::ioid &, unsigned level) const
 
ca_client_contextgetClientCtx ()
 
void eliminateExcessiveSendBacklog (epicsGuard< epicsMutex > &)
 
void * operator new (size_t size, tsFreeList< struct oldChannelNotify, 1024, epicsMutexNOOP > &)
 

Friends

unsigned epicsStdCall ca_get_host_name (chid pChan, char *pBuf, unsigned bufLength)
 
const char *epicsStdCall ca_host_name (chid pChan)
 
const char *epicsStdCall ca_name (chid pChan)
 
void epicsStdCall ca_set_puser (chid pChan, void *puser)
 
void *epicsStdCall ca_puser (chid pChan)
 
int epicsStdCall ca_change_connection_event (chid pChan, caCh *pfunc)
 
int epicsStdCall ca_replace_access_rights_event (chid pChan, caArh *pfunc)
 
int epicsStdCall ca_array_get (chtype type, arrayElementCount count, chid pChan, void *pValue)
 
int epicsStdCall ca_array_get_callback (chtype type, arrayElementCount count, chid pChan, caEventCallBackFunc *pfunc, void *arg)
 
int epicsStdCall ca_array_put (chtype type, arrayElementCount count, chid pChan, const void *pValue)
 
int epicsStdCall ca_array_put_callback (chtype type, arrayElementCount count, chid pChan, const void *pValue, caEventCallBackFunc *pfunc, void *usrarg)
 
double epicsStdCall ca_beacon_period (chid pChan)
 
unsigned epicsStdCall ca_search_attempts (chid pChan)
 
unsigned epicsStdCall ca_write_access (chid pChan)
 
unsigned epicsStdCall ca_read_access (chid pChan)
 
short epicsStdCall ca_field_type (chid pChan)
 
arrayElementCount epicsStdCall ca_element_count (chid pChan)
 
int epicsStdCall ca_v42_ok (chid pChan)
 
int epicsStdCall ca_create_subscription (chtype type, arrayElementCount count, chid pChan, long mask, caEventCallBackFunc *pCallBack, void *pCallBackArg, evid *monixptr)
 
enum channel_state epicsStdCall ca_state (chid pChan)
 
double epicsStdCall ca_receive_watchdog_delay (chid pChan)
 

Detailed Description

Definition at line 40 of file oldAccess.h.

Constructor & Destructor Documentation

oldChannelNotify::oldChannelNotify ( epicsGuard< epicsMutex > &  guard,
struct ca_client_context cacIn,
const char *  pName,
caCh pConnCallBackIn,
void *  pPrivateIn,
capri  priority 
)

Definition at line 44 of file oldChannelNotify.cpp.

47  :
48  cacCtx ( cacIn ),
49  io ( cacIn.createChannel ( guard, pName, *this, priority ) ),
50  pConnCallBack ( pConnCallBackIn ),
51  pPrivate ( pPrivateIn ), pAccessRightsFunc ( cacNoopAccesRightsHandler ),
52  ioSeqNo ( 0 ), currentlyConnected ( false ), prevConnected ( false )
53 {
54  guard.assertIdenticalMutex ( cacIn.mutexRef () );
55  this->ioSeqNo = cacIn.sequenceNumberOfOutstandingIO ( guard );
56  if ( pConnCallBackIn == 0 ) {
57  cacIn.incrementOutstandingIO ( guard, this->ioSeqNo );
58  }
59 }
void cacNoopAccesRightsHandler(struct access_rights_handler_args)
void incrementOutstandingIO(epicsGuard< epicsMutex > &, unsigned ioSeqNo)
void assertIdenticalMutex(const T &) const
Definition: epicsGuard.h:80
epicsMutex & mutexRef() const
unsigned sequenceNumberOfOutstandingIO(epicsGuard< epicsMutex > &) const
Definition: oldAccess.h:566
cacChannel & createChannel(epicsGuard< epicsMutex > &, const char *pChannelName, cacChannelNotify &, cacChannel::priLev pri)

Member Function Documentation

void oldChannelNotify::destructor ( CallbackGuard cbGuard,
epicsGuard< epicsMutex > &  mutexGuard 
)

Definition at line 65 of file oldChannelNotify.cpp.

68 {
69  mutexGuard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
70  this->io.destroy ( cbGuard, mutexGuard );
71  // no need to worry about a connect preempting here because
72  // the io (the nciu) has been destroyed above
73  if ( this->pConnCallBack == 0 && ! this->currentlyConnected ) {
74  this->cacCtx.decrementOutstandingIO ( mutexGuard, this->ioSeqNo );
75  }
76  this->~oldChannelNotify ();
77 }
void assertIdenticalMutex(const T &) const
Definition: epicsGuard.h:80
epicsMutex & mutexRef() const
virtual void destroy(CallbackGuard &callbackGuard, epicsGuard< epicsMutex > &mutualExclusionGuard)=0
void decrementOutstandingIO(epicsGuard< epicsMutex > &, unsigned ioSeqNo)
void oldChannelNotify::eliminateExcessiveSendBacklog ( epicsGuard< epicsMutex > &  guard)
inline

Definition at line 468 of file oldAccess.h.

470 {
471  this->cacCtx.eliminateExcessiveSendBacklog ( guard, this->io );
472 }
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &, cacChannel &)
ca_client_context & oldChannelNotify::getClientCtx ( )
inline

Definition at line 428 of file oldAccess.h.

429 {
430  return this->cacCtx;
431 }
unsigned oldChannelNotify::getName ( epicsGuard< epicsMutex > &  guard,
char *  pBuf,
unsigned  bufLen 
) const
throw (
)
inline

Definition at line 433 of file oldAccess.h.

436 {
437  return this->io.getName ( guard, pBuf, bufLen );
438 }
virtual unsigned getName(epicsGuard< epicsMutex > &, char *pBuf, unsigned bufLen) const =0
void oldChannelNotify::initiateConnect ( epicsGuard< epicsMutex > &  guard)
inline

Definition at line 447 of file oldAccess.h.

449 {
450  this->io.initiateConnect ( guard );
451 }
virtual void initiateConnect(epicsGuard< epicsMutex > &)=0
void oldChannelNotify::ioCancel ( CallbackGuard callbackGuard,
epicsGuard< epicsMutex > &  mutualExclusionGuard,
const cacChannel::ioid id 
)
inline

Definition at line 453 of file oldAccess.h.

457 {
458  this->io.ioCancel ( callbackGuard, mutualExclusionGuard, id );
459 }
virtual void ioCancel(CallbackGuard &callbackGuard, epicsGuard< epicsMutex > &mutualExclusionGuard, const ioid &)=0
void oldChannelNotify::ioShow ( epicsGuard< epicsMutex > &  guard,
const cacChannel::ioid id,
unsigned  level 
) const
inline

Definition at line 461 of file oldAccess.h.

464 {
465  this->io.ioShow ( guard, id, level );
466 }
virtual void ioShow(epicsGuard< epicsMutex > &, const ioid &, unsigned level) const =0
void * oldChannelNotify::operator new ( size_t  size,
tsFreeList< struct oldChannelNotify, 1024, epicsMutexNOOP > &  freeList 
)
inline

Definition at line 474 of file oldAccess.h.

476 {
477  return freeList.allocate ( size );
478 }
void * allocate(size_t size)
Definition: tsFreeList.h:126
void oldChannelNotify::read ( epicsGuard< epicsMutex > &  guard,
unsigned  type,
arrayElementCount  count,
cacReadNotify notify,
cacChannel::ioid pId = 0 
)

Definition at line 401 of file oldChannelNotify.cpp.

405 {
406  this->io.read ( guard, type, count, notify, pId );
407 }
pvd::StructureConstPtr type
virtual ioStatus read(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, cacReadNotify &, ioid *=0)=0
void oldChannelNotify::show ( epicsGuard< epicsMutex > &  guard,
unsigned  level 
) const
inline

Definition at line 440 of file oldAccess.h.

443 {
444  this->io.show ( guard, level );
445 }
virtual void show(epicsGuard< epicsMutex > &, unsigned level) const =0
void oldChannelNotify::write ( epicsGuard< epicsMutex > &  guard,
unsigned  type,
arrayElementCount  count,
const void *  pValue,
cacWriteNotify notify,
cacChannel::ioid pId = 0 
)

Definition at line 611 of file oldChannelNotify.cpp.

614 {
615  this->io.write ( guard, type, count, pValue, notify, pId );
616 }
pvd::StructureConstPtr type
virtual void write(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pValue)=0

Friends And Related Function Documentation

int epicsStdCall ca_array_get ( chtype  type,
arrayElementCount  count,
chid  pChan,
void *  pValue 
)
friend

Definition at line 267 of file oldChannelNotify.cpp.

269 {
270  int caStatus;
271  try {
272  if ( type < 0 ) {
273  return ECA_BADTYPE;
274  }
275  if ( count == 0 )
276  return ECA_BADCOUNT;
277 
278  unsigned tmpType = static_cast < unsigned > ( type );
279  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
280  pChan->eliminateExcessiveSendBacklog ( guard );
282  ( pChan->getClientCtx().getCopyFreeList,
283  new ( pChan->getClientCtx().getCopyFreeList )
284  getCopy ( guard, pChan->getClientCtx(), *pChan,
285  tmpType, count, pValue ) );
286  pChan->io.read ( guard, type, count, *pNotify, 0 );
287  pNotify.release ();
288  caStatus = ECA_NORMAL;
289  }
290  catch ( cacChannel::badString & )
291  {
292  caStatus = ECA_BADSTR;
293  }
294  catch ( cacChannel::badType & )
295  {
296  caStatus = ECA_BADTYPE;
297  }
298  catch ( cacChannel::outOfBounds & )
299  {
300  caStatus = ECA_BADCOUNT;
301  }
302  catch ( cacChannel::noReadAccess & )
303  {
304  caStatus = ECA_NORDACCESS;
305  }
306  catch ( cacChannel::notConnected & )
307  {
308  caStatus = ECA_DISCONN;
309  }
311  {
312  caStatus = ECA_UNAVAILINSERV;
313  }
314  catch ( cacChannel::requestTimedOut & )
315  {
316  caStatus = ECA_TIMEOUT;
317  }
318  catch ( std::bad_alloc & )
319  {
320  caStatus = ECA_ALLOCMEM;
321  }
323  caStatus = ECA_TOLARGE;
324  }
325  catch ( ... )
326  {
327  caStatus = ECA_GETFAIL;
328  }
329  return caStatus;
330 }
#define ECA_GETFAIL
Definition: caerr.h:96
ca_client_context & getClientCtx()
Definition: oldAccess.h:428
pvd::StructureConstPtr type
#define ECA_BADCOUNT
Definition: caerr.h:99
epicsMutex & mutexRef() const
#define ECA_DISCONN
Definition: caerr.h:101
virtual ioStatus read(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, cacReadNotify &, ioid *=0)=0
#define ECA_NORMAL
Definition: caerr.h:77
#define ECA_TOLARGE
Definition: caerr.h:86
#define ECA_NORDACCESS
Definition: caerr.h:123
#define ECA_BADSTR
Definition: caerr.h:100
#define ECA_TIMEOUT
Definition: caerr.h:87
#define ECA_BADTYPE
Definition: caerr.h:91
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &)
Definition: oldAccess.h:468
#define ECA_UNAVAILINSERV
Definition: caerr.h:131
#define ECA_ALLOCMEM
Definition: caerr.h:83
int epicsStdCall ca_array_get_callback ( chtype  type,
arrayElementCount  count,
chid  pChan,
caEventCallBackFunc pfunc,
void *  arg 
)
friend

Definition at line 335 of file oldChannelNotify.cpp.

338 {
339  int caStatus;
340  try {
341  if ( type < 0 ) {
342  return ECA_BADTYPE;
343  }
344  if ( pfunc == NULL ) {
345  return ECA_BADFUNCPTR;
346  }
347  unsigned tmpType = static_cast < unsigned > ( type );
348 
349  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
350  pChan->eliminateExcessiveSendBacklog ( guard );
352  ( pChan->getClientCtx().getCallbackFreeList,
353  new ( pChan->getClientCtx().getCallbackFreeList )
354  getCallback ( *pChan, pfunc, arg ) );
355  pChan->io.read ( guard, tmpType, count, *pNotify, 0 );
356  pNotify.release ();
357  caStatus = ECA_NORMAL;
358  }
359  catch ( cacChannel::badString & )
360  {
361  caStatus = ECA_BADSTR;
362  }
363  catch ( cacChannel::badType & )
364  {
365  caStatus = ECA_BADTYPE;
366  }
367  catch ( cacChannel::outOfBounds & )
368  {
369  caStatus = ECA_BADCOUNT;
370  }
371  catch ( cacChannel::noReadAccess & )
372  {
373  caStatus = ECA_NORDACCESS;
374  }
375  catch ( cacChannel::notConnected & )
376  {
377  caStatus = ECA_DISCONN;
378  }
380  {
381  caStatus = ECA_UNAVAILINSERV;
382  }
383  catch ( cacChannel::requestTimedOut & )
384  {
385  caStatus = ECA_TIMEOUT;
386  }
387  catch ( std::bad_alloc & )
388  {
389  caStatus = ECA_ALLOCMEM;
390  }
392  caStatus = ECA_TOLARGE;
393  }
394  catch ( ... )
395  {
396  caStatus = ECA_GETFAIL;
397  }
398  return caStatus;
399 }
#define ECA_BADFUNCPTR
Definition: caerr.h:129
#define ECA_GETFAIL
Definition: caerr.h:96
ca_client_context & getClientCtx()
Definition: oldAccess.h:428
pvd::StructureConstPtr type
#define ECA_BADCOUNT
Definition: caerr.h:99
#define NULL
Definition: catime.c:38
epicsMutex & mutexRef() const
#define ECA_DISCONN
Definition: caerr.h:101
virtual ioStatus read(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, cacReadNotify &, ioid *=0)=0
#define ECA_NORMAL
Definition: caerr.h:77
#define ECA_TOLARGE
Definition: caerr.h:86
#define ECA_NORDACCESS
Definition: caerr.h:123
#define ECA_BADSTR
Definition: caerr.h:100
#define ECA_TIMEOUT
Definition: caerr.h:87
#define ECA_BADTYPE
Definition: caerr.h:91
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &)
Definition: oldAccess.h:468
#define ECA_UNAVAILINSERV
Definition: caerr.h:131
#define ECA_ALLOCMEM
Definition: caerr.h:83
int epicsStdCall ca_array_put ( chtype  type,
arrayElementCount  count,
chid  pChan,
const void *  pValue 
)
friend

Definition at line 476 of file oldChannelNotify.cpp.

478 {
479  if ( type < 0 ) {
480  return ECA_BADTYPE;
481  }
482  unsigned tmpType = static_cast < unsigned > ( type );
483 
484  int caStatus;
485  try {
486  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
487  pChan->eliminateExcessiveSendBacklog ( guard );
488  pChan->io.write ( guard, tmpType, count, pValue );
489  caStatus = ECA_NORMAL;
490  }
491  catch ( cacChannel::badString & )
492  {
493  caStatus = ECA_BADSTR;
494  }
495  catch ( cacChannel::badType & )
496  {
497  caStatus = ECA_BADTYPE;
498  }
499  catch ( cacChannel::outOfBounds & )
500  {
501  caStatus = ECA_BADCOUNT;
502  }
503  catch ( cacChannel::noWriteAccess & )
504  {
505  caStatus = ECA_NOWTACCESS;
506  }
507  catch ( cacChannel::notConnected & )
508  {
509  caStatus = ECA_DISCONN;
510  }
512  {
513  caStatus = ECA_UNAVAILINSERV;
514  }
515  catch ( cacChannel::requestTimedOut & )
516  {
517  caStatus = ECA_TIMEOUT;
518  }
519  catch ( std::bad_alloc & )
520  {
521  caStatus = ECA_ALLOCMEM;
522  }
523  catch ( ... )
524  {
525  caStatus = ECA_PUTFAIL;
526  }
527  return caStatus;
528 }
#define ECA_PUTFAIL
Definition: caerr.h:97
pvd::StructureConstPtr type
#define ECA_BADCOUNT
Definition: caerr.h:99
epicsMutex & mutexRef() const
#define ECA_DISCONN
Definition: caerr.h:101
#define ECA_NORMAL
Definition: caerr.h:77
virtual void write(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pValue)=0
#define ECA_NOWTACCESS
Definition: caerr.h:124
#define ECA_BADSTR
Definition: caerr.h:100
#define ECA_TIMEOUT
Definition: caerr.h:87
#define ECA_BADTYPE
Definition: caerr.h:91
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &)
Definition: oldAccess.h:468
#define ECA_UNAVAILINSERV
Definition: caerr.h:131
#define ECA_ALLOCMEM
Definition: caerr.h:83
int epicsStdCall ca_array_put_callback ( chtype  type,
arrayElementCount  count,
chid  pChan,
const void *  pValue,
caEventCallBackFunc pfunc,
void *  usrarg 
)
friend

Definition at line 412 of file oldChannelNotify.cpp.

414 {
415  int caStatus;
416  try {
417  if ( type < 0 ) {
418  return ECA_BADTYPE;
419  }
420  if ( pfunc == NULL ) {
421  return ECA_BADFUNCPTR;
422  }
423  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
424  pChan->eliminateExcessiveSendBacklog ( guard );
425  unsigned tmpType = static_cast < unsigned > ( type );
427  ( pChan->getClientCtx().putCallbackFreeList,
428  new ( pChan->getClientCtx().putCallbackFreeList )
429  putCallback ( *pChan, pfunc, usrarg ) );
430  pChan->io.write ( guard, tmpType, count, pValue, *pNotify, 0 );
431  pNotify.release ();
432  caStatus = ECA_NORMAL;
433  }
434  catch ( cacChannel::badString & )
435  {
436  caStatus = ECA_BADSTR;
437  }
438  catch ( cacChannel::badType & )
439  {
440  caStatus = ECA_BADTYPE;
441  }
442  catch ( cacChannel::outOfBounds & )
443  {
444  caStatus = ECA_BADCOUNT;
445  }
446  catch ( cacChannel::noWriteAccess & )
447  {
448  caStatus = ECA_NOWTACCESS;
449  }
450  catch ( cacChannel::notConnected & )
451  {
452  caStatus = ECA_DISCONN;
453  }
455  {
456  caStatus = ECA_UNAVAILINSERV;
457  }
458  catch ( cacChannel::requestTimedOut & )
459  {
460  caStatus = ECA_TIMEOUT;
461  }
462  catch ( std::bad_alloc & )
463  {
464  caStatus = ECA_ALLOCMEM;
465  }
466  catch ( ... )
467  {
468  caStatus = ECA_PUTFAIL;
469  }
470  return caStatus;
471 }
#define ECA_BADFUNCPTR
Definition: caerr.h:129
ca_client_context & getClientCtx()
Definition: oldAccess.h:428
#define ECA_PUTFAIL
Definition: caerr.h:97
pvd::StructureConstPtr type
#define ECA_BADCOUNT
Definition: caerr.h:99
#define NULL
Definition: catime.c:38
epicsMutex & mutexRef() const
#define ECA_DISCONN
Definition: caerr.h:101
#define ECA_NORMAL
Definition: caerr.h:77
virtual void write(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pValue)=0
#define ECA_NOWTACCESS
Definition: caerr.h:124
#define ECA_BADSTR
Definition: caerr.h:100
#define ECA_TIMEOUT
Definition: caerr.h:87
#define ECA_BADTYPE
Definition: caerr.h:91
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &)
Definition: oldAccess.h:468
#define ECA_UNAVAILINSERV
Definition: caerr.h:131
#define ECA_ALLOCMEM
Definition: caerr.h:83
double epicsStdCall ca_beacon_period ( chid  pChan)
friend

Definition at line 686 of file oldChannelNotify.cpp.

687 {
688  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
689  return pChan->io.beaconPeriod ( guard );
690 }
virtual double beaconPeriod(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:69
epicsMutex & mutexRef() const
int epicsStdCall ca_change_connection_event ( chid  pChan,
caCh pfunc 
)
friend

Definition at line 218 of file oldChannelNotify.cpp.

219 {
220  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
221  if ( ! pChan->currentlyConnected ) {
222  if ( pfunc ) {
223  if ( ! pChan->pConnCallBack ) {
224  pChan->cacCtx.decrementOutstandingIO ( guard, pChan->ioSeqNo );
225  }
226  }
227  else {
228  if ( pChan->pConnCallBack ) {
229  pChan->cacCtx.incrementOutstandingIO ( guard, pChan->ioSeqNo );
230  }
231  }
232  }
233  pChan->pConnCallBack = pfunc;
234  return ECA_NORMAL;
235 }
void incrementOutstandingIO(epicsGuard< epicsMutex > &, unsigned ioSeqNo)
epicsMutex & mutexRef() const
#define ECA_NORMAL
Definition: caerr.h:77
void decrementOutstandingIO(epicsGuard< epicsMutex > &, unsigned ioSeqNo)
int epicsStdCall ca_create_subscription ( chtype  type,
arrayElementCount  count,
chid  pChan,
long  mask,
caEventCallBackFunc pCallBack,
void *  pCallBackArg,
evid monixptr 
)
friend

Definition at line 530 of file oldChannelNotify.cpp.

534 {
535  if ( type < 0 ) {
536  return ECA_BADTYPE;
537  }
538  unsigned tmpType = static_cast < unsigned > ( type );
539 
540  if ( INVALID_DB_REQ (type) ) {
541  return ECA_BADTYPE;
542  }
543 
544  if ( pCallBack == NULL ) {
545  return ECA_BADFUNCPTR;
546  }
547 
548  static const long maskMask = 0xffff;
549  if ( ( mask & maskMask ) == 0) {
550  return ECA_BADMASK;
551  }
552 
553  if ( mask & ~maskMask ) {
554  return ECA_BADMASK;
555  }
556 
557  try {
558  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
559  try {
560  // if this stalls out on a live circuit then an exception
561  // can be forthcoming which we must ignore (this is a
562  // special case preserving legacy ca_create_subscription
563  // behavior)
564  pChan->eliminateExcessiveSendBacklog ( guard );
565  }
566  catch ( cacChannel::notConnected & ) {
567  // intentionally ignored (its ok to subscribe when not connected)
568  }
569  new ( pChan->getClientCtx().subscriptionFreeList )
571  guard, *pChan, pChan->io, tmpType, count, mask,
572  pCallBack, pCallBackArg, monixptr );
573  // dont touch object created after above new because
574  // the first callback might have canceled, and therefore
575  // destroyed, it
576  return ECA_NORMAL;
577  }
578  catch ( cacChannel::badType & )
579  {
580  return ECA_BADTYPE;
581  }
582  catch ( cacChannel::outOfBounds & )
583  {
584  return ECA_BADCOUNT;
585  }
587  {
588  return ECA_BADMASK;
589  }
590  catch ( cacChannel::noReadAccess & )
591  {
592  return ECA_NORDACCESS;
593  }
595  {
596  return ECA_UNAVAILINSERV;
597  }
598  catch ( std::bad_alloc & )
599  {
600  return ECA_ALLOCMEM;
601  }
603  return ECA_TOLARGE;
604  }
605  catch ( ... )
606  {
607  return ECA_INTERNAL;
608  }
609 }
#define ECA_BADFUNCPTR
Definition: caerr.h:129
#define ECA_INTERNAL
Definition: caerr.h:94
ca_client_context & getClientCtx()
Definition: oldAccess.h:428
pvd::StructureConstPtr type
#define ECA_BADCOUNT
Definition: caerr.h:99
#define INVALID_DB_REQ(x)
Definition: db_access.h:115
#define NULL
Definition: catime.c:38
epicsMutex & mutexRef() const
#define ECA_NORMAL
Definition: caerr.h:77
#define ECA_TOLARGE
Definition: caerr.h:86
#define ECA_NORDACCESS
Definition: caerr.h:123
#define ECA_BADMASK
Definition: caerr.h:118
#define ECA_BADTYPE
Definition: caerr.h:91
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &)
Definition: oldAccess.h:468
#define ECA_UNAVAILINSERV
Definition: caerr.h:131
#define ECA_ALLOCMEM
Definition: caerr.h:83
arrayElementCount epicsStdCall ca_element_count ( chid  pChan)
friend

Definition at line 630 of file oldChannelNotify.cpp.

631 {
632  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
633  return pChan->io.nativeElementCount ( guard );
634 }
epicsMutex & mutexRef() const
virtual arrayElementCount nativeElementCount(epicsGuard< epicsMutex > &) const =0
short epicsStdCall ca_field_type ( chid  pChan)
friend

Definition at line 621 of file oldChannelNotify.cpp.

622 {
623  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
624  return pChan->io.nativeType ( guard );
625 }
epicsMutex & mutexRef() const
virtual short nativeType(epicsGuard< epicsMutex > &) const =0
unsigned epicsStdCall ca_get_host_name ( chid  pChan,
char *  pBuf,
unsigned  bufLength 
)
friend

Definition at line 175 of file oldChannelNotify.cpp.

177 {
178  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef() );
179  return pChan->io.getHostName ( guard, pBuf, bufLength );
180 }
epicsMutex & mutexRef() const
virtual unsigned getHostName(epicsGuard< epicsMutex > &, char *pBuf, unsigned bufLength) const
Definition: cacChannel.cpp:120
const char* epicsStdCall ca_host_name ( chid  pChan)
friend

Definition at line 188 of file oldChannelNotify.cpp.

190 {
191  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
192  return pChan->io.pHostName ( guard );
193 }
epicsMutex & mutexRef() const
virtual const char * pHostName(epicsGuard< epicsMutex > &guard) const
Definition: cacChannel.cpp:132
const char* epicsStdCall ca_name ( chid  pChan)
friend

Definition at line 674 of file oldChannelNotify.cpp.

675 {
676  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
677  return pChan->io.pName ( guard );
678 }
virtual const char * pName(epicsGuard< epicsMutex > &guard) const =0
epicsMutex & mutexRef() const
void* epicsStdCall ca_puser ( chid  pChan)
friend

Definition at line 208 of file oldChannelNotify.cpp.

210 {
211  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
212  return pChan->pPrivate;
213 }
epicsMutex & mutexRef() const
unsigned epicsStdCall ca_read_access ( chid  pChan)
friend

Definition at line 656 of file oldChannelNotify.cpp.

657 {
658  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
659  return pChan->io.accessRights(guard).readPermit();
660 }
epicsMutex & mutexRef() const
virtual caAccessRights accessRights(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:56
bool readPermit() const
Definition: cacIO.h:368
double epicsStdCall ca_receive_watchdog_delay ( chid  pChan)
friend

Definition at line 692 of file oldChannelNotify.cpp.

693 {
694  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
695  return pChan->io.receiveWatchdogDelay ( guard );
696 }
virtual double receiveWatchdogDelay(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:75
epicsMutex & mutexRef() const
int epicsStdCall ca_replace_access_rights_event ( chid  pChan,
caArh pfunc 
)
friend

Definition at line 240 of file oldChannelNotify.cpp.

242 {
243  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
244 
245  // The order of the following is significant to guarantee that the
246  // access rights handler is always gets called even if the channel connects
247  // while this is running. There is some very small chance that the
248  // handler could be called twice here with the same access rights state, but
249  // that will not upset the application.
250  pChan->pAccessRightsFunc = pfunc ? pfunc : cacNoopAccesRightsHandler;
251  caAccessRights tmp = pChan->io.accessRights ( guard );
252 
253  if ( pChan->currentlyConnected ) {
254  struct access_rights_handler_args args;
255  args.chid = pChan;
256  args.ar.read_access = tmp.readPermit ();
257  args.ar.write_access = tmp.writePermit ();
258  epicsGuardRelease < epicsMutex > unguard ( guard );
259  ( *pChan->pAccessRightsFunc ) ( args );
260  }
261  return ECA_NORMAL;
262 }
void cacNoopAccesRightsHandler(struct access_rights_handler_args)
bool writePermit() const
Definition: cacIO.h:373
epicsMutex & mutexRef() const
#define ECA_NORMAL
Definition: caerr.h:77
virtual caAccessRights accessRights(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:56
bool readPermit() const
Definition: cacIO.h:368
unsigned epicsStdCall ca_search_attempts ( chid  pChan)
friend

Definition at line 680 of file oldChannelNotify.cpp.

681 {
682  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
683  return pChan->io.searchAttempts ( guard );
684 }
epicsMutex & mutexRef() const
virtual unsigned searchAttempts(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:63
void epicsStdCall ca_set_puser ( chid  pChan,
void *  puser 
)
friend

Definition at line 198 of file oldChannelNotify.cpp.

200 {
201  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
202  pChan->pPrivate = puser;
203 }
epicsMutex & mutexRef() const
enum channel_state epicsStdCall ca_state ( chid  pChan)
friend

Definition at line 639 of file oldChannelNotify.cpp.

640 {
641  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
642  if ( pChan->io.connected ( guard ) ) {
643  return cs_conn;
644  }
645  else if ( pChan->prevConnected ){
646  return cs_prev_conn;
647  }
648  else {
649  return cs_never_conn;
650  }
651 }
epicsMutex & mutexRef() const
Definition: cadef.h:166
virtual bool connected(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:87
int epicsStdCall ca_v42_ok ( chid  pChan)
friend

Definition at line 701 of file oldChannelNotify.cpp.

702 {
703  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
704  return pChan->io.ca_v42_ok ( guard );
705 }
epicsMutex & mutexRef() const
virtual bool ca_v42_ok(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:81
unsigned epicsStdCall ca_write_access ( chid  pChan)
friend

Definition at line 665 of file oldChannelNotify.cpp.

666 {
667  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
668  return pChan->io.accessRights(guard).writePermit();
669 }
bool writePermit() const
Definition: cacIO.h:373
epicsMutex & mutexRef() const
virtual caAccessRights accessRights(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:56

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