moved chan out to derived class

This commit is contained in:
Jeff Hill
2002-05-09 00:26:13 +00:00
parent e696fa03eb
commit 78e871e05c
4 changed files with 62 additions and 58 deletions

View File

@@ -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 &notify );
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 &notify );
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 &notify );
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 &notify );
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 &notify;
cacWriteNotify & notify;
nciu & chan;
netWriteNotifyIO ( nciu &chan, cacWriteNotify &notify );
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 )
{

View File

@@ -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;
}

View File

@@ -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 &notifyIn ) :
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;
}

View File

@@ -18,8 +18,8 @@
#include "nciu.h"
#include "cac.h"
netWriteNotifyIO::netWriteNotifyIO ( nciu &chan, cacWriteNotify &notifyIn ) :
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;
}