28 # pragma warning(disable:4355) 31 #define epicsAssertAuthor "Jeff Hill johill@lanl.gov" 46 const char *pName,
caCh * pConnCallBackIn,
47 void * pPrivateIn,
capri priority ) :
49 io ( cacIn.createChannel ( guard, pName, *this, priority ) ),
50 pConnCallBack ( pConnCallBackIn ),
52 ioSeqNo ( 0 ), currentlyConnected (
false ), prevConnected (
false )
56 if ( pConnCallBackIn == 0 ) {
61 oldChannelNotify::~oldChannelNotify ()
70 this->io.
destroy ( cbGuard, mutexGuard );
73 if ( this->pConnCallBack == 0 && ! this->currentlyConnected ) {
79 void oldChannelNotify::connectNotify (
82 this->currentlyConnected =
true;
83 this->prevConnected =
true;
84 if ( this->pConnCallBack ) {
88 caCh * pFunc = this->pConnCallBack;
99 void oldChannelNotify::disconnectNotify (
102 this->currentlyConnected =
false;
103 if ( this->pConnCallBack ) {
107 caCh * pFunc = this->pConnCallBack;
115 guard, this->ioSeqNo );
119 void oldChannelNotify::serviceShutdownNotify (
122 this->disconnectNotify ( guard );
125 void oldChannelNotify::accessRightsNotify (
132 caArh * pFunc = this->pAccessRightsFunc;
139 void oldChannelNotify::exception (
142 this->cacCtx.exception ( guard,
status, pContext, __FILE__, __LINE__ );
145 void oldChannelNotify::readException (
149 this->cacCtx.exception ( guard,
status, pContext,
153 void oldChannelNotify::writeException (
157 this->cacCtx.exception ( guard,
status, pContext,
161 void oldChannelNotify::operator
delete (
void * )
168 errlogPrintf (
"%s:%d this compiler is confused about placement delete - memory was probably leaked",
169 __FILE__, __LINE__ );
176 chid pChan,
char * pBuf,
unsigned bufLength )
179 return pChan->io.
getHostName ( guard, pBuf, bufLength );
199 chid pChan,
void * puser )
202 pChan->pPrivate = puser;
212 return pChan->pPrivate;
221 if ( ! pChan->currentlyConnected ) {
223 if ( ! pChan->pConnCallBack ) {
228 if ( pChan->pConnCallBack ) {
233 pChan->pConnCallBack = pfunc;
253 if ( pChan->currentlyConnected ) {
259 ( *pChan->pAccessRightsFunc ) ( args );
278 unsigned tmpType = static_cast <
unsigned > (
type );
285 tmpType, count, pValue ) );
286 pChan->io.
read ( guard, type, count, *pNotify, 0 );
318 catch ( std::bad_alloc & )
344 if ( pfunc ==
NULL ) {
347 unsigned tmpType = static_cast <
unsigned > (
type );
355 pChan->io.
read ( guard, tmpType, count, *pNotify, 0 );
387 catch ( std::bad_alloc & )
406 this->io.
read ( guard, type, count, notify, pId );
420 if ( pfunc ==
NULL ) {
425 unsigned tmpType = static_cast <
unsigned > (
type );
430 pChan->io.
write ( guard, tmpType, count, pValue, *pNotify, 0 );
462 catch ( std::bad_alloc & )
477 chid pChan,
const void * pValue )
482 unsigned tmpType = static_cast <
unsigned > (
type );
488 pChan->io.
write ( guard, tmpType, count, pValue );
519 catch ( std::bad_alloc & )
538 unsigned tmpType = static_cast <
unsigned > (
type );
544 if ( pCallBack ==
NULL ) {
548 static const long maskMask = 0xffff;
549 if ( ( mask & maskMask ) == 0) {
553 if ( mask & ~maskMask ) {
571 guard, *pChan, pChan->io, tmpType, count, mask,
572 pCallBack, pCallBackArg, monixptr );
598 catch ( std::bad_alloc & )
615 this->io.
write ( guard, type, count, pValue, notify, pId );
645 else if ( pChan->prevConnected ){
677 return pChan->io.
pName ( guard );
virtual double beaconPeriod(epicsGuard< epicsMutex > &) const
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)
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)
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)
ca_client_context & getClientCtx()
friend double epicsStdCall ca_receive_watchdog_delay(chid pChan)
virtual double receiveWatchdogDelay(epicsGuard< epicsMutex > &) const
void caEventCallBackFunc(struct event_handler_args)
void incrementOutstandingIO(epicsGuard< epicsMutex > &, unsigned ioSeqNo)
friend void *epicsStdCall ca_puser(chid pChan)
pvd::StructureConstPtr type
#define INVALID_DB_REQ(x)
void assertIdenticalMutex(const T &) const
epicsMutex & mutexRef() const
virtual unsigned getHostName(epicsGuard< epicsMutex > &, char *pBuf, unsigned bufLength) const
friend int epicsStdCall ca_array_put_callback(chtype type, arrayElementCount count, chid pChan, const void *pValue, caEventCallBackFunc *pfunc, void *usrarg)
friend enum channel_state epicsStdCall ca_state(chid pChan)
void destructor(CallbackGuard &cbGuard, epicsGuard< epicsMutex > &mutexGuard)
virtual const char * pHostName(epicsGuard< epicsMutex > &guard) const
virtual ioStatus read(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, cacReadNotify &, ioid *=0)=0
virtual void write(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pValue)=0
friend unsigned epicsStdCall ca_search_attempts(chid pChan)
friend int epicsStdCall ca_change_connection_event(chid pChan, caCh *pfunc)
virtual caAccessRights accessRights(epicsGuard< epicsMutex > &) const
friend const char *epicsStdCall ca_name(chid pChan)
int errlogPrintf(const char *pFormat,...)
friend unsigned epicsStdCall ca_get_host_name(chid pChan, char *pBuf, unsigned bufLength)
virtual bool connected(epicsGuard< epicsMutex > &) const
virtual bool ca_v42_ok(epicsGuard< epicsMutex > &) const
unsigned sequenceNumberOfOutstandingIO(epicsGuard< epicsMutex > &) const
unsigned long arrayElementCount
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
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
void decrementOutstandingIO(epicsGuard< epicsMutex > &, unsigned ioSeqNo)
virtual unsigned searchAttempts(epicsGuard< epicsMutex > &) const
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &)
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 ECA_UNAVAILINSERV
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)