o eliminated header file for inline functions
o created file for template instances
This commit is contained in:
@@ -63,6 +63,7 @@ LIBSRCS += dbChannelIO.cpp
|
||||
LIBSRCS += dbSubscriptionIO.cpp
|
||||
LIBSRCS += dbPutNotifyBlocker.cpp
|
||||
LIBSRCS += dbServiceIOReadNotifyCache.cpp
|
||||
LIBSRCS += templateInstances.cpp
|
||||
|
||||
LIBRARY_IOC = dbIoc
|
||||
DLL_LIBS = dbStaticIoc ca Com
|
||||
|
||||
+26
-36
@@ -17,6 +17,30 @@
|
||||
* 1) This interface is preliminary and will change in the future
|
||||
*/
|
||||
|
||||
#ifndef dbCACh
|
||||
#define dbCACh
|
||||
|
||||
#ifdef epicsExportSharedSymbols
|
||||
#define dbCACh_restore_epicsExportSharedSymbols
|
||||
#undef epicsExportSharedSymbols
|
||||
#endif
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
#include "tsDLList.h"
|
||||
#include "epicsSingleton.h"
|
||||
#include "tsFreeList.h"
|
||||
#include "resourceLib.h"
|
||||
|
||||
#include "cacIO.h"
|
||||
|
||||
#ifdef dbCACh_restore_epicsExportSharedSymbols
|
||||
#define epicsExportSharedSymbols
|
||||
#endif
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
#include "db_access.h"
|
||||
#include "dbNotify.h"
|
||||
#include "dbEvent.h"
|
||||
#include "dbAddr.h"
|
||||
@@ -86,42 +110,6 @@ private:
|
||||
dbServicePrivateListOfIO & operator = ( const dbServicePrivateListOfIO & );
|
||||
};
|
||||
|
||||
class dbChannelIO : public cacChannel, public dbServicePrivateListOfIO {
|
||||
public:
|
||||
dbChannelIO ( cacChannelNotify ¬ify,
|
||||
const dbAddr &addr, dbServiceIO &serviceIO );
|
||||
void destroy ();
|
||||
void callReadNotify ( unsigned type, unsigned long count,
|
||||
cacReadNotify ¬ify );
|
||||
void callStateNotify ( unsigned type, unsigned long count,
|
||||
const struct db_field_log *pfl, cacStateNotify ¬ify );
|
||||
void show ( unsigned level ) const;
|
||||
void * operator new ( size_t size);
|
||||
void operator delete ( void *pCadaver, size_t size );
|
||||
const char *pName () const;
|
||||
protected:
|
||||
~dbChannelIO (); // allocate only from pool
|
||||
private:
|
||||
dbServiceIO & serviceIO;
|
||||
dbAddr addr;
|
||||
void initiateConnect ();
|
||||
ioStatus read ( unsigned type, unsigned long count,
|
||||
cacReadNotify &, ioid * );
|
||||
void write ( unsigned type, unsigned long count,
|
||||
const void *pvalue );
|
||||
ioStatus write ( unsigned type, unsigned long count,
|
||||
const void *pvalue, cacWriteNotify &, ioid * );
|
||||
void subscribe ( unsigned type, unsigned long count,
|
||||
unsigned mask, cacStateNotify ¬ify, ioid * );
|
||||
void ioCancel ( const ioid & );
|
||||
void ioShow ( const ioid &, unsigned level ) const;
|
||||
short nativeType () const;
|
||||
unsigned long nativeElementCount () const;
|
||||
static epicsSingleton < tsFreeList < dbChannelIO > > pFreeList;
|
||||
dbChannelIO ( const dbChannelIO & );
|
||||
dbChannelIO & operator = ( const dbChannelIO & );
|
||||
};
|
||||
|
||||
// allow only one thread at a time to use the cache, but do not hold
|
||||
// lock when calling the callback
|
||||
class dbServiceIOReadNotifyCache {
|
||||
@@ -182,3 +170,5 @@ inline void dbServiceIO::callReadNotify ( struct dbAddr &addr,
|
||||
this->readNotifyCache.callReadNotify ( addr, type, count, notify );
|
||||
}
|
||||
|
||||
#endif // dbCACh
|
||||
|
||||
|
||||
+1
-14
@@ -17,7 +17,6 @@
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include "cacIO.h"
|
||||
#include "tsFreeList.h"
|
||||
#include "epicsMutex.h"
|
||||
#include "epicsEvent.h"
|
||||
@@ -27,21 +26,9 @@
|
||||
#define epicsExportSharedSymbols
|
||||
#include "db_access_routines.h"
|
||||
#include "dbCAC.h"
|
||||
#include "dbChannelIOIL.h"
|
||||
#include "dbChannelIO.h"
|
||||
#include "dbPutNotifyBlocker.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning ( push )
|
||||
# pragma warning ( disable:4660 )
|
||||
#endif
|
||||
|
||||
template class tsFreeList < dbChannelIO >;
|
||||
template class epicsSingleton < tsFreeList < dbChannelIO > >;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning ( pop )
|
||||
#endif
|
||||
|
||||
epicsSingleton < tsFreeList < dbChannelIO > > dbChannelIO::pFreeList;
|
||||
|
||||
dbChannelIO::dbChannelIO ( cacChannelNotify ¬ify,
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
* NOTES:
|
||||
* 1) This interface is preliminary and will change in the future
|
||||
*/
|
||||
|
||||
#ifndef dbChannelIOh
|
||||
#define dbChannelIOh
|
||||
|
||||
class dbChannelIO : public cacChannel, public dbServicePrivateListOfIO {
|
||||
public:
|
||||
dbChannelIO ( cacChannelNotify ¬ify,
|
||||
const dbAddr &addr, dbServiceIO &serviceIO );
|
||||
void destroy ();
|
||||
void callReadNotify ( unsigned type, unsigned long count,
|
||||
cacReadNotify ¬ify );
|
||||
void callStateNotify ( unsigned type, unsigned long count,
|
||||
const struct db_field_log *pfl, cacStateNotify ¬ify );
|
||||
void show ( unsigned level ) const;
|
||||
void * operator new ( size_t size);
|
||||
void operator delete ( void *pCadaver, size_t size );
|
||||
const char *pName () const;
|
||||
protected:
|
||||
~dbChannelIO (); // allocate only from pool
|
||||
private:
|
||||
dbServiceIO & serviceIO;
|
||||
dbAddr addr;
|
||||
void initiateConnect ();
|
||||
ioStatus read ( unsigned type, unsigned long count,
|
||||
cacReadNotify &, ioid * );
|
||||
void write ( unsigned type, unsigned long count,
|
||||
const void *pvalue );
|
||||
ioStatus write ( unsigned type, unsigned long count,
|
||||
const void *pvalue, cacWriteNotify &, ioid * );
|
||||
void subscribe ( unsigned type, unsigned long count,
|
||||
unsigned mask, cacStateNotify ¬ify, ioid * );
|
||||
void ioCancel ( const ioid & );
|
||||
void ioShow ( const ioid &, unsigned level ) const;
|
||||
short nativeType () const;
|
||||
unsigned long nativeElementCount () const;
|
||||
static epicsSingleton < tsFreeList < dbChannelIO > > pFreeList;
|
||||
dbChannelIO ( const dbChannelIO & );
|
||||
dbChannelIO & operator = ( const dbChannelIO & );
|
||||
};
|
||||
|
||||
|
||||
inline unsigned long dbChannelIO::nativeElementCount () const
|
||||
{
|
||||
if ( this->addr.no_elements >= 0u ) {
|
||||
return static_cast < unsigned long > ( this->addr.no_elements );
|
||||
}
|
||||
return 0u;
|
||||
}
|
||||
|
||||
inline void dbChannelIO::destroy ()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
inline void * dbChannelIO::operator new ( size_t size )
|
||||
{
|
||||
return dbChannelIO::pFreeList->allocate ( size );
|
||||
}
|
||||
|
||||
inline void dbChannelIO::operator delete ( void *pCadaver, size_t size )
|
||||
{
|
||||
dbChannelIO::pFreeList->release ( pCadaver, size );
|
||||
}
|
||||
|
||||
inline const char *dbChannelIO::pName () const
|
||||
{
|
||||
return addr.precord->name;
|
||||
}
|
||||
|
||||
inline short dbChannelIO::nativeType () const
|
||||
{
|
||||
return this->addr.dbr_field_type;
|
||||
}
|
||||
|
||||
inline void dbChannelIO::callReadNotify ( unsigned type, unsigned long count,
|
||||
cacReadNotify ¬ify )
|
||||
{
|
||||
this->serviceIO.callReadNotify ( this->addr, type, count, notify );
|
||||
}
|
||||
|
||||
inline void dbChannelIO::callStateNotify ( unsigned type, unsigned long count,
|
||||
const struct db_field_log *pfl, cacStateNotify ¬ify )
|
||||
{
|
||||
this->serviceIO.callStateNotify ( this->addr, type, count, pfl, notify );
|
||||
}
|
||||
|
||||
|
||||
#endif // dbChannelIOh
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
|
||||
inline unsigned long dbChannelIO::nativeElementCount () const
|
||||
{
|
||||
if ( this->addr.no_elements >= 0u ) {
|
||||
return static_cast < unsigned long > ( this->addr.no_elements );
|
||||
}
|
||||
return 0u;
|
||||
}
|
||||
|
||||
inline void dbChannelIO::destroy ()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
inline void * dbChannelIO::operator new ( size_t size )
|
||||
{
|
||||
return dbChannelIO::pFreeList->allocate ( size );
|
||||
}
|
||||
|
||||
inline void dbChannelIO::operator delete ( void *pCadaver, size_t size )
|
||||
{
|
||||
dbChannelIO::pFreeList->release ( pCadaver, size );
|
||||
}
|
||||
|
||||
inline const char *dbChannelIO::pName () const
|
||||
{
|
||||
return addr.precord->name;
|
||||
}
|
||||
|
||||
inline short dbChannelIO::nativeType () const
|
||||
{
|
||||
return this->addr.dbr_field_type;
|
||||
}
|
||||
|
||||
inline void dbChannelIO::callReadNotify ( unsigned type, unsigned long count,
|
||||
cacReadNotify ¬ify )
|
||||
{
|
||||
this->serviceIO.callReadNotify ( this->addr, type, count, notify );
|
||||
}
|
||||
|
||||
inline void dbChannelIO::callStateNotify ( unsigned type, unsigned long count,
|
||||
const struct db_field_log *pfl, cacStateNotify ¬ify )
|
||||
{
|
||||
this->serviceIO.callStateNotify ( this->addr, type, count, pfl, notify );
|
||||
}
|
||||
|
||||
@@ -26,27 +26,14 @@
|
||||
#include "epicsSingleton.h"
|
||||
#include "errMdef.h"
|
||||
|
||||
#include "cacIO.h"
|
||||
#include "caerr.h" // this needs to be eliminated
|
||||
#include "db_access.h" // this needs to be eliminated
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbCAC.h"
|
||||
#include "dbChannelIOIL.h"
|
||||
#include "dbChannelIO.h"
|
||||
#include "dbPutNotifyBlocker.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning ( push )
|
||||
# pragma warning ( disable:4660 )
|
||||
#endif
|
||||
|
||||
template class tsFreeList < dbPutNotifyBlocker, 1024 >;
|
||||
template class epicsSingleton < tsFreeList < dbPutNotifyBlocker, 1024 > >;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning ( pop )
|
||||
#endif
|
||||
|
||||
epicsSingleton < tsFreeList < dbPutNotifyBlocker, 1024 > > dbPutNotifyBlocker::pFreeList;
|
||||
|
||||
dbPutNotifyBlocker::dbPutNotifyBlocker ( dbChannelIO &chanIn ) :
|
||||
|
||||
@@ -18,6 +18,22 @@
|
||||
#ifndef dbPutNotifyBlockerh
|
||||
#define dbPutNotifyBlockerh
|
||||
|
||||
#ifdef epicsExportSharedSymbols
|
||||
#define dbPutNotifyBlockerh_restore_epicsExportSharedSymbols
|
||||
#undef epicsExportSharedSymbols
|
||||
#endif
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
#include "tsFreeList.h"
|
||||
#include "epicsSingleton.h"
|
||||
|
||||
#ifdef dbPutNotifyBlockerh_restore_epicsExportSharedSymbols
|
||||
#define epicsExportSharedSymbols
|
||||
#endif
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
class dbPutNotifyBlocker : public dbBaseIO {
|
||||
public:
|
||||
dbPutNotifyBlocker ( dbChannelIO & chanIn );
|
||||
|
||||
+1
-14
@@ -19,7 +19,6 @@
|
||||
#include "epicsMutex.h"
|
||||
#include "tsFreeList.h"
|
||||
|
||||
#include "cacIO.h"
|
||||
#include "cadef.h" // this can be eliminated when the callbacks use the new interface
|
||||
#include "db_access.h" // should be eliminated here in the future
|
||||
#include "caerr.h" // should be eliminated here in the future
|
||||
@@ -30,21 +29,9 @@
|
||||
#define epicsExportSharedSymbols
|
||||
#include "db_access_routines.h"
|
||||
#include "dbCAC.h"
|
||||
#include "dbChannelIOIL.h"
|
||||
#include "dbChannelIO.h"
|
||||
#include "dbPutNotifyBlocker.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning ( push )
|
||||
# pragma warning ( disable:4660 )
|
||||
#endif
|
||||
|
||||
template class resTable < dbBaseIO, chronIntId >;
|
||||
template class chronIntIdResTable < dbBaseIO >;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning ( pop )
|
||||
#endif
|
||||
|
||||
class dbServiceIOLoadTimeInit {
|
||||
public:
|
||||
dbServiceIOLoadTimeInit ();
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "tsFreeList.h"
|
||||
#include "epicsSingleton.h"
|
||||
|
||||
#include "cacIO.h"
|
||||
#include "cadef.h" // this can be eliminated when the callbacks use the new interface
|
||||
#include "db_access.h" // should be eliminated here in the future
|
||||
|
||||
|
||||
@@ -22,27 +22,14 @@
|
||||
#include "tsFreeList.h"
|
||||
#include "epicsSingleton.h"
|
||||
|
||||
#include "cacIO.h"
|
||||
#include "db_access.h" // need to eliminate this
|
||||
#include "cadef.h" // this can be eliminated when the callbacks use the new interface
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbCAC.h"
|
||||
#include "dbChannelIOIL.h"
|
||||
#include "dbChannelIO.h"
|
||||
#include "db_access_routines.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning ( push )
|
||||
# pragma warning ( disable:4660 )
|
||||
#endif
|
||||
|
||||
template class tsFreeList < dbSubscriptionIO >;
|
||||
template class epicsSingleton < tsFreeList < dbSubscriptionIO > >;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning ( pop )
|
||||
#endif
|
||||
|
||||
epicsSingleton < tsFreeList < dbSubscriptionIO > > dbSubscriptionIO::pFreeList;
|
||||
|
||||
dbSubscriptionIO::dbSubscriptionIO ( dbServiceIO &serviceIO, dbChannelIO &chanIO,
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
|
||||
#include "dbCAC.h"
|
||||
#include "dbChannelIO.h"
|
||||
#include "dbPutNotifyBlocker.h"
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning ( push )
|
||||
# pragma warning ( disable:4660 )
|
||||
#endif
|
||||
|
||||
template class tsFreeList < dbChannelIO >;
|
||||
template class epicsSingleton < tsFreeList < dbChannelIO > >;
|
||||
template class tsFreeList < dbPutNotifyBlocker, 1024 >;
|
||||
template class epicsSingleton < tsFreeList < dbPutNotifyBlocker, 1024 > >;
|
||||
template class resTable < dbBaseIO, chronIntId >;
|
||||
template class chronIntIdResTable < dbBaseIO >;
|
||||
template class tsFreeList < dbSubscriptionIO >;
|
||||
template class epicsSingleton < tsFreeList < dbSubscriptionIO > >;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning ( pop )
|
||||
#endif
|
||||
Reference in New Issue
Block a user