This is Unofficial EPICS BASE Doxygen Site
oldChannelNotify.cpp
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 /*
10  *
11  *
12  * L O S A L A M O S
13  * Los Alamos National Laboratory
14  * Los Alamos, New Mexico 87545
15  *
16  * Copyright, 1986, The Regents of the University of California.
17  *
18  *
19  * Author Jeffrey O. Hill
20  * johill@lanl.gov
21  * 505 665 1831
22  */
23 
24 #include <string>
25 #include <stdexcept>
26 
27 #ifdef _MSC_VER
28 # pragma warning(disable:4355)
29 #endif
30 
31 #define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
32 
33 #include "errlog.h"
34 
35 #include "iocinf.h"
36 #include "oldAccess.h"
37 #include "cac.h"
38 #include "autoPtrFreeList.h"
39 
41 {
42 }
43 
46  const char *pName, caCh * pConnCallBackIn,
47  void * pPrivateIn, capri priority ) :
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 }
60 
61 oldChannelNotify::~oldChannelNotify ()
62 {
63 }
64 
66  CallbackGuard & cbGuard,
67  epicsGuard < epicsMutex > & mutexGuard )
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 }
78 
79 void oldChannelNotify::connectNotify (
81 {
82  this->currentlyConnected = true;
83  this->prevConnected = true;
84  if ( this->pConnCallBack ) {
85  struct connection_handler_args args;
86  args.chid = this;
87  args.op = CA_OP_CONN_UP;
88  caCh * pFunc = this->pConnCallBack;
89  {
90  epicsGuardRelease < epicsMutex > unguard ( guard );
91  ( *pFunc ) ( args );
92  }
93  }
94  else {
95  this->cacCtx.decrementOutstandingIO ( guard, this->ioSeqNo );
96  }
97 }
98 
99 void oldChannelNotify::disconnectNotify (
100  epicsGuard < epicsMutex > & guard )
101 {
102  this->currentlyConnected = false;
103  if ( this->pConnCallBack ) {
104  struct connection_handler_args args;
105  args.chid = this;
106  args.op = CA_OP_CONN_DOWN;
107  caCh * pFunc = this->pConnCallBack;
108  {
109  epicsGuardRelease < epicsMutex > unguard ( guard );
110  ( *pFunc ) ( args );
111  }
112  }
113  else {
114  this->cacCtx.incrementOutstandingIO (
115  guard, this->ioSeqNo );
116  }
117 }
118 
119 void oldChannelNotify::serviceShutdownNotify (
120  epicsGuard < epicsMutex > & guard )
121 {
122  this->disconnectNotify ( guard );
123 }
124 
125 void oldChannelNotify::accessRightsNotify (
126  epicsGuard < epicsMutex > & guard, const caAccessRights & ar )
127 {
128  struct access_rights_handler_args args;
129  args.chid = this;
130  args.ar.read_access = ar.readPermit();
131  args.ar.write_access = ar.writePermit();
132  caArh * pFunc = this->pAccessRightsFunc;
133  {
134  epicsGuardRelease < epicsMutex > unguard ( guard );
135  ( *pFunc ) ( args );
136  }
137 }
138 
139 void oldChannelNotify::exception (
140  epicsGuard < epicsMutex > & guard, int status, const char * pContext )
141 {
142  this->cacCtx.exception ( guard, status, pContext, __FILE__, __LINE__ );
143 }
144 
145 void oldChannelNotify::readException (
146  epicsGuard < epicsMutex > & guard, int status, const char *pContext,
147  unsigned type, arrayElementCount count, void * /* pValue */ )
148 {
149  this->cacCtx.exception ( guard, status, pContext,
150  __FILE__, __LINE__, *this, type, count, CA_OP_GET );
151 }
152 
153 void oldChannelNotify::writeException (
154  epicsGuard < epicsMutex > & guard, int status, const char *pContext,
155  unsigned type, arrayElementCount count )
156 {
157  this->cacCtx.exception ( guard, status, pContext,
158  __FILE__, __LINE__, *this, type, count, CA_OP_PUT );
159 }
160 
161 void oldChannelNotify::operator delete ( void * )
162 {
163  // Visual C++ .net appears to require operator delete if
164  // placement operator delete is defined? I smell a ms rat
165  // because if I declare placement new and delete, but
166  // comment out the placement delete definition there are
167  // no undefined symbols.
168  errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked",
169  __FILE__, __LINE__ );
170 }
171 
172 /*
173  * ca_get_host_name ()
174  */
175 unsigned epicsStdCall ca_get_host_name (
176  chid pChan, char * pBuf, unsigned bufLength )
177 {
178  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef() );
179  return pChan->io.getHostName ( guard, pBuf, bufLength );
180 }
181 
182 /*
183  * ca_host_name ()
184  *
185  * !!!! not thread safe !!!!
186  *
187  */
188 const char * epicsStdCall ca_host_name (
189  chid pChan )
190 {
191  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
192  return pChan->io.pHostName ( guard );
193 }
194 
195 /*
196  * ca_set_puser ()
197  */
198 void epicsStdCall ca_set_puser (
199  chid pChan, void * puser )
200 {
201  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
202  pChan->pPrivate = puser;
203 }
204 
205 /*
206  * ca_get_puser ()
207  */
208 void * epicsStdCall ca_puser (
209  chid pChan )
210 {
211  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
212  return pChan->pPrivate;
213 }
214 
215 /*
216  * Specify an event subroutine to be run for connection events
217  */
218 int epicsStdCall ca_change_connection_event ( chid pChan, caCh * pfunc )
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 }
236 
237 /*
238  * ca_replace_access_rights_event
239  */
241  chid pChan, caArh *pfunc )
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 }
263 
264 /*
265  * ca_array_get ()
266  */
267 int epicsStdCall ca_array_get ( chtype type,
268  arrayElementCount count, chid pChan, void *pValue )
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 }
331 
332 /*
333  * ca_array_get_callback ()
334  */
335 int epicsStdCall ca_array_get_callback ( chtype type,
336  arrayElementCount count, chid pChan,
337  caEventCallBackFunc *pfunc, void *arg )
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 }
400 
403  unsigned type, arrayElementCount count,
404  cacReadNotify & notify, cacChannel::ioid * pId )
405 {
406  this->io.read ( guard, type, count, notify, pId );
407 }
408 
409 /*
410  * ca_array_put_callback ()
411  */
413  chid pChan, const void *pValue, caEventCallBackFunc *pfunc, void *usrarg )
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 }
472 
473 /*
474  * ca_array_put ()
475  */
476 int epicsStdCall ca_array_put ( chtype type, arrayElementCount count,
477  chid pChan, const void * pValue )
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 }
529 
530 int epicsStdCall ca_create_subscription (
531  chtype type, arrayElementCount count, chid pChan,
532  long mask, caEventCallBackFunc * pCallBack, void * pCallBackArg,
533  evid * monixptr )
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 }
610 
612  epicsGuard < epicsMutex > & guard, unsigned type, arrayElementCount count,
613  const void * pValue, cacWriteNotify & notify, cacChannel::ioid * pId )
614 {
615  this->io.write ( guard, type, count, pValue, notify, pId );
616 }
617 
618 /*
619  * ca_field_type()
620  */
621 short epicsStdCall ca_field_type ( chid pChan )
622 {
623  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
624  return pChan->io.nativeType ( guard );
625 }
626 
627 /*
628  * ca_element_count ()
629  */
631 {
632  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
633  return pChan->io.nativeElementCount ( guard );
634 }
635 
636 /*
637  * ca_state ()
638  */
639 enum channel_state epicsStdCall ca_state ( chid pChan )
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 }
652 
653 /*
654  * ca_read_access ()
655  */
656 unsigned epicsStdCall ca_read_access ( chid pChan )
657 {
658  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
659  return pChan->io.accessRights(guard).readPermit();
660 }
661 
662 /*
663  * ca_write_access ()
664  */
665 unsigned epicsStdCall ca_write_access ( chid pChan )
666 {
667  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
668  return pChan->io.accessRights(guard).writePermit();
669 }
670 
671 /*
672  * ca_name ()
673  */
674 const char * epicsStdCall ca_name ( chid pChan )
675 {
676  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
677  return pChan->io.pName ( guard );
678 }
679 
680 unsigned epicsStdCall ca_search_attempts ( chid pChan )
681 {
682  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
683  return pChan->io.searchAttempts ( guard );
684 }
685 
686 double epicsStdCall ca_beacon_period ( chid pChan )
687 {
688  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
689  return pChan->io.beaconPeriod ( guard );
690 }
691 
692 double epicsStdCall ca_receive_watchdog_delay ( chid pChan )
693 {
694  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
695  return pChan->io.receiveWatchdogDelay ( guard );
696 }
697 
698 /*
699  * ca_v42_ok(chid chan)
700  */
701 int epicsStdCall ca_v42_ok ( chid pChan )
702 {
703  epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
704  return pChan->io.ca_v42_ok ( guard );
705 }
706 
707 
#define CA_OP_CONN_UP
Definition: cadef.h:128
virtual double beaconPeriod(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:69
void caCh(struct connection_handler_args args)
Definition: cadef.h:57
friend short epicsStdCall ca_field_type(chid pChan)
friend int epicsStdCall ca_array_put(chtype type, arrayElementCount count, chid pChan, const void *pValue)
friend unsigned epicsStdCall ca_write_access(chid pChan)
#define CA_OP_GET
Definition: cadef.h:118
#define ECA_BADFUNCPTR
Definition: caerr.h:129
friend unsigned epicsStdCall ca_read_access(chid pChan)
void cacNoopAccesRightsHandler(struct access_rights_handler_args)
virtual const char * pName(epicsGuard< epicsMutex > &guard) const =0
friend int epicsStdCall ca_array_get(chtype type, arrayElementCount count, chid pChan, void *pValue)
friend int epicsStdCall ca_array_get_callback(chtype type, arrayElementCount count, chid pChan, caEventCallBackFunc *pfunc, void *arg)
pvd::Status status
#define ECA_INTERNAL
Definition: caerr.h:94
friend void epicsStdCall ca_set_puser(chid pChan, void *puser)
friend arrayElementCount epicsStdCall ca_element_count(chid pChan)
void caArh(struct access_rights_handler_args args)
Definition: cadef.h:70
#define ECA_GETFAIL
Definition: caerr.h:96
ca_client_context & getClientCtx()
Definition: oldAccess.h:428
#define ECA_PUTFAIL
Definition: caerr.h:97
friend double epicsStdCall ca_receive_watchdog_delay(chid pChan)
virtual double receiveWatchdogDelay(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:75
void caEventCallBackFunc(struct event_handler_args)
Definition: cadef.h:92
unsigned read_access
Definition: cadef.h:60
void incrementOutstandingIO(epicsGuard< epicsMutex > &, unsigned ioSeqNo)
friend void *epicsStdCall ca_puser(chid pChan)
bool writePermit() const
Definition: cacIO.h:373
pvd::StructureConstPtr type
#define ECA_BADCOUNT
Definition: caerr.h:99
#define INVALID_DB_REQ(x)
Definition: db_access.h:115
void assertIdenticalMutex(const T &) const
Definition: epicsGuard.h:80
#define CA_OP_PUT
Definition: cadef.h:119
#define NULL
Definition: catime.c:38
epicsMutex & mutexRef() const
Definition: cadef.h:166
virtual unsigned getHostName(epicsGuard< epicsMutex > &, char *pBuf, unsigned bufLength) const
Definition: cacChannel.cpp:120
channel_state
Definition: cadef.h:166
friend int epicsStdCall ca_array_put_callback(chtype type, arrayElementCount count, chid pChan, const void *pValue, caEventCallBackFunc *pfunc, void *usrarg)
#define ECA_DISCONN
Definition: caerr.h:101
friend enum channel_state epicsStdCall ca_state(chid pChan)
void destructor(CallbackGuard &cbGuard, epicsGuard< epicsMutex > &mutexGuard)
virtual const char * pHostName(epicsGuard< epicsMutex > &guard) const
Definition: cacChannel.cpp:132
virtual ioStatus read(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, cacReadNotify &, ioid *=0)=0
unsigned write_access
Definition: cadef.h:61
unsigned ioid
Definition: cacIO.h:173
#define ECA_NORMAL
Definition: caerr.h:77
#define ECA_TOLARGE
Definition: caerr.h:86
virtual void write(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pValue)=0
friend unsigned epicsStdCall ca_search_attempts(chid pChan)
unsigned capri
Definition: cadef.h:189
friend int epicsStdCall ca_change_connection_event(chid pChan, caCh *pfunc)
virtual caAccessRights accessRights(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:56
friend const char *epicsStdCall ca_name(chid pChan)
int errlogPrintf(const char *pFormat,...)
Definition: errlog.c:105
bool readPermit() const
Definition: cacIO.h:368
#define ECA_NOWTACCESS
Definition: caerr.h:124
friend unsigned epicsStdCall ca_get_host_name(chid pChan, char *pBuf, unsigned bufLength)
virtual bool connected(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:87
virtual bool ca_v42_ok(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:81
#define CA_OP_CONN_DOWN
Definition: cadef.h:129
unsigned sequenceNumberOfOutstandingIO(epicsGuard< epicsMutex > &) const
Definition: oldAccess.h:566
unsigned long arrayElementCount
Definition: cacIO.h:57
friend int epicsStdCall ca_replace_access_rights_event(chid pChan, caArh *pfunc)
friend int epicsStdCall ca_v42_ok(chid pChan)
friend const char *epicsStdCall ca_host_name(chid pChan)
virtual void destroy(CallbackGuard &callbackGuard, epicsGuard< epicsMutex > &mutualExclusionGuard)=0
long chtype
Definition: cadef.h:47
virtual arrayElementCount nativeElementCount(epicsGuard< epicsMutex > &) const =0
void write(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pValue, cacWriteNotify &, cacChannel::ioid *pId=0)
virtual short nativeType(epicsGuard< epicsMutex > &) const =0
#define ECA_NORDACCESS
Definition: caerr.h:123
#define ECA_BADSTR
Definition: caerr.h:100
#define ECA_TIMEOUT
Definition: caerr.h:87
void decrementOutstandingIO(epicsGuard< epicsMutex > &, unsigned ioSeqNo)
#define ECA_BADMASK
Definition: caerr.h:118
#define ECA_BADTYPE
Definition: caerr.h:91
virtual unsigned searchAttempts(epicsGuard< epicsMutex > &) const
Definition: cacChannel.cpp:63
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &)
Definition: oldAccess.h:468
oldChannelNotify(epicsGuard< epicsMutex > &, struct ca_client_context &, const char *pName, caCh *pConnCallBackIn, void *pPrivateIn, capri priority)
friend double epicsStdCall ca_beacon_period(chid pChan)
#define false
Definition: flexdef.h:85
#define ECA_UNAVAILINSERV
Definition: caerr.h:131
void read(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, cacReadNotify &notify, cacChannel::ioid *pId=0)
#define ECA_ALLOCMEM
Definition: caerr.h:83
friend int epicsStdCall ca_create_subscription(chtype type, arrayElementCount count, chid pChan, long mask, caEventCallBackFunc *pCallBack, void *pCallBackArg, evid *monixptr)