25 #ifndef INC_oldAccess_H 26 #define INC_oldAccess_H 44 const char * pName,
caCh * pConnCallBackIn,
45 void * pPrivateIn,
capri priority );
52 chid pChan,
char * pBuf,
unsigned bufLength );
55 friend const char * epicsStdCall
ca_name (
58 chid pChan,
void * puser );
59 friend void * epicsStdCall
ca_puser (
72 chid pChan,
const void * pValue );
75 chid pChan,
const void *pValue,
94 void * pCallBackArg,
evid * monixptr );
102 char * pBuf,
unsigned bufLen )
const throw ();
105 unsigned level )
const;
127 void *
operator new (
size_t size,
129 epicsPlacementDeleteOperator ((
void * ,
136 caCh * pConnCallBack;
138 caArh * pAccessRightsFunc;
140 bool currentlyConnected;
144 void serviceShutdownNotify (
146 void accessRightsNotify (
149 int status,
const char * pContext );
151 int status,
const char * pContext,
154 int status,
const char * pContext,
158 void operator delete (
void * );
169 void show (
unsigned level )
const;
171 void *
operator new (
size_t size,
173 epicsPlacementDeleteOperator ((
void *,
189 getCopy & operator = ( const getCopy & );
190 void operator delete (
void * );
199 void *
operator new (
size_t size,
201 epicsPlacementDeleteOperator ((
void *,
214 getCallback & operator = ( const getCallback & );
215 void operator delete (
void * );
224 void *
operator new (
size_t size,
226 epicsPlacementDeleteOperator ((
void *,
232 void completion (
epicsGuard < epicsMutex > & );
234 epicsGuard < epicsMutex > &,
int status, const
char *pContext,
237 putCallback & operator = ( const putCallback & );
238 void operator delete (
void * );
261 void *
operator new (
size_t size,
263 epicsPlacementDeleteOperator ((
void *,
277 oldSubscription & operator = ( const oldSubscription & );
278 void operator delete (
void * );
288 void changeExceptionEvent (
290 void registerForFileDescriptorCallBack (
292 void replaceErrLogHandler (
caPrintfFunc * ca_printf_func );
299 int pendIO (
const double &
timeout );
300 int pendEvent (
const double & timeout );
301 bool ioComplete ()
const;
302 void show (
unsigned level )
const;
303 unsigned circuitCount ()
const;
304 unsigned sequenceNumberOfOutstandingIO (
306 unsigned beaconAnomaliesSinceProgramStart ()
const;
307 void incrementOutstandingIO (
309 void decrementOutstandingIO (
313 const char * pFileName,
unsigned lineNo );
318 void blockForEventAndEnableCallbacks (
321 static void installDefaultService (
cacService & );
324 void selfTest ()
const;
326 int printFormated (
const char * pformat, ... )
const;
327 int varArgsPrintFormated (
const char * pformat, va_list args )
const;
328 void signal (
int ca_status,
const char * pfilenm,
329 int lineno,
const char * pFormat, ... );
330 void vSignal (
int ca_status,
const char * pfilenm,
331 int lineno,
const char *pFormat, va_list args );
332 bool preemptiveCallbakIsEnabled ()
const;
337 epicsMutex & mutexRef ()
const;
344 const char * name_str,
caCh * conn_func,
void * puser,
370 chid pChan,
void *pValue );
373 chid pChan,
const void *pValue );
390 mutable epicsMutex
mutex;
391 mutable epicsMutex cbMutex;
395 std::auto_ptr < CallbackGuard > pCallbackGuard;
396 std::auto_ptr < cacContext > pServiceContext;
398 void * ca_exception_arg;
405 unsigned callbackThreadsPending;
407 bool fdRegFuncNeedsToBeCalled;
408 bool noWakeupSincePend;
410 void attachToClientCtx ();
411 void callbackProcessingInitiateNotify ();
412 void callbackProcessingCompleteNotify ();
414 epicsMutex & mutualExclusion, epicsMutex & callbackControl );
415 void _sendWakeupMsg ();
422 static epicsMutex * pDefaultServiceInstallMutex;
423 static const unsigned flushBlockThreshold;
435 char * pBuf,
unsigned bufLen )
const throw ()
437 return this->io.
getName ( guard, pBuf, bufLen );
442 unsigned level )
const 444 this->io.
show ( guard, level );
458 this->io.
ioCancel ( callbackGuard, mutualExclusionGuard,
id );
465 this->io.
ioShow ( guard,
id, level );
474 inline void * oldChannelNotify::operator
new (
size_t size,
477 return freeList.allocate ( size );
480 #ifdef CXX_PLACEMENT_DELETE 481 inline void oldChannelNotify::operator
delete (
void *pCadaver,
484 freeList.release ( pCadaver );
488 inline void * oldSubscription::operator
new (
size_t size,
491 return freeList.allocate ( size );
494 #ifdef CXX_PLACEMENT_DELETE 495 inline void oldSubscription::operator
delete (
void *pCadaver,
498 freeList.release ( pCadaver );
506 this->chan.ioCancel ( callbackGuard, mutualExclusionGuard, this->
id );
514 inline void * getCopy::operator
new (
size_t size,
520 #ifdef CXX_PLACEMENT_DELETE 521 inline void getCopy::operator
delete (
void *pCadaver,
524 freeList.release ( pCadaver );
528 inline void * putCallback::operator
new (
size_t size,
531 return freeList.allocate ( size );
534 #ifdef CXX_PLACEMENT_DELETE 535 inline void putCallback::operator
delete (
void * pCadaver,
538 freeList.release ( pCadaver );
542 inline void * getCallback::operator
new (
size_t size,
545 return freeList.allocate ( size );
548 #ifdef CXX_PLACEMENT_DELETE 549 inline void getCallback::operator
delete (
void * pCadaver,
552 freeList.release ( pCadaver );
558 return this->pCallbackGuard.get () == 0;
563 return ( this->pndRecvCnt == 0u );
570 return this->ioSeqNo;
577 if ( this->pCallbackGuard.get() &&
579 io.destroy ( *this->pCallbackGuard.get(), guard );
595 io.destroy ( cbGuard, guard );
600 #endif // ifndef INC_oldAccess_H
void caCh(struct connection_handler_args args)
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)
friend unsigned epicsStdCall ca_read_access(chid pChan)
unsigned getName(epicsGuard< epicsMutex > &, char *pBuf, unsigned bufLen) const
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)
friend void epicsStdCall ca_set_puser(chid pChan, void *puser)
virtual void initiateConnect(epicsGuard< epicsMutex > &)=0
bool preemptiveCallbakIsEnabled() const
friend arrayElementCount epicsStdCall ca_element_count(chid pChan)
int epicsStdCall ca_create_channel(const char *name_str, caCh *conn_func, void *puser, capri priority, chid *chanptr)
void caArh(struct access_rights_handler_args args)
ca_client_context & getClientCtx()
friend double epicsStdCall ca_receive_watchdog_delay(chid pChan)
void caExceptionHandler(struct exception_handler_args)
void caEventCallBackFunc(struct event_handler_args)
friend void *epicsStdCall ca_puser(chid pChan)
pvd::StructureConstPtr type
LIBCA_API int epicsStdCall ca_sg_array_put(const CA_SYNC_GID gid, chtype type, unsigned long count, chid chan, const void *pValue)
unsigned short ca_uint16_t
LIBCA_API int epicsStdCall ca_sg_delete(const CA_SYNC_GID gid)
friend int epicsStdCall ca_array_put_callback(chtype type, arrayElementCount count, chid pChan, const void *pValue, caEventCallBackFunc *pfunc, void *usrarg)
void CAFDHANDLER(void *parg, int fd, int opened)
LIBCA_API int epicsStdCall ca_sg_create(CA_SYNC_GID *pgid)
friend enum channel_state epicsStdCall ca_state(chid pChan)
void destructor(CallbackGuard &cbGuard, epicsGuard< epicsMutex > &mutexGuard)
virtual unsigned getName(epicsGuard< epicsMutex > &, char *pBuf, unsigned bufLen) const =0
virtual void ioShow(epicsGuard< epicsMutex > &, const ioid &, unsigned level) const =0
int ca_sync_group_destroy(CallbackGuard &cbGuard, epicsGuard< epicsMutex > &guard, ca_client_context &cac, const CA_SYNC_GID gid)
int epicsStdCall ca_flush_io()
friend unsigned epicsStdCall ca_search_attempts(chid pChan)
void initiateConnect(epicsGuard< epicsMutex > &)
friend int epicsStdCall ca_change_connection_event(chid pChan, caCh *pfunc)
LIBCA_API int epicsStdCall ca_clear_subscription(evid pMon)
void cancel(CallbackGuard &callbackGuard, epicsGuard< epicsMutex > &mutualExclusionGuard)
friend const char *epicsStdCall ca_name(chid pChan)
void ioShow(epicsGuard< epicsMutex > &guard, const cacChannel::ioid &, unsigned level) const
void whenThereIsAnExceptionDestroySyncGroupIO(epicsGuard< epicsMutex > &, T &)
int caPrintfFunc(const char *pformat, va_list args)
int epicsStdCall ca_clear_channel(chid pChan)
LIBCA_API int epicsStdCall ca_sg_test(const CA_SYNC_GID gid)
friend unsigned epicsStdCall ca_get_host_name(chid pChan, char *pBuf, unsigned bufLength)
unsigned sequenceNumberOfOutstandingIO(epicsGuard< epicsMutex > &) const
LIBCA_API int epicsStdCall ca_sg_array_get(const CA_SYNC_GID gid, chtype type, unsigned long count, chid chan, void *pValue)
unsigned long arrayElementCount
friend int epicsStdCall ca_replace_access_rights_event(chid pChan, caArh *pfunc)
friend int epicsStdCall ca_v42_ok(chid pChan)
void ioCancel(CallbackGuard &callbackGuard, epicsGuard< epicsMutex > &mutualExclusionGuard, const cacChannel::ioid &)
friend const char *epicsStdCall ca_host_name(chid pChan)
oldChannelNotify & channel() const
void write(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pValue, cacWriteNotify &, cacChannel::ioid *pId=0)
void * allocate(size_t size)
virtual void show(epicsGuard< epicsMutex > &, unsigned level) const =0
virtual void ioCancel(CallbackGuard &callbackGuard, epicsGuard< epicsMutex > &mutualExclusionGuard, const ioid &)=0
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &, cacChannel &)
void sync_group_reset(ca_client_context &client, CASG &sg)
int fetchClientContext(ca_client_context **ppcac)
ChannelPut::shared_pointer op
LIBCA_API int epicsStdCall ca_sg_reset(const CA_SYNC_GID gid)
Compiler specific declarations.
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &)
oldChannelNotify(epicsGuard< epicsMutex > &, struct ca_client_context &, const char *pName, caCh *pConnCallBackIn, void *pPrivateIn, capri priority)
LIBCA_API int epicsStdCall ca_sg_block(const CA_SYNC_GID gid, ca_real timeout)
friend double epicsStdCall ca_beacon_period(chid pChan)
void read(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, cacReadNotify ¬ify, cacChannel::ioid *pId=0)
friend int epicsStdCall ca_create_subscription(chtype type, arrayElementCount count, chid pChan, long mask, caEventCallBackFunc *pCallBack, void *pCallBackArg, evid *monixptr)
void show(epicsGuard< epicsMutex > &, unsigned level) const
LIBCOM_API epicsThreadId epicsStdCall epicsThreadGetIdSelf(void)