fixed ca_name() returns the record name w/o appending the field name

This commit is contained in:
Jeff Hill
2004-10-19 21:05:39 +00:00
parent 3e05c90653
commit 7a5bdb93c4
2 changed files with 21 additions and 4 deletions

View File

@@ -46,6 +46,9 @@ dbChannelIO::dbChannelIO (
cacChannel ( notify ), mutex ( mutexIn ), serviceIO ( serviceIO ),
addr ( addrIn )
{
unsigned bufLen = dbNameSizeOfPV ( & this->addr ) + 1;
this->pNameStr.reset ( new char [ bufLen ] );
dbNameOfPV ( & this->addr, this->pNameStr.get (), bufLen );
}
void dbChannelIO::initiateConnect ( epicsGuard < epicsMutex > & guard )
@@ -175,11 +178,19 @@ unsigned long dbChannelIO::nativeElementCount (
return 0u;
}
const char *dbChannelIO::pName (
epicsGuard < epicsMutex > & guard ) const
// hopefully to be eventually phased out
const char * dbChannelIO::pName (
epicsGuard < epicsMutex > & guard ) const throw ()
{
guard.assertIdenticalMutex ( this->mutex );
return addr.precord->name;
return this->pNameStr.get ();
}
unsigned dbChannelIO::getName (
epicsGuard < epicsMutex > &,
char * pBuf, unsigned bufLen ) const throw ()
{
return dbNameOfPV ( & this->addr, pBuf, bufLen );
}
short dbChannelIO::nativeType (

View File

@@ -36,6 +36,7 @@
#endif
#include "compilerDependencies.h"
#include "epicsMemory.h"
#ifdef dbChannelIOh_restore_epicsExportSharedSymbols
# define epicsExportSharedSymbols
@@ -60,8 +61,11 @@ public:
const struct db_field_log * pfl, cacStateNotify & notify );
void show (
epicsGuard < epicsMutex > &, unsigned level ) const;
unsigned getName (
epicsGuard < epicsMutex > &,
char * pBuf, unsigned bufLen ) const throw ();
const char * pName (
epicsGuard < epicsMutex > & ) const;
epicsGuard < epicsMutex > & ) const throw ();
void * operator new ( size_t size,
tsFreeList < dbChannelIO, 256, epicsMutexNOOP > & );
epicsPlacementDeleteOperator (( void *,
@@ -72,6 +76,8 @@ private:
epicsMutex & mutex;
dbContext & serviceIO;
dbAddr addr;
epics_auto_ptr < char, eapt_array > pNameStr;
void initiateConnect (
epicsGuard < epicsMutex > & );
void eliminateExcessiveSendBacklog (