diff --git a/src/ca/netIO.h b/src/ca/netIO.h index 6a7a04b45..78e189d27 100644 --- a/src/ca/netIO.h +++ b/src/ca/netIO.h @@ -35,59 +35,41 @@ class baseNMIU : public tsDLNode < baseNMIU >, // X aCC 655 public chronIntIdRes < baseNMIU > { public: - baseNMIU ( nciu &chan ); + virtual ~baseNMIU (); virtual void destroy ( class cacRecycle & ) = 0; // only called by cac virtual void completion () = 0; virtual void exception ( int status, - const char *pContext ) = 0; + const char * pContext ) = 0; virtual void exception ( int status, - const char *pContext, unsigned type, + const char * pContext, unsigned type, arrayElementCount count ) = 0; virtual void completion ( unsigned type, - arrayElementCount count, const void *pData ) = 0; + arrayElementCount count, const void * pData ) = 0; virtual class netSubscription * isSubscription () = 0; virtual void show ( unsigned level ) const = 0; - ca_uint32_t getID () const; - nciu & channel () const; -protected: - // SUN PRO multiply defines if this is virtual - // therefore this is protected to avoid most use of it - /*virtual*/ ~baseNMIU (); // -// perhaps we should not store the channel here and instead fetch it out of the -// notify +// not fond of the vf overhead to fetch this // - nciu & chan; -private: - baseNMIU ( const baseNMIU & ); - baseNMIU & operator = ( const baseNMIU & ); + virtual nciu & channel () const = 0; }; class netSubscription : public baseNMIU { public: static netSubscription * factory ( tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &, - nciu &chan, unsigned type, arrayElementCount count, + nciu & chan, unsigned type, arrayElementCount count, unsigned mask, cacStateNotify ¬ify ); void show ( unsigned level ) const; arrayElementCount getCount () const; unsigned getType () const; unsigned getMask () const; - void destroy ( class cacRecycle & ); - void completion (); - void exception ( int status, - const char *pContext ); - void completion ( unsigned type, - arrayElementCount count, const void *pData ); - void exception ( int status, - const char *pContext, unsigned type, - arrayElementCount count ); private: const arrayElementCount count; + nciu & chan; cacStateNotify & notify; const unsigned type; const unsigned mask; - netSubscription ( nciu &chan, unsigned type, arrayElementCount count, + netSubscription ( nciu & chan, unsigned type, arrayElementCount count, unsigned mask, cacStateNotify ¬ify ); class netSubscription * isSubscription (); void * operator new ( size_t ); @@ -98,6 +80,16 @@ private: void operator delete ( void *, tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & ); # endif + void destroy ( class cacRecycle & ); + void completion (); + void exception ( int status, + const char *pContext ); + void completion ( unsigned type, + arrayElementCount count, const void *pData ); + void exception ( int status, + const char *pContext, unsigned type, + arrayElementCount count ); + nciu & channel () const; netSubscription ( const netSubscription & ); netSubscription & operator = ( const netSubscription & ); ~netSubscription (); @@ -109,15 +101,9 @@ public: tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > &, nciu &chan, cacReadNotify ¬ify ); void show ( unsigned level ) const; - void destroy ( class cacRecycle & ); - void completion (); - void exception ( int status, const char *pContext ); - void completion ( unsigned type, - arrayElementCount count, const void *pData ); - void exception ( int status, const char *pContext, - unsigned type, arrayElementCount count ); private: cacReadNotify & notify; + nciu & chan; netReadNotifyIO ( nciu & chan, cacReadNotify & notify ); void * operator new ( size_t ); void operator delete ( void * ); @@ -127,6 +113,14 @@ private: void operator delete ( void *, tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & ); # endif + void destroy ( class cacRecycle & ); + void completion (); + void exception ( int status, const char *pContext ); + void completion ( unsigned type, + arrayElementCount count, const void *pData ); + void exception ( int status, const char *pContext, + unsigned type, arrayElementCount count ); + nciu & channel () const; ~netReadNotifyIO (); class netSubscription * isSubscription (); netReadNotifyIO ( const netReadNotifyIO & ); @@ -139,15 +133,9 @@ public: tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > &, nciu &chan, cacWriteNotify ¬ify ); void show ( unsigned level ) const; - void destroy ( class cacRecycle & ); - void completion (); - void exception ( int status, const char *pContext ); - void completion ( unsigned type, - arrayElementCount count, const void *pData ); - void exception ( int status, const char *pContext, - unsigned type, arrayElementCount count ); private: - cacWriteNotify ¬ify; + cacWriteNotify & notify; + nciu & chan; netWriteNotifyIO ( nciu &chan, cacWriteNotify ¬ify ); void * operator new ( size_t ); void operator delete ( void * ); @@ -158,21 +146,19 @@ private: tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & ); # endif class netSubscription * isSubscription (); + void destroy ( class cacRecycle & ); + void completion (); + void exception ( int status, const char *pContext ); + void completion ( unsigned type, + arrayElementCount count, const void *pData ); + void exception ( int status, const char *pContext, + unsigned type, arrayElementCount count ); + nciu & channel () const; netWriteNotifyIO ( const netWriteNotifyIO & ); netWriteNotifyIO & operator = ( const netWriteNotifyIO & ); ~netWriteNotifyIO (); }; -inline ca_uint32_t baseNMIU::getID () const -{ - return this->id; -} - -inline class nciu & baseNMIU::channel () const -{ - return this->chan; -} - inline void * netSubscription::operator new ( size_t size, tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &freeList ) { diff --git a/src/ca/netReadNotifyIO.cpp b/src/ca/netReadNotifyIO.cpp index 709d48e5e..76f5d82be 100644 --- a/src/ca/netReadNotifyIO.cpp +++ b/src/ca/netReadNotifyIO.cpp @@ -18,8 +18,8 @@ #include "nciu.h" #include "cac.h" -netReadNotifyIO::netReadNotifyIO ( nciu & chan, cacReadNotify & notify ) : - baseNMIU ( chan ), notify ( notify ) +netReadNotifyIO::netReadNotifyIO ( nciu & chanIn, cacReadNotify & notify ) : + notify ( notify ), chan ( chanIn ) { } @@ -66,4 +66,10 @@ class netSubscription * netReadNotifyIO::isSubscription () return 0; } +nciu & netReadNotifyIO::channel () const +{ + return this->chan; +} + + diff --git a/src/ca/netSubscription.cpp b/src/ca/netSubscription.cpp index f52310fcf..43595f6ee 100644 --- a/src/ca/netSubscription.cpp +++ b/src/ca/netSubscription.cpp @@ -20,10 +20,10 @@ #include "cac.h" #include "db_access.h" // for dbf_type_to_text -netSubscription::netSubscription ( nciu &chan, +netSubscription::netSubscription ( nciu & chanIn, unsigned typeIn, arrayElementCount countIn, unsigned maskIn, cacStateNotify ¬ifyIn ) : - baseNMIU ( chan ), count ( countIn ), + count ( countIn ), chan ( chanIn ), notify ( notifyIn ), type ( typeIn ), mask ( maskIn ) { if ( ! dbr_type_is_valid ( typeIn ) ) { @@ -79,6 +79,11 @@ void netSubscription::completion ( unsigned typeIn, this->notify.current ( typeIn, countIn, pDataIn ); } +nciu & netSubscription::channel () const +{ + return this->chan; +} + diff --git a/src/ca/netWriteNotifyIO.cpp b/src/ca/netWriteNotifyIO.cpp index 917cd1073..5270902e7 100644 --- a/src/ca/netWriteNotifyIO.cpp +++ b/src/ca/netWriteNotifyIO.cpp @@ -18,8 +18,8 @@ #include "nciu.h" #include "cac.h" -netWriteNotifyIO::netWriteNotifyIO ( nciu &chan, cacWriteNotify ¬ifyIn ) : - baseNMIU ( chan ), notify ( notifyIn ) +netWriteNotifyIO::netWriteNotifyIO ( nciu & chanIn, cacWriteNotify & notifyIn ) : + notify ( notifyIn ), chan ( chanIn ) { } @@ -67,3 +67,10 @@ class netSubscription * netWriteNotifyIO::isSubscription () return 0; } +nciu & netWriteNotifyIO::channel () const +{ + return this->chan; +} + + +