From ba268dff17f740516374e527f319b8bcacd256cd Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 28 Apr 2000 01:40:08 +0000 Subject: [PATCH] many changes --- src/gdd/dbMapper.cc | 801 +++++++++++++++++++++++--------------------- src/gdd/dbMapper.h | 14 +- 2 files changed, 424 insertions(+), 391 deletions(-) diff --git a/src/gdd/dbMapper.cc b/src/gdd/dbMapper.cc index ca6d03f8c..bc0257fca 100644 --- a/src/gdd/dbMapper.cc +++ b/src/gdd/dbMapper.cc @@ -4,6 +4,9 @@ // $Id$ // // $Log$ +// Revision 1.29 2000/03/09 20:32:03 lange +// Length fix for ControlEnum mapping (analogous to GraphicEnum fixes) as suggested by S. Allison +// // Revision 1.28 2000/03/08 16:25:20 jhill // win32 related keywords // @@ -218,31 +221,33 @@ class dbMapperFixedStringDestructor: public gddDestructor { // the problem is that the value of a string structure is an array, // not just a single element -static gdd* mapStringToGdd(void* v,aitIndex count) { +static smartGDDPointer mapStringToGdd(void* v,aitIndex count) { aitFixedString* db = (aitFixedString*)v; aitEnum to_type = gddDbrToAit[DBR_STRING].type; aitUint16 to_app = gddDbrToAit[DBR_STRING].app; - gdd* dd; if(count<=1) { - dd=new gddScalar(to_app,to_type); + smartGDDPointer dd = new gddScalar(to_app,to_type); + dd->unreference(); dd->put(*db); + return dd; } else { - dd=new gddAtomic(to_app,to_type,1,count); + smartGDDPointer dd=new gddAtomic(to_app,to_type,1,count); + dd->unreference(); aitFixedString* pCopy = new aitFixedString [count]; memcpy (pCopy,db,sizeof(aitFixedString)*count); dd->putRef(db,new dbMapperFixedStringDestructor); + return dd; } - return dd; } -static int mapGddToString(void* vd, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) { +static int mapGddToString(void* vd, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { aitFixedString* db = (aitFixedString*)vd; - aitIndex sz = dd.getDataSizeElements(); - const void* v = dd.dataVoid(); + aitIndex sz = dd->getDataSizeElements(); + const void* v = dd->dataVoid(); int status; if (count>sz) { @@ -252,40 +257,43 @@ static int mapGddToString(void* vd, aitIndex count, const gdd& dd, const std::ve if(local_data_format==aitLocalDataFormat) { if((aitFixedString*)v!=db) { - status = aitConvert(aitEnumFixedString,db,dd.primitiveType(),v,count, enumStringTable); + status = aitConvert(aitEnumFixedString,db,dd->primitiveType(),v,count, enumStringTable); } else { status = sz*sizeof(aitFixedString); } } else { - status = aitConvertToNet(aitEnumFixedString,db,dd.primitiveType(),v,count, enumStringTable); + status = aitConvertToNet(aitEnumFixedString,db,dd->primitiveType(),v,count, enumStringTable); } return status; } -static gdd* mapShortToGdd(void* v,aitIndex count) { +static smartGDDPointer mapShortToGdd(void* v,aitIndex count) { dbr_short_t* sv = (dbr_short_t*)v; - gdd* dd; if(count>1) { - dd=new gddAtomic(gddDbrToAit[DBR_SHORT].app, + smartGDDPointer dd=new gddAtomic(gddDbrToAit[DBR_SHORT].app, gddDbrToAit[DBR_SHORT].type,1,count); + dd->unreference(); dbr_short_t* pCopy = (dbr_short_t*) new char [sizeof(dbr_short_t)*count]; memcpy (pCopy,sv,sizeof(dbr_short_t)*count); dd->putRef(pCopy, new gddDestructor); + return dd; } else { - dd=new gddScalar(gddDbrToAit[DBR_SHORT].app); + smartGDDPointer dd=new gddScalar(gddDbrToAit[DBR_SHORT].app); + dd->unreference(); *dd=*sv; + return dd; } - return dd; } -static int mapGddToShort(void* vd, aitIndex count, const gdd &dd, const std::vector< std::string > &enumStringTable) { +static int mapGddToShort(void* vd, aitIndex count, const smartConstGDDReference &dd, + const std::vector< std::string > &enumStringTable) { dbr_short_t* sv = (dbr_short_t*)vd; - aitIndex sz = dd.getDataSizeElements(); - const void * v=dd.dataVoid(); + aitIndex sz = dd->getDataSizeElements(); + const void * v=dd->dataVoid(); int status; if (count>sz) { @@ -295,40 +303,42 @@ static int mapGddToShort(void* vd, aitIndex count, const gdd &dd, const std::vec if (local_data_format==aitLocalDataFormat) { if((dbr_short_t*)v!=sv) { - status = aitConvert(aitEnumInt16,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvert(aitEnumInt16,sv,dd->primitiveType(),v,count, enumStringTable); } else { status = count*sizeof(dbr_short_t); } } else { - status = aitConvertToNet(aitEnumInt16,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvertToNet(aitEnumInt16,sv,dd->primitiveType(),v,count, enumStringTable); } return status; } -static gdd* mapFloatToGdd(void* v,aitIndex count) { +static smartGDDPointer mapFloatToGdd(void* v,aitIndex count) { dbr_float_t* sv = (dbr_float_t*)v; - gdd* dd; if(count>1) { - dd=new gddAtomic(gddDbrToAit[DBR_FLOAT].app, + smartGDDPointer dd=new gddAtomic(gddDbrToAit[DBR_FLOAT].app, gddDbrToAit[DBR_FLOAT].type,1,count); + dd->unreference(); dbr_float_t* pCopy = (dbr_float_t*) new char [sizeof(dbr_float_t)*count]; memcpy (pCopy,sv,sizeof(dbr_float_t)*count); dd->putRef(pCopy, new gddDestructor); + return dd; } else { - dd=new gddScalar(gddDbrToAit[DBR_FLOAT].app); + smartGDDPointer dd=new gddScalar(gddDbrToAit[DBR_FLOAT].app); + dd->unreference(); *dd=*sv; + return dd; } - return dd; } -static int mapGddToFloat(void* vd, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) { +static int mapGddToFloat(void* vd, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_float_t* sv = (dbr_float_t*)vd; - aitIndex sz=dd.getDataSizeElements(); - const void * v = dd.dataVoid(); + aitIndex sz=dd->getDataSizeElements(); + const void * v = dd->dataVoid(); int status; if (count>sz) { @@ -338,40 +348,42 @@ static int mapGddToFloat(void* vd, aitIndex count, const gdd& dd, const std::vec if(local_data_format==aitLocalDataFormat) { if((dbr_float_t*)v!=sv) { - status = aitConvert(aitEnumFloat32,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvert(aitEnumFloat32,sv,dd->primitiveType(),v,count, enumStringTable); } else { status = sz*sizeof(dbr_float_t); } } else { - status = aitConvertToNet(aitEnumFloat32,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvertToNet(aitEnumFloat32,sv,dd->primitiveType(),v,count, enumStringTable); } return status; } -static gdd* mapEnumToGdd(void* v,aitIndex count) { +static smartGDDPointer mapEnumToGdd(void* v,aitIndex count) { dbr_enum_t* sv = (dbr_enum_t*)v; - gdd* dd; + smartGDDPointer dd; if(count>1) { dd=new gddAtomic(gddDbrToAit[DBR_ENUM].app, gddDbrToAit[DBR_ENUM].type,1,count); + dd->unreference(); dbr_enum_t* pCopy = (dbr_enum_t *) new char [sizeof(dbr_enum_t)*count]; memcpy (pCopy,sv,sizeof(dbr_enum_t)*count); dd->putRef(pCopy, new gddDestructor); } else { dd=new gddScalar(gddDbrToAit[DBR_ENUM].app); + dd->unreference(); *dd=*sv; } return dd; } -static int mapGddToEnum(void* vd, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) { +static int mapGddToEnum(void* vd, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_enum_t* sv = (dbr_enum_t*)vd; - aitIndex sz=dd.getDataSizeElements(); - const void* v = dd.dataVoid(); + aitIndex sz=dd->getDataSizeElements(); + const void* v = dd->dataVoid(); int status; if (count>sz) { @@ -381,40 +393,42 @@ static int mapGddToEnum(void* vd, aitIndex count, const gdd& dd, const std::vect if(local_data_format==aitLocalDataFormat) { if((dbr_enum_t*)v!=sv) { - status = aitConvert(aitEnumEnum16,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvert(aitEnumEnum16,sv,dd->primitiveType(),v,count, enumStringTable); } else { status = sizeof(dbr_enum_t)*count; } } else { - status = aitConvertToNet(aitEnumEnum16,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvertToNet(aitEnumEnum16,sv,dd->primitiveType(),v,count, enumStringTable); } return status; } -static gdd* mapCharToGdd(void* v,aitIndex count) { +static smartGDDPointer mapCharToGdd(void* v,aitIndex count) { dbr_char_t* sv = (dbr_char_t*)v; - gdd* dd; + smartGDDPointer dd; if(count>1) { dd=new gddAtomic(gddDbrToAit[DBR_CHAR].app, gddDbrToAit[DBR_CHAR].type,1,count); + dd->unreference(); dbr_char_t* pCopy = (dbr_char_t *) new char [sizeof(dbr_char_t)*count]; memcpy (pCopy,sv,sizeof(dbr_char_t)*count); dd->putRef(pCopy, new gddDestructor); } else { dd=new gddScalar(gddDbrToAit[DBR_CHAR].app); + dd->unreference(); *dd=*sv; } return dd; } -static int mapGddToChar(void* vd, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) { +static int mapGddToChar(void* vd, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_char_t* sv = (dbr_char_t*)vd; - aitIndex sz=dd.getDataSizeElements(); - const void* v = dd.dataVoid(); + aitIndex sz=dd->getDataSizeElements(); + const void* v = dd->dataVoid(); int status; if (count>sz) { @@ -424,40 +438,42 @@ static int mapGddToChar(void* vd, aitIndex count, const gdd& dd, const std::vect if (local_data_format==aitLocalDataFormat) { if((dbr_char_t*)v!=sv) { - status = aitConvert(aitEnumInt8,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvert(aitEnumInt8,sv,dd->primitiveType(),v,count, enumStringTable); } else { status = sz*sizeof(dbr_char_t); } } else { - status = aitConvertToNet(aitEnumInt8,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvertToNet(aitEnumInt8,sv,dd->primitiveType(),v,count, enumStringTable); } return status; } -static gdd* mapLongToGdd(void* v,aitIndex count) { +static smartGDDPointer mapLongToGdd(void* v,aitIndex count) { dbr_long_t* sv = (dbr_long_t*)v; - gdd* dd; + smartGDDPointer dd; if(count>1) { dd=new gddAtomic(gddDbrToAit[DBR_LONG].app, gddDbrToAit[DBR_LONG].type,1,count); + dd->unreference(); dbr_long_t* pCopy = (dbr_long_t*) new char [sizeof(dbr_long_t)*count]; memcpy (pCopy,sv,sizeof(dbr_long_t)*count); dd->putRef(pCopy, new gddDestructor); } else { dd=new gddScalar(gddDbrToAit[DBR_LONG].app); + dd->unreference(); *dd=*sv; } return dd; } -static int mapGddToLong(void* vd, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) { +static int mapGddToLong(void* vd, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_long_t* sv = (dbr_long_t*)vd; - aitIndex sz=dd.getDataSizeElements(); - const void* v = dd.dataVoid(); + aitIndex sz=dd->getDataSizeElements(); + const void* v = dd->dataVoid(); int status; if (count>sz) { @@ -467,40 +483,42 @@ static int mapGddToLong(void* vd, aitIndex count, const gdd& dd, const std::vect if (local_data_format==aitLocalDataFormat) { if ((dbr_long_t*)v!=sv) { - status = aitConvert(aitEnumInt32,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvert(aitEnumInt32,sv,dd->primitiveType(),v,count, enumStringTable); } else { status = count*sizeof(dbr_long_t); } } else { - status = aitConvertToNet(aitEnumInt32,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvertToNet(aitEnumInt32,sv,dd->primitiveType(),v,count, enumStringTable); } return status; } -static gdd* mapDoubleToGdd(void* v,aitIndex count) { +static smartGDDPointer mapDoubleToGdd(void* v,aitIndex count) { dbr_double_t* sv = (dbr_double_t*)v; - gdd* dd; + smartGDDPointer dd; if(count>1) { dd=new gddAtomic(gddDbrToAit[DBR_DOUBLE].app, gddDbrToAit[DBR_DOUBLE].type,1,count); + dd->unreference(); dbr_double_t* pCopy = (dbr_double_t *) new char [sizeof(dbr_double_t)*count]; memcpy (pCopy,sv,sizeof(dbr_double_t)*count); dd->putRef(pCopy, new gddDestructor); } else { dd=new gddScalar(gddDbrToAit[DBR_DOUBLE].app); + dd->unreference(); *dd=*sv; } return dd; } -static int mapGddToDouble(void* vd, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) { +static int mapGddToDouble(void* vd, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_double_t* sv = (dbr_double_t*)vd; - aitIndex sz=dd.getDataSizeElements(); - const void* v = dd.dataVoid(); + aitIndex sz=dd->getDataSizeElements(); + const void* v = dd->dataVoid(); int status; if (count>sz) { @@ -510,14 +528,14 @@ static int mapGddToDouble(void* vd, aitIndex count, const gdd& dd, const std::ve if (local_data_format==aitLocalDataFormat) { if ((dbr_double_t*)v!=sv) { - status = aitConvert(aitEnumFloat64,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvert(aitEnumFloat64,sv,dd->primitiveType(),v,count, enumStringTable); } else { status = count*sizeof(dbr_double_t); } } else { - status = aitConvertToNet(aitEnumFloat64,sv,dd.primitiveType(),v,count, enumStringTable); + status = aitConvertToNet(aitEnumFloat64,sv,dd->primitiveType(),v,count, enumStringTable); } return status; @@ -527,22 +545,24 @@ static int mapGddToDouble(void* vd, aitIndex count, const gdd& dd, const std::ve // sts structure mappings // ******************************************************************** -static gdd* mapStsStringToGdd(void* v,aitIndex count) +static smartGDDPointer mapStsStringToGdd(void* v,aitIndex count) { dbr_sts_string* db = (dbr_sts_string*)v; aitFixedString* dbv = (aitFixedString*)db->value; aitEnum to_type = gddDbrToAit[DBR_STS_STRING].type; aitUint16 to_app = gddDbrToAit[DBR_STS_STRING].app; - gdd* dd; + smartGDDPointer dd; if(count<=1) { dd=new gddScalar(to_app,to_type); + dd->unreference(); dd->put(*dbv); } else { dd=new gddAtomic(to_app,to_type,1,count); + dd->unreference(); aitFixedString* pCopy = (aitFixedString*) new char [sizeof(aitFixedString)*count]; memcpy (pCopy,dbv,sizeof(aitFixedString)*count); dd->putRef(pCopy, new gddDestructor); @@ -552,103 +572,103 @@ static gdd* mapStsStringToGdd(void* v,aitIndex count) return dd; } -static int mapStsGddToString(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapStsGddToString(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_sts_string* db = (dbr_sts_string*)v; aitFixedString* dbv = (aitFixedString*)db->value; - dd.getStatSevr(db->status,db->severity); + dd->getStatSevr(db->status,db->severity); return mapGddToString(dbv, count, dd, enumStringTable); } -static gdd* mapStsShortToGdd(void* v,aitIndex count) +static smartGDDPointer mapStsShortToGdd(void* v,aitIndex count) { dbr_sts_short* dbv = (dbr_sts_short*)v; - gdd* dd=mapShortToGdd(&dbv->value,count); + smartGDDPointer dd=mapShortToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); return dd; } -static int mapStsGddToShort(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapStsGddToShort(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_sts_short* dbv = (dbr_sts_short*)v; - dd.getStatSevr(dbv->status,dbv->severity); + dd->getStatSevr(dbv->status,dbv->severity); return mapGddToShort(&dbv->value, count, dd, enumStringTable); } -static gdd* mapStsFloatToGdd(void* v,aitIndex count) +static smartGDDPointer mapStsFloatToGdd(void* v,aitIndex count) { dbr_sts_float* dbv = (dbr_sts_float*)v; - gdd* dd=mapFloatToGdd(&dbv->value,count); + smartGDDPointer dd=mapFloatToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); return dd; } -static int mapStsGddToFloat(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapStsGddToFloat(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_sts_float* dbv = (dbr_sts_float*)v; - dd.getStatSevr(dbv->status,dbv->severity); + dd->getStatSevr(dbv->status,dbv->severity); return mapGddToFloat(&dbv->value,count,dd, enumStringTable); } -static gdd* mapStsEnumToGdd(void* v,aitIndex count) +static smartGDDPointer mapStsEnumToGdd(void* v,aitIndex count) { dbr_sts_enum* dbv = (dbr_sts_enum*)v; - gdd* dd=mapEnumToGdd(&dbv->value,count); + smartGDDPointer dd=mapEnumToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); return dd; } -static int mapStsGddToEnum(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapStsGddToEnum(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_sts_enum* dbv = (dbr_sts_enum*)v; - dd.getStatSevr(dbv->status,dbv->severity); + dd->getStatSevr(dbv->status,dbv->severity); return mapGddToEnum(&dbv->value,count,dd, enumStringTable); } -static gdd* mapStsCharToGdd(void* v,aitIndex count) +static smartGDDPointer mapStsCharToGdd(void* v,aitIndex count) { dbr_sts_char* dbv = (dbr_sts_char*)v; - gdd* dd=mapCharToGdd(&dbv->value,count); + smartGDDPointer dd=mapCharToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); return dd; } -static int mapStsGddToChar(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapStsGddToChar(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_sts_char* dbv = (dbr_sts_char*)v; - dd.getStatSevr(dbv->status,dbv->severity); + dd->getStatSevr(dbv->status,dbv->severity); dbv->RISC_pad = '\0'; // shut up purify return mapGddToChar(&dbv->value,count,dd, enumStringTable); } -static gdd* mapStsLongToGdd(void* v,aitIndex count) +static smartGDDPointer mapStsLongToGdd(void* v,aitIndex count) { dbr_sts_long* dbv = (dbr_sts_long*)v; - gdd* dd=mapLongToGdd(&dbv->value,count); + smartGDDPointer dd=mapLongToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); return dd; } -static int mapStsGddToLong(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapStsGddToLong(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_sts_long* dbv = (dbr_sts_long*)v; - dd.getStatSevr(dbv->status,dbv->severity); + dd->getStatSevr(dbv->status,dbv->severity); return mapGddToLong(&dbv->value,count,dd, enumStringTable); } -static gdd* mapStsDoubleToGdd(void* v,aitIndex count) +static smartGDDPointer mapStsDoubleToGdd(void* v,aitIndex count) { dbr_sts_double* dbv = (dbr_sts_double*)v; - gdd* dd=mapDoubleToGdd(&dbv->value,count); + smartGDDPointer dd=mapDoubleToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); return dd; } -static int mapStsGddToDouble(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapStsGddToDouble(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_sts_double* dbv = (dbr_sts_double*)v; - dd.getStatSevr(dbv->status,dbv->severity); + dd->getStatSevr(dbv->status,dbv->severity); dbv->RISC_pad = 0; // shut up purify return mapGddToDouble(&dbv->value,count,dd, enumStringTable); } @@ -657,22 +677,24 @@ static int mapStsGddToDouble(void* v, aitIndex count, const gdd& dd, const std:: // time structure mappings // ******************************************************************** -static gdd* mapTimeStringToGdd(void* v,aitIndex count) +static smartGDDPointer mapTimeStringToGdd(void* v,aitIndex count) { dbr_time_string* db = (dbr_time_string*)v; aitFixedString* dbv = (aitFixedString*)db->value; aitEnum to_type = gddDbrToAit[DBR_TIME_STRING].type; aitUint16 to_app = gddDbrToAit[DBR_TIME_STRING].app; - gdd* dd; + smartGDDPointer dd; if(count<=1) { dd=new gddScalar(to_app,to_type); + dd->unreference(); dd->put(*dbv); } else { dd=new gddAtomic(to_app,to_type,1,count); + dd->unreference(); aitFixedString* pCopy = (aitFixedString*) new char [sizeof(aitFixedString)*count]; memcpy (pCopy,dbv,sizeof(aitFixedString)*count); dd->putRef(pCopy, new gddDestructor); @@ -683,119 +705,119 @@ static gdd* mapTimeStringToGdd(void* v,aitIndex count) return dd; } -static int mapTimeGddToString(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapTimeGddToString(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_time_string* db = (dbr_time_string*)v; aitFixedString* dbv = (aitFixedString*)db->value; - dd.getStatSevr(db->status,db->severity); - dd.getTimeStamp(&db->stamp); + dd->getStatSevr(db->status,db->severity); + dd->getTimeStamp(&db->stamp); return mapGddToString(dbv, count, dd, enumStringTable); } -static gdd* mapTimeShortToGdd(void* v,aitIndex count) +static smartGDDPointer mapTimeShortToGdd(void* v,aitIndex count) { dbr_time_short* dbv = (dbr_time_short*)v; - gdd* dd=mapShortToGdd(&dbv->value,count); + smartGDDPointer dd=mapShortToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); dd->setTimeStamp(&dbv->stamp); return dd; } -static int mapTimeGddToShort(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapTimeGddToShort(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_time_short* dbv = (dbr_time_short*)v; - dd.getStatSevr(dbv->status,dbv->severity); - dd.getTimeStamp(&dbv->stamp); + dd->getStatSevr(dbv->status,dbv->severity); + dd->getTimeStamp(&dbv->stamp); dbv->RISC_pad = 0; // shut up purify return mapGddToShort(&dbv->value,count,dd, enumStringTable); } -static gdd* mapTimeFloatToGdd(void* v,aitIndex count) +static smartGDDPointer mapTimeFloatToGdd(void* v,aitIndex count) { dbr_time_float* dbv = (dbr_time_float*)v; - gdd* dd=mapFloatToGdd(&dbv->value,count); + smartGDDPointer dd=mapFloatToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); dd->setTimeStamp(&dbv->stamp); return dd; } -static int mapTimeGddToFloat(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapTimeGddToFloat(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_time_float* dbv = (dbr_time_float*)v; - dd.getStatSevr(dbv->status,dbv->severity); - dd.getTimeStamp(&dbv->stamp); + dd->getStatSevr(dbv->status,dbv->severity); + dd->getTimeStamp(&dbv->stamp); return mapGddToFloat(&dbv->value,count,dd, enumStringTable); } -static gdd* mapTimeEnumToGdd(void* v,aitIndex count) +static smartGDDPointer mapTimeEnumToGdd(void* v,aitIndex count) { dbr_time_enum* dbv = (dbr_time_enum*)v; - gdd* dd=mapEnumToGdd(&dbv->value,count); + smartGDDPointer dd=mapEnumToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); dd->setTimeStamp(&dbv->stamp); return dd; } -static int mapTimeGddToEnum(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapTimeGddToEnum(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_time_enum* dbv = (dbr_time_enum*)v; - dd.getStatSevr(dbv->status,dbv->severity); - dd.getTimeStamp(&dbv->stamp); + dd->getStatSevr(dbv->status,dbv->severity); + dd->getTimeStamp(&dbv->stamp); dbv->RISC_pad = 0; // shut up purify return mapGddToEnum(&dbv->value,count,dd, enumStringTable); } -static gdd* mapTimeCharToGdd(void* v,aitIndex count) +static smartGDDPointer mapTimeCharToGdd(void* v,aitIndex count) { dbr_time_char* dbv = (dbr_time_char*)v; - gdd* dd=mapCharToGdd(&dbv->value,count); + smartGDDPointer dd=mapCharToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); dd->setTimeStamp(&dbv->stamp); return dd; } -static int mapTimeGddToChar(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapTimeGddToChar(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_time_char* dbv = (dbr_time_char*)v; - dd.getStatSevr(dbv->status,dbv->severity); - dd.getTimeStamp(&dbv->stamp); + dd->getStatSevr(dbv->status,dbv->severity); + dd->getTimeStamp(&dbv->stamp); dbv->RISC_pad0 = 0; // shut up purify dbv->RISC_pad1 = '\0'; // shut up purify return mapGddToChar(&dbv->value,count,dd, enumStringTable); } -static gdd* mapTimeLongToGdd(void* v,aitIndex count) +static smartGDDPointer mapTimeLongToGdd(void* v,aitIndex count) { dbr_time_long* dbv = (dbr_time_long*)v; - gdd* dd=mapLongToGdd(&dbv->value,count); + smartGDDPointer dd=mapLongToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); dd->setTimeStamp(&dbv->stamp); return dd; } -static int mapTimeGddToLong(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapTimeGddToLong(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_time_long* dbv = (dbr_time_long*)v; - dd.getStatSevr(dbv->status,dbv->severity); - dd.getTimeStamp(&dbv->stamp); + dd->getStatSevr(dbv->status,dbv->severity); + dd->getTimeStamp(&dbv->stamp); return mapGddToLong(&dbv->value,count,dd, enumStringTable); } -static gdd* mapTimeDoubleToGdd(void* v,aitIndex count) +static smartGDDPointer mapTimeDoubleToGdd(void* v,aitIndex count) { dbr_time_double* dbv = (dbr_time_double*)v; - gdd* dd=mapDoubleToGdd(&dbv->value,count); + smartGDDPointer dd=mapDoubleToGdd(&dbv->value,count); dd->setStatSevr(dbv->status,dbv->severity); dd->setTimeStamp(&dbv->stamp); return dd; } -static int mapTimeGddToDouble(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapTimeGddToDouble(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_time_double* dbv = (dbr_time_double*)v; - dd.getStatSevr(dbv->status,dbv->severity); - dd.getTimeStamp(&dbv->stamp); + dd->getStatSevr(dbv->status,dbv->severity); + dd->getTimeStamp(&dbv->stamp); dbv->RISC_pad = 0; // shut up purify return mapGddToDouble(&dbv->value,count,dd, enumStringTable); } @@ -805,23 +827,23 @@ static int mapTimeGddToDouble(void* v, aitIndex count, const gdd& dd, const std: // ******************************************************************** // -------------map the short structures---------------- -static gdd* mapGraphicShortToGdd(void* v, aitIndex count) +static smartGDDPointer mapGraphicShortToGdd(void* v, aitIndex count) { // must be a container dbr_gr_short* db = (dbr_gr_short*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_SHORT].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_gr_short_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_SHORT].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_short_value]; aitString* str=NULL; - dd[gddAppTypeIndex_dbr_gr_short_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_gr_short_units].getRef(str); str->copy(db->units); - dd[gddAppTypeIndex_dbr_gr_short_graphicLow]=db->lower_disp_limit; - dd[gddAppTypeIndex_dbr_gr_short_graphicHigh]=db->upper_disp_limit; - dd[gddAppTypeIndex_dbr_gr_short_alarmLow]=db->lower_alarm_limit; - dd[gddAppTypeIndex_dbr_gr_short_alarmHigh]=db->upper_alarm_limit; - dd[gddAppTypeIndex_dbr_gr_short_alarmLowWarning]=db->lower_warning_limit; - dd[gddAppTypeIndex_dbr_gr_short_alarmHighWarning]=db->upper_warning_limit; + (*dd)[gddAppTypeIndex_dbr_gr_short_graphicLow]=db->lower_disp_limit; + (*dd)[gddAppTypeIndex_dbr_gr_short_graphicHigh]=db->upper_disp_limit; + (*dd)[gddAppTypeIndex_dbr_gr_short_alarmLow]=db->lower_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_gr_short_alarmHigh]=db->upper_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_gr_short_alarmLowWarning]=db->lower_warning_limit; + (*dd)[gddAppTypeIndex_dbr_gr_short_alarmHighWarning]=db->upper_warning_limit; vdd.setStatSevr(db->status,db->severity); @@ -840,25 +862,25 @@ static gdd* mapGraphicShortToGdd(void* v, aitIndex count) return dd; } -static gdd* mapControlShortToGdd(void* v, aitIndex count) +static smartGDDPointer mapControlShortToGdd(void* v, aitIndex count) { // must be a container dbr_ctrl_short* db = (dbr_ctrl_short*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_SHORT].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_short_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_SHORT].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_short_value]; aitString* str = NULL; - dd[gddAppTypeIndex_dbr_ctrl_short_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_ctrl_short_units].getRef(str); str->copy(db->units); - dd[gddAppTypeIndex_dbr_ctrl_short_graphicLow]=db->lower_disp_limit; - dd[gddAppTypeIndex_dbr_ctrl_short_graphicHigh]=db->upper_disp_limit; - dd[gddAppTypeIndex_dbr_ctrl_short_controlLow]=db->lower_ctrl_limit; - dd[gddAppTypeIndex_dbr_ctrl_short_controlHigh]=db->upper_ctrl_limit; - dd[gddAppTypeIndex_dbr_ctrl_short_alarmLow]=db->lower_alarm_limit; - dd[gddAppTypeIndex_dbr_ctrl_short_alarmHigh]=db->upper_alarm_limit; - dd[gddAppTypeIndex_dbr_ctrl_short_alarmLowWarning]=db->lower_warning_limit; - dd[gddAppTypeIndex_dbr_ctrl_short_alarmHighWarning]=db->upper_warning_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_short_graphicLow]=db->lower_disp_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_short_graphicHigh]=db->upper_disp_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_short_controlLow]=db->lower_ctrl_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_short_controlHigh]=db->upper_ctrl_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmLow]=db->lower_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmHigh]=db->upper_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmLowWarning]=db->lower_warning_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmHighWarning]=db->upper_warning_limit; vdd.setStatSevr(db->status,db->severity); @@ -877,73 +899,73 @@ static gdd* mapControlShortToGdd(void* v, aitIndex count) return dd; } -static int mapGraphicGddToShort(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapGraphicGddToShort(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { const aitString* str; dbr_gr_short* db = (dbr_gr_short*)v; - const gdd& vdd = dd[gddAppTypeIndex_dbr_gr_short_value]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_short_value]; - dd[gddAppTypeIndex_dbr_gr_short_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_gr_short_units].getRef(str); if(str->string()) { strncpy(db->units,str->string(), sizeof(db->units)); db->units[sizeof(db->units)-1u] = '\0'; } - db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_short_graphicLow]; - db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_short_graphicHigh]; - db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_short_alarmLow]; - db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_gr_short_alarmHigh]; - db->lower_warning_limit=dd[gddAppTypeIndex_dbr_gr_short_alarmLowWarning]; - db->upper_warning_limit=dd[gddAppTypeIndex_dbr_gr_short_alarmHighWarning]; + db->lower_disp_limit=(*dd)[gddAppTypeIndex_dbr_gr_short_graphicLow]; + db->upper_disp_limit=(*dd)[gddAppTypeIndex_dbr_gr_short_graphicHigh]; + db->lower_alarm_limit=(*dd)[gddAppTypeIndex_dbr_gr_short_alarmLow]; + db->upper_alarm_limit=(*dd)[gddAppTypeIndex_dbr_gr_short_alarmHigh]; + db->lower_warning_limit=(*dd)[gddAppTypeIndex_dbr_gr_short_alarmLowWarning]; + db->upper_warning_limit=(*dd)[gddAppTypeIndex_dbr_gr_short_alarmHighWarning]; vdd.getStatSevr(db->status,db->severity); return mapGddToShort(&db->value,count,vdd, enumStringTable); } -static int mapControlGddToShort(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapControlGddToShort(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { const aitString* str; dbr_ctrl_short* db = (dbr_ctrl_short*)v; - const gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_short_value]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_short_value]; - dd[gddAppTypeIndex_dbr_ctrl_short_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_ctrl_short_units].getRef(str); if(str->string()) { strncpy(db->units,str->string(), sizeof(db->units)); db->units[sizeof(db->units)-1u] = '\0'; } - db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_short_graphicLow]; - db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_short_graphicHigh]; - db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_short_controlLow]; - db->upper_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_short_controlHigh]; - db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_short_alarmLow]; - db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_short_alarmHigh]; - db->lower_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_short_alarmLowWarning]; - db->upper_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_short_alarmHighWarning]; + db->lower_disp_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_short_graphicLow]; + db->upper_disp_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_short_graphicHigh]; + db->lower_ctrl_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_short_controlLow]; + db->upper_ctrl_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_short_controlHigh]; + db->lower_alarm_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmLow]; + db->upper_alarm_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmHigh]; + db->lower_warning_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmLowWarning]; + db->upper_warning_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmHighWarning]; vdd.getStatSevr(db->status,db->severity); return mapGddToShort(&db->value,count,vdd, enumStringTable); } // -------------map the float structures---------------- -static gdd* mapGraphicFloatToGdd(void* v, aitIndex count) +static smartGDDPointer mapGraphicFloatToGdd(void* v, aitIndex count) { // must be a container dbr_gr_float* db = (dbr_gr_float*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_FLOAT].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_gr_float_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_FLOAT].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_float_value]; aitString* str = NULL; - dd[gddAppTypeIndex_dbr_gr_float_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_gr_float_units].getRef(str); str->copy(db->units); - dd[gddAppTypeIndex_dbr_gr_float_precision]=db->precision; - dd[gddAppTypeIndex_dbr_gr_float_graphicLow]=db->lower_disp_limit; - dd[gddAppTypeIndex_dbr_gr_float_graphicHigh]=db->upper_disp_limit; - dd[gddAppTypeIndex_dbr_gr_float_alarmLow]=db->lower_alarm_limit; - dd[gddAppTypeIndex_dbr_gr_float_alarmHigh]=db->upper_alarm_limit; - dd[gddAppTypeIndex_dbr_gr_float_alarmLowWarning]=db->lower_warning_limit; - dd[gddAppTypeIndex_dbr_gr_float_alarmHighWarning]=db->upper_warning_limit; + (*dd)[gddAppTypeIndex_dbr_gr_float_precision]=db->precision; + (*dd)[gddAppTypeIndex_dbr_gr_float_graphicLow]=db->lower_disp_limit; + (*dd)[gddAppTypeIndex_dbr_gr_float_graphicHigh]=db->upper_disp_limit; + (*dd)[gddAppTypeIndex_dbr_gr_float_alarmLow]=db->lower_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_gr_float_alarmHigh]=db->upper_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_gr_float_alarmLowWarning]=db->lower_warning_limit; + (*dd)[gddAppTypeIndex_dbr_gr_float_alarmHighWarning]=db->upper_warning_limit; vdd.setStatSevr(db->status,db->severity); @@ -962,26 +984,26 @@ static gdd* mapGraphicFloatToGdd(void* v, aitIndex count) return dd; } -static gdd* mapControlFloatToGdd(void* v, aitIndex count) +static smartGDDPointer mapControlFloatToGdd(void* v, aitIndex count) { // must be a container dbr_ctrl_float* db = (dbr_ctrl_float*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_FLOAT].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_float_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_FLOAT].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_float_value]; aitString* str = NULL; - dd[gddAppTypeIndex_dbr_ctrl_float_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_ctrl_float_units].getRef(str); str->copy(db->units); - dd[gddAppTypeIndex_dbr_ctrl_float_precision]=db->precision; - dd[gddAppTypeIndex_dbr_ctrl_float_graphicLow]=db->lower_disp_limit; - dd[gddAppTypeIndex_dbr_ctrl_float_graphicHigh]=db->upper_disp_limit; - dd[gddAppTypeIndex_dbr_ctrl_float_controlLow]=db->lower_ctrl_limit; - dd[gddAppTypeIndex_dbr_ctrl_float_controlHigh]=db->upper_ctrl_limit; - dd[gddAppTypeIndex_dbr_ctrl_float_alarmLow]=db->lower_alarm_limit; - dd[gddAppTypeIndex_dbr_ctrl_float_alarmHigh]=db->upper_alarm_limit; - dd[gddAppTypeIndex_dbr_ctrl_float_alarmLowWarning]=db->lower_warning_limit; - dd[gddAppTypeIndex_dbr_ctrl_float_alarmHighWarning]=db->upper_warning_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_float_precision]=db->precision; + (*dd)[gddAppTypeIndex_dbr_ctrl_float_graphicLow]=db->lower_disp_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_float_graphicHigh]=db->upper_disp_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_float_controlLow]=db->lower_ctrl_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_float_controlHigh]=db->upper_ctrl_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmLow]=db->lower_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmHigh]=db->upper_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmLowWarning]=db->lower_warning_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmHighWarning]=db->upper_warning_limit; vdd.setStatSevr(db->status,db->severity); @@ -1000,52 +1022,52 @@ static gdd* mapControlFloatToGdd(void* v, aitIndex count) return dd; } -static int mapGraphicGddToFloat(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapGraphicGddToFloat(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { const aitString* str; dbr_gr_float* db = (dbr_gr_float*)v; - const gdd& vdd = dd[gddAppTypeIndex_dbr_gr_float_value]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_float_value]; - dd[gddAppTypeIndex_dbr_gr_float_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_gr_float_units].getRef(str); if(str->string()) { strncpy(db->units,str->string(), sizeof(db->units)); db->units[sizeof(db->units)-1u] = '\0'; } - db->precision=dd[gddAppTypeIndex_dbr_gr_float_precision]; - db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_float_graphicLow]; - db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_float_graphicHigh]; - db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_float_alarmLow]; - db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_gr_float_alarmHigh]; - db->lower_warning_limit=dd[gddAppTypeIndex_dbr_gr_float_alarmLowWarning]; - db->upper_warning_limit=dd[gddAppTypeIndex_dbr_gr_float_alarmHighWarning]; + db->precision=(*dd)[gddAppTypeIndex_dbr_gr_float_precision]; + db->lower_disp_limit=(*dd)[gddAppTypeIndex_dbr_gr_float_graphicLow]; + db->upper_disp_limit=(*dd)[gddAppTypeIndex_dbr_gr_float_graphicHigh]; + db->lower_alarm_limit=(*dd)[gddAppTypeIndex_dbr_gr_float_alarmLow]; + db->upper_alarm_limit=(*dd)[gddAppTypeIndex_dbr_gr_float_alarmHigh]; + db->lower_warning_limit=(*dd)[gddAppTypeIndex_dbr_gr_float_alarmLowWarning]; + db->upper_warning_limit=(*dd)[gddAppTypeIndex_dbr_gr_float_alarmHighWarning]; db->RISC_pad0 = 0; // shut up purify vdd.getStatSevr(db->status,db->severity); return mapGddToFloat(&db->value,count,vdd, enumStringTable); } -static int mapControlGddToFloat(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapControlGddToFloat(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { const aitString* str; dbr_ctrl_float* db = (dbr_ctrl_float*)v; - const gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_float_value]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_float_value]; - dd[gddAppTypeIndex_dbr_ctrl_float_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_ctrl_float_units].getRef(str); if(str->string()) { strncpy(db->units,str->string(), sizeof(db->units)); db->units[sizeof(db->units)-1u] = '\0'; } - db->precision=dd[gddAppTypeIndex_dbr_ctrl_float_precision]; - db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_float_graphicLow]; - db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_float_graphicHigh]; - db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_float_controlLow]; - db->upper_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_float_controlHigh]; - db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_float_alarmLow]; - db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_float_alarmHigh]; - db->lower_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_float_alarmLowWarning]; - db->upper_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_float_alarmHighWarning]; + db->precision=(*dd)[gddAppTypeIndex_dbr_ctrl_float_precision]; + db->lower_disp_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_float_graphicLow]; + db->upper_disp_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_float_graphicHigh]; + db->lower_ctrl_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_float_controlLow]; + db->upper_ctrl_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_float_controlHigh]; + db->lower_alarm_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmLow]; + db->upper_alarm_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmHigh]; + db->lower_warning_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmLowWarning]; + db->upper_warning_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmHighWarning]; db->RISC_pad = 0; // shut up purify vdd.getStatSevr(db->status,db->severity); @@ -1053,12 +1075,12 @@ static int mapControlGddToFloat(void* v, aitIndex count, const gdd& dd, const st } // -------------map the enum structures---------------- -static gdd* mapGraphicEnumToGdd(void* v, aitIndex /*count*/) +static smartGDDPointer mapGraphicEnumToGdd(void* v, aitIndex /*count*/) { dbr_gr_enum* db = (dbr_gr_enum*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_ENUM].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_gr_enum_value]; - gdd& menu = dd[gddAppTypeIndex_dbr_gr_enum_enums]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_ENUM].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_enum_value]; + gdd& menu = (*dd)[gddAppTypeIndex_dbr_gr_enum_enums]; aitFixedString* str = menu; //aitFixedString* f = (aitFixedString*)db->strs; aitIndex sz,i; @@ -1095,12 +1117,12 @@ static gdd* mapGraphicEnumToGdd(void* v, aitIndex /*count*/) return dd; } -static gdd* mapControlEnumToGdd(void* v, aitIndex /*count*/) +static smartGDDPointer mapControlEnumToGdd(void* v, aitIndex /*count*/) { dbr_ctrl_enum* db = (dbr_ctrl_enum*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_ENUM].app); - gdd& menu = dd[gddAppTypeIndex_dbr_ctrl_enum_enums]; - gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_enum_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_ENUM].app); + gdd& menu = (*dd)[gddAppTypeIndex_dbr_ctrl_enum_enums]; + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_enum_value]; aitFixedString* str = menu; //aitFixedString* f = (aitFixedString*)db->strs; aitIndex sz,i; @@ -1137,11 +1159,11 @@ static gdd* mapControlEnumToGdd(void* v, aitIndex /*count*/) return dd; } -static int mapGraphicGddToEnum(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapGraphicGddToEnum(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_gr_enum* db = (dbr_gr_enum*)v; - const gdd& menu = dd[gddAppTypeIndex_dbr_gr_enum_enums]; - const gdd& vdd = dd[gddAppTypeIndex_dbr_gr_enum_value]; + const gdd& menu = (*dd)[gddAppTypeIndex_dbr_gr_enum_enums]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_enum_value]; const aitFixedString* str = menu; aitFixedString* f = (aitFixedString*)db->strs; int i; @@ -1160,11 +1182,11 @@ static int mapGraphicGddToEnum(void* v, aitIndex count, const gdd& dd, const std return mapGddToEnum(&db->value, count, vdd, enumStringTable); } -static int mapControlGddToEnum(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapControlGddToEnum(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { dbr_ctrl_enum* db = (dbr_ctrl_enum*)v; - const gdd& menu = dd[gddAppTypeIndex_dbr_ctrl_enum_enums]; - const gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_enum_value]; + const gdd& menu = (*dd)[gddAppTypeIndex_dbr_ctrl_enum_enums]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_enum_value]; const aitFixedString* str = menu; aitFixedString* f = (aitFixedString*)db->strs; int i; @@ -1184,23 +1206,23 @@ static int mapControlGddToEnum(void* v, aitIndex count, const gdd& dd, const std } // -------------map the char structures---------------- -static gdd* mapGraphicCharToGdd(void* v, aitIndex count) +static smartGDDPointer mapGraphicCharToGdd(void* v, aitIndex count) { // must be a container dbr_gr_char* db = (dbr_gr_char*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_CHAR].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_gr_char_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_CHAR].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_char_value]; aitString* str = NULL; - dd[gddAppTypeIndex_dbr_gr_char_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_gr_char_units].getRef(str); str->copy(db->units); - dd[gddAppTypeIndex_dbr_gr_char_graphicLow]=db->lower_disp_limit; - dd[gddAppTypeIndex_dbr_gr_char_graphicHigh]=db->upper_disp_limit; - dd[gddAppTypeIndex_dbr_gr_char_alarmLow]=db->lower_alarm_limit; - dd[gddAppTypeIndex_dbr_gr_char_alarmHigh]=db->upper_alarm_limit; - dd[gddAppTypeIndex_dbr_gr_char_alarmLowWarning]=db->lower_warning_limit; - dd[gddAppTypeIndex_dbr_gr_char_alarmHighWarning]=db->upper_warning_limit; + (*dd)[gddAppTypeIndex_dbr_gr_char_graphicLow]=db->lower_disp_limit; + (*dd)[gddAppTypeIndex_dbr_gr_char_graphicHigh]=db->upper_disp_limit; + (*dd)[gddAppTypeIndex_dbr_gr_char_alarmLow]=db->lower_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_gr_char_alarmHigh]=db->upper_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_gr_char_alarmLowWarning]=db->lower_warning_limit; + (*dd)[gddAppTypeIndex_dbr_gr_char_alarmHighWarning]=db->upper_warning_limit; vdd.setStatSevr(db->status,db->severity); @@ -1219,25 +1241,25 @@ static gdd* mapGraphicCharToGdd(void* v, aitIndex count) return dd; } -static gdd* mapControlCharToGdd(void* v, aitIndex count) +static smartGDDPointer mapControlCharToGdd(void* v, aitIndex count) { // must be a container dbr_ctrl_char* db = (dbr_ctrl_char*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_CHAR].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_char_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_CHAR].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_char_value]; aitString* str = NULL; - dd[gddAppTypeIndex_dbr_ctrl_char_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_ctrl_char_units].getRef(str); str->copy(db->units); - dd[gddAppTypeIndex_dbr_ctrl_char_graphicLow]=db->lower_disp_limit; - dd[gddAppTypeIndex_dbr_ctrl_char_graphicHigh]=db->upper_disp_limit; - dd[gddAppTypeIndex_dbr_ctrl_char_controlLow]=db->lower_ctrl_limit; - dd[gddAppTypeIndex_dbr_ctrl_char_controlHigh]=db->upper_ctrl_limit; - dd[gddAppTypeIndex_dbr_ctrl_char_alarmLow]=db->lower_alarm_limit; - dd[gddAppTypeIndex_dbr_ctrl_char_alarmHigh]=db->upper_alarm_limit; - dd[gddAppTypeIndex_dbr_ctrl_char_alarmLowWarning]=db->lower_warning_limit; - dd[gddAppTypeIndex_dbr_ctrl_char_alarmHighWarning]=db->upper_warning_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_char_graphicLow]=db->lower_disp_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_char_graphicHigh]=db->upper_disp_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_char_controlLow]=db->lower_ctrl_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_char_controlHigh]=db->upper_ctrl_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmLow]=db->lower_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmHigh]=db->upper_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmLowWarning]=db->lower_warning_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmHighWarning]=db->upper_warning_limit; vdd.setStatSevr(db->status,db->severity); @@ -1256,50 +1278,50 @@ static gdd* mapControlCharToGdd(void* v, aitIndex count) return dd; } -static int mapGraphicGddToChar(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapGraphicGddToChar(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { const aitString* str; dbr_gr_char* db = (dbr_gr_char*)v; - const gdd& vdd = dd[gddAppTypeIndex_dbr_gr_char_value]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_char_value]; - dd[gddAppTypeIndex_dbr_gr_char_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_gr_char_units].getRef(str); if(str->string()) { strncpy(db->units,str->string(), sizeof(db->units)); db->units[sizeof(db->units)-1u] = '\0'; } - db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_char_graphicLow]; - db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_char_graphicHigh]; - db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_char_alarmLow]; - db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_gr_char_alarmHigh]; - db->lower_warning_limit=dd[gddAppTypeIndex_dbr_gr_char_alarmLowWarning]; - db->upper_warning_limit=dd[gddAppTypeIndex_dbr_gr_char_alarmHighWarning]; + db->lower_disp_limit=(*dd)[gddAppTypeIndex_dbr_gr_char_graphicLow]; + db->upper_disp_limit=(*dd)[gddAppTypeIndex_dbr_gr_char_graphicHigh]; + db->lower_alarm_limit=(*dd)[gddAppTypeIndex_dbr_gr_char_alarmLow]; + db->upper_alarm_limit=(*dd)[gddAppTypeIndex_dbr_gr_char_alarmHigh]; + db->lower_warning_limit=(*dd)[gddAppTypeIndex_dbr_gr_char_alarmLowWarning]; + db->upper_warning_limit=(*dd)[gddAppTypeIndex_dbr_gr_char_alarmHighWarning]; db->RISC_pad = 0; vdd.getStatSevr(db->status,db->severity); return mapGddToChar(&db->value,count,vdd, enumStringTable); } -static int mapControlGddToChar(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapControlGddToChar(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { const aitString* str; dbr_ctrl_char* db = (dbr_ctrl_char*)v; - const gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_char_value]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_char_value]; - dd[gddAppTypeIndex_dbr_ctrl_char_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_ctrl_char_units].getRef(str); if(str->string()) { strncpy(db->units,str->string(), sizeof(db->units)); db->units[sizeof(db->units)-1u] = '\0'; } - db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_char_graphicLow]; - db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_char_graphicHigh]; - db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_char_controlLow]; - db->upper_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_char_controlHigh]; - db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_char_alarmLow]; - db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_char_alarmHigh]; - db->lower_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_char_alarmLowWarning]; - db->upper_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_char_alarmHighWarning]; + db->lower_disp_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_char_graphicLow]; + db->upper_disp_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_char_graphicHigh]; + db->lower_ctrl_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_char_controlLow]; + db->upper_ctrl_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_char_controlHigh]; + db->lower_alarm_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmLow]; + db->upper_alarm_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmHigh]; + db->lower_warning_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmLowWarning]; + db->upper_warning_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmHighWarning]; db->RISC_pad = '\0'; // shut up purify vdd.getStatSevr(db->status,db->severity); @@ -1307,23 +1329,23 @@ static int mapControlGddToChar(void* v, aitIndex count, const gdd& dd, const std } // -------------map the long structures---------------- -static gdd* mapGraphicLongToGdd(void* v, aitIndex count) +static smartGDDPointer mapGraphicLongToGdd(void* v, aitIndex count) { // must be a container dbr_gr_long* db = (dbr_gr_long*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_LONG].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_gr_long_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_LONG].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_long_value]; aitString* str = NULL; - dd[gddAppTypeIndex_dbr_gr_long_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_gr_long_units].getRef(str); str->copy(db->units); - dd[gddAppTypeIndex_dbr_gr_long_graphicLow]=db->lower_disp_limit; - dd[gddAppTypeIndex_dbr_gr_long_graphicHigh]=db->upper_disp_limit; - dd[gddAppTypeIndex_dbr_gr_long_alarmLow]=db->lower_alarm_limit; - dd[gddAppTypeIndex_dbr_gr_long_alarmHigh]=db->upper_alarm_limit; - dd[gddAppTypeIndex_dbr_gr_long_alarmLowWarning]=db->lower_warning_limit; - dd[gddAppTypeIndex_dbr_gr_long_alarmHighWarning]=db->upper_warning_limit; + (*dd)[gddAppTypeIndex_dbr_gr_long_graphicLow]=db->lower_disp_limit; + (*dd)[gddAppTypeIndex_dbr_gr_long_graphicHigh]=db->upper_disp_limit; + (*dd)[gddAppTypeIndex_dbr_gr_long_alarmLow]=db->lower_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_gr_long_alarmHigh]=db->upper_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_gr_long_alarmLowWarning]=db->lower_warning_limit; + (*dd)[gddAppTypeIndex_dbr_gr_long_alarmHighWarning]=db->upper_warning_limit; vdd.setStatSevr(db->status,db->severity); @@ -1342,25 +1364,25 @@ static gdd* mapGraphicLongToGdd(void* v, aitIndex count) return dd; } -static gdd* mapControlLongToGdd(void* v, aitIndex count) +static smartGDDPointer mapControlLongToGdd(void* v, aitIndex count) { // must be a container dbr_ctrl_long* db = (dbr_ctrl_long*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_LONG].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_long_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_LONG].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_long_value]; aitString* str = NULL; - dd[gddAppTypeIndex_dbr_ctrl_long_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_ctrl_long_units].getRef(str); str->copy(db->units); - dd[gddAppTypeIndex_dbr_ctrl_long_graphicLow]=db->lower_disp_limit; - dd[gddAppTypeIndex_dbr_ctrl_long_graphicHigh]=db->upper_disp_limit; - dd[gddAppTypeIndex_dbr_ctrl_long_controlLow]=db->lower_ctrl_limit; - dd[gddAppTypeIndex_dbr_ctrl_long_controlHigh]=db->upper_ctrl_limit; - dd[gddAppTypeIndex_dbr_ctrl_long_alarmLow]=db->lower_alarm_limit; - dd[gddAppTypeIndex_dbr_ctrl_long_alarmHigh]=db->upper_alarm_limit; - dd[gddAppTypeIndex_dbr_ctrl_long_alarmLowWarning]=db->lower_warning_limit; - dd[gddAppTypeIndex_dbr_ctrl_long_alarmHighWarning]=db->upper_warning_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_long_graphicLow]=db->lower_disp_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_long_graphicHigh]=db->upper_disp_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_long_controlLow]=db->lower_ctrl_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_long_controlHigh]=db->upper_ctrl_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmLow]=db->lower_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmHigh]=db->upper_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmLowWarning]=db->lower_warning_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmHighWarning]=db->upper_warning_limit; vdd.setStatSevr(db->status,db->severity); @@ -1379,73 +1401,73 @@ static gdd* mapControlLongToGdd(void* v, aitIndex count) return dd; } -static int mapGraphicGddToLong(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapGraphicGddToLong(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { const aitString* str; dbr_gr_long* db = (dbr_gr_long*)v; - const gdd& vdd = dd[gddAppTypeIndex_dbr_gr_long_value]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_long_value]; - dd[gddAppTypeIndex_dbr_gr_long_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_gr_long_units].getRef(str); if(str->string()) { strncpy(db->units,str->string(), sizeof(db->units)); db->units[sizeof(db->units)-1u] = '\0'; } - db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_long_graphicLow]; - db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_long_graphicHigh]; - db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_long_alarmLow]; - db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_gr_long_alarmHigh]; - db->lower_warning_limit=dd[gddAppTypeIndex_dbr_gr_long_alarmLowWarning]; - db->upper_warning_limit=dd[gddAppTypeIndex_dbr_gr_long_alarmHighWarning]; + db->lower_disp_limit=(*dd)[gddAppTypeIndex_dbr_gr_long_graphicLow]; + db->upper_disp_limit=(*dd)[gddAppTypeIndex_dbr_gr_long_graphicHigh]; + db->lower_alarm_limit=(*dd)[gddAppTypeIndex_dbr_gr_long_alarmLow]; + db->upper_alarm_limit=(*dd)[gddAppTypeIndex_dbr_gr_long_alarmHigh]; + db->lower_warning_limit=(*dd)[gddAppTypeIndex_dbr_gr_long_alarmLowWarning]; + db->upper_warning_limit=(*dd)[gddAppTypeIndex_dbr_gr_long_alarmHighWarning]; vdd.getStatSevr(db->status,db->severity); return mapGddToLong(&db->value,count,vdd, enumStringTable); } -static int mapControlGddToLong(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapControlGddToLong(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { const aitString* str; dbr_ctrl_long* db = (dbr_ctrl_long*)v; - const gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_long_value]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_long_value]; - dd[gddAppTypeIndex_dbr_ctrl_long_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_ctrl_long_units].getRef(str); if(str->string()) { strncpy(db->units,str->string(), sizeof(db->units)); db->units[sizeof(db->units)-1u] = '\0'; } - db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_long_graphicLow]; - db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_long_graphicHigh]; - db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_long_controlLow]; - db->upper_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_long_controlHigh]; - db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_long_alarmLow]; - db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_long_alarmHigh]; - db->lower_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_long_alarmLowWarning]; - db->upper_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_long_alarmHighWarning]; + db->lower_disp_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_long_graphicLow]; + db->upper_disp_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_long_graphicHigh]; + db->lower_ctrl_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_long_controlLow]; + db->upper_ctrl_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_long_controlHigh]; + db->lower_alarm_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmLow]; + db->upper_alarm_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmHigh]; + db->lower_warning_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmLowWarning]; + db->upper_warning_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmHighWarning]; vdd.getStatSevr(db->status,db->severity); return mapGddToLong(&db->value,count,vdd, enumStringTable); } // -------------map the double structures---------------- -static gdd* mapGraphicDoubleToGdd(void* v, aitIndex count) +static smartGDDPointer mapGraphicDoubleToGdd(void* v, aitIndex count) { // must be a container dbr_gr_double* db = (dbr_gr_double*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_DOUBLE].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_gr_double_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_DOUBLE].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_double_value]; aitString* str = NULL; - dd[gddAppTypeIndex_dbr_gr_double_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_gr_double_units].getRef(str); str->copy(db->units); - dd[gddAppTypeIndex_dbr_gr_double_precision]=db->precision; - dd[gddAppTypeIndex_dbr_gr_double_graphicLow]=db->lower_disp_limit; - dd[gddAppTypeIndex_dbr_gr_double_graphicHigh]=db->upper_disp_limit; - dd[gddAppTypeIndex_dbr_gr_double_alarmLow]=db->lower_alarm_limit; - dd[gddAppTypeIndex_dbr_gr_double_alarmHigh]=db->upper_alarm_limit; - dd[gddAppTypeIndex_dbr_gr_double_alarmLowWarning]=db->lower_warning_limit; - dd[gddAppTypeIndex_dbr_gr_double_alarmHighWarning]=db->upper_warning_limit; + (*dd)[gddAppTypeIndex_dbr_gr_double_precision]=db->precision; + (*dd)[gddAppTypeIndex_dbr_gr_double_graphicLow]=db->lower_disp_limit; + (*dd)[gddAppTypeIndex_dbr_gr_double_graphicHigh]=db->upper_disp_limit; + (*dd)[gddAppTypeIndex_dbr_gr_double_alarmLow]=db->lower_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_gr_double_alarmHigh]=db->upper_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_gr_double_alarmLowWarning]=db->lower_warning_limit; + (*dd)[gddAppTypeIndex_dbr_gr_double_alarmHighWarning]=db->upper_warning_limit; vdd.setStatSevr(db->status,db->severity); @@ -1464,26 +1486,26 @@ static gdd* mapGraphicDoubleToGdd(void* v, aitIndex count) return dd; } -static gdd* mapControlDoubleToGdd(void* v, aitIndex count) +static smartGDDPointer mapControlDoubleToGdd(void* v, aitIndex count) { // must be a container dbr_ctrl_double* db = (dbr_ctrl_double*)v; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_DOUBLE].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_double_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_DOUBLE].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_double_value]; aitString* str = NULL; - dd[gddAppTypeIndex_dbr_ctrl_double_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_ctrl_double_units].getRef(str); str->copy(db->units); - dd[gddAppTypeIndex_dbr_ctrl_double_precision]=db->precision; - dd[gddAppTypeIndex_dbr_ctrl_double_graphicLow]=db->lower_disp_limit; - dd[gddAppTypeIndex_dbr_ctrl_double_graphicHigh]=db->upper_disp_limit; - dd[gddAppTypeIndex_dbr_ctrl_double_controlLow]=db->lower_ctrl_limit; - dd[gddAppTypeIndex_dbr_ctrl_double_controlHigh]=db->upper_ctrl_limit; - dd[gddAppTypeIndex_dbr_ctrl_double_alarmLow]=db->lower_alarm_limit; - dd[gddAppTypeIndex_dbr_ctrl_double_alarmHigh]=db->upper_alarm_limit; - dd[gddAppTypeIndex_dbr_ctrl_double_alarmLowWarning]=db->lower_warning_limit; - dd[gddAppTypeIndex_dbr_ctrl_double_alarmHighWarning]=db->upper_warning_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_double_precision]=db->precision; + (*dd)[gddAppTypeIndex_dbr_ctrl_double_graphicLow]=db->lower_disp_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_double_graphicHigh]=db->upper_disp_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_double_controlLow]=db->lower_ctrl_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_double_controlHigh]=db->upper_ctrl_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmLow]=db->lower_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmHigh]=db->upper_alarm_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmLowWarning]=db->lower_warning_limit; + (*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmHighWarning]=db->upper_warning_limit; vdd.setStatSevr(db->status,db->severity); @@ -1502,68 +1524,68 @@ static gdd* mapControlDoubleToGdd(void* v, aitIndex count) return dd; } -static int mapGraphicGddToDouble(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapGraphicGddToDouble(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { const aitString* str; dbr_gr_double* db = (dbr_gr_double*)v; - const gdd& vdd = dd[gddAppTypeIndex_dbr_gr_double_value]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_double_value]; - dd[gddAppTypeIndex_dbr_gr_double_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_gr_double_units].getRef(str); if(str->string()) { strncpy(db->units,str->string(), sizeof(db->units)); db->units[sizeof(db->units)-1u] = '\0'; } - db->precision=dd[gddAppTypeIndex_dbr_gr_double_precision]; - db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_double_graphicLow]; - db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_double_graphicHigh]; - db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_double_alarmLow]; - db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_gr_double_alarmHigh]; - db->lower_warning_limit=dd[gddAppTypeIndex_dbr_gr_double_alarmLowWarning]; - db->upper_warning_limit=dd[gddAppTypeIndex_dbr_gr_double_alarmHighWarning]; + db->precision=(*dd)[gddAppTypeIndex_dbr_gr_double_precision]; + db->lower_disp_limit=(*dd)[gddAppTypeIndex_dbr_gr_double_graphicLow]; + db->upper_disp_limit=(*dd)[gddAppTypeIndex_dbr_gr_double_graphicHigh]; + db->lower_alarm_limit=(*dd)[gddAppTypeIndex_dbr_gr_double_alarmLow]; + db->upper_alarm_limit=(*dd)[gddAppTypeIndex_dbr_gr_double_alarmHigh]; + db->lower_warning_limit=(*dd)[gddAppTypeIndex_dbr_gr_double_alarmLowWarning]; + db->upper_warning_limit=(*dd)[gddAppTypeIndex_dbr_gr_double_alarmHighWarning]; db->RISC_pad0 = 0; // shut up purify vdd.getStatSevr(db->status,db->severity); return mapGddToDouble(&db->value,count,vdd, enumStringTable); } -static int mapControlGddToDouble(void* v, aitIndex count, const gdd& dd, const std::vector< std::string > &enumStringTable) +static int mapControlGddToDouble(void* v, aitIndex count, const smartConstGDDReference & dd, const std::vector< std::string > &enumStringTable) { const aitString* str; dbr_ctrl_double* db = (dbr_ctrl_double*)v; - const gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_double_value]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_double_value]; - dd[gddAppTypeIndex_dbr_ctrl_double_units].getRef(str); + (*dd)[gddAppTypeIndex_dbr_ctrl_double_units].getRef(str); if(str->string()) { strncpy(db->units,str->string(), sizeof(db->units)); db->units[sizeof(db->units)-1u] = '\0'; } - db->precision=dd[gddAppTypeIndex_dbr_ctrl_double_precision]; - db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_double_graphicLow]; - db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_double_graphicHigh]; - db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_double_controlLow]; - db->upper_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_double_controlHigh]; - db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_double_alarmLow]; - db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_double_alarmHigh]; - db->lower_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_double_alarmLowWarning]; - db->upper_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_double_alarmHighWarning]; + db->precision=(*dd)[gddAppTypeIndex_dbr_ctrl_double_precision]; + db->lower_disp_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_double_graphicLow]; + db->upper_disp_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_double_graphicHigh]; + db->lower_ctrl_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_double_controlLow]; + db->upper_ctrl_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_double_controlHigh]; + db->lower_alarm_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmLow]; + db->upper_alarm_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmHigh]; + db->lower_warning_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmLowWarning]; + db->upper_warning_limit=(*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmHighWarning]; db->RISC_pad0 = '\0'; // shut up purify vdd.getStatSevr(db->status,db->severity); return mapGddToDouble(&db->value,count,vdd, enumStringTable); } -static gdd* mapStsAckStringToGdd(void* v, aitIndex count) +static smartGDDPointer mapStsAckStringToGdd(void* v, aitIndex count) { // must be a container dbr_stsack_string* db = (dbr_stsack_string*)v; aitFixedString* dbv = (aitFixedString*)db->value; - gdd* dd = type_table->getDD(gddDbrToAit[DBR_STSACK_STRING].app); - gdd& vdd = dd[gddAppTypeIndex_dbr_stsack_string_value]; + smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_STSACK_STRING].app); + gdd& vdd = (*dd)[gddAppTypeIndex_dbr_stsack_string_value]; - dd[gddAppTypeIndex_dbr_stsack_string_ackt]=db->ackt; - dd[gddAppTypeIndex_dbr_stsack_string_acks]=db->acks; + (*dd)[gddAppTypeIndex_dbr_stsack_string_ackt]=db->ackt; + (*dd)[gddAppTypeIndex_dbr_stsack_string_acks]=db->acks; vdd.setStatSevr(db->status,db->severity); @@ -1583,13 +1605,14 @@ static gdd* mapStsAckStringToGdd(void* v, aitIndex count) return dd; } -static int mapStsAckGddToString(void* v, aitIndex count, const gdd &dd, const std::vector< std::string > &enumStringTable) +static int mapStsAckGddToString(void* v, aitIndex count, const smartConstGDDReference &dd, + const std::vector< std::string > &enumStringTable) { dbr_stsack_string* db = (dbr_stsack_string*)v; - const gdd& vdd = dd[gddAppTypeIndex_dbr_stsack_string_value]; + const gdd& vdd = (*dd)[gddAppTypeIndex_dbr_stsack_string_value]; - db->ackt=dd[gddAppTypeIndex_dbr_stsack_string_ackt]; - db->acks=dd[gddAppTypeIndex_dbr_stsack_string_acks]; + db->ackt=(*dd)[gddAppTypeIndex_dbr_stsack_string_ackt]; + db->acks=(*dd)[gddAppTypeIndex_dbr_stsack_string_acks]; // Unlike all the others, which are dbr_short_t, status and // severity for a dbr_stsack_string are dbr_ushort_t. Have to @@ -1602,29 +1625,31 @@ static int mapStsAckGddToString(void* v, aitIndex count, const gdd &dd, const st } // -------------map the ack elements -------------------- -static gdd* mapAcktToGdd(void* v,aitIndex count) { +static smartGDDPointer mapAcktToGdd(void* v,aitIndex count) { dbr_put_ackt_t* sv = (dbr_put_ackt_t*)v; - gdd* dd; + smartGDDPointer dd; // Count should be 1, but leave it general if(count>1) { dd=new gddAtomic(gddDbrToAit[DBR_PUT_ACKT].app, gddDbrToAit[DBR_PUT_ACKT].type,1,count); - + dd->unreference(); dbr_put_ackt_t* pCopy = (dbr_put_ackt_t*) new char [sizeof(dbr_put_ackt_t)*count]; memcpy (pCopy,sv,sizeof(dbr_put_ackt_t)*count); dd->putRef(pCopy, new gddDestructor); } else { dd=new gddScalar(gddDbrToAit[DBR_PUT_ACKT].app); + dd->unreference(); *dd=*sv; } return dd; } -static int mapGddToAckt(void* vd, aitIndex count, const gdd &dd, const std::vector< std::string > &enumStringTable) { +static int mapGddToAckt(void* vd, aitIndex count, const smartConstGDDReference & dd, + const std::vector< std::string > &enumStringTable) { dbr_put_ackt_t* sv = (dbr_put_ackt_t*)vd; - aitIndex sz = dd.getDataSizeElements(); - const void* v=dd.dataVoid(); + aitIndex sz = (*dd).getDataSizeElements(); + const void* v=(*dd).dataVoid(); int status; // Count should be 1, but leave it general @@ -1632,7 +1657,7 @@ static int mapGddToAckt(void* vd, aitIndex count, const gdd &dd, const std::vect if (local_data_format==aitLocalDataFormat) { if((dbr_put_ackt_t*)v!=sv) { status = - aitConvert(aitEnumUint16,sv,dd.primitiveType(),v,sz,enumStringTable); + aitConvert(aitEnumUint16,sv,(*dd).primitiveType(),v,sz,enumStringTable); } else { status = sz*sizeof(dbr_put_ackt_t); @@ -1640,7 +1665,7 @@ static int mapGddToAckt(void* vd, aitIndex count, const gdd &dd, const std::vect } else { status = - aitConvertToNet(aitEnumUint16,sv,dd.primitiveType(),v,sz, enumStringTable); + aitConvertToNet(aitEnumUint16,sv,(*dd).primitiveType(),v,sz, enumStringTable); } } else { @@ -1650,29 +1675,31 @@ static int mapGddToAckt(void* vd, aitIndex count, const gdd &dd, const std::vect return status; } -static gdd* mapAcksToGdd(void* v,aitIndex count) { +static smartGDDPointer mapAcksToGdd(void* v,aitIndex count) { dbr_put_acks_t* sv = (dbr_put_acks_t*)v; - gdd* dd; + smartGDDPointer dd; // Count should be 1, but leave it general if(count>1) { dd=new gddAtomic(gddDbrToAit[DBR_PUT_ACKS].app, gddDbrToAit[DBR_PUT_ACKS].type,1,count); - + dd->unreference(); dbr_put_acks_t* pCopy = (dbr_put_acks_t*) new char [sizeof(dbr_put_acks_t)*count]; memcpy (pCopy,sv,sizeof(dbr_put_acks_t)*count); dd->putRef(pCopy, new gddDestructor); } else { dd=new gddScalar(gddDbrToAit[DBR_PUT_ACKS].app); + dd->unreference(); *dd=*sv; } return dd; } -static int mapGddToAcks(void* vd, aitIndex count, const gdd &dd, const std::vector< std::string > &enumStringTable) { +static int mapGddToAcks(void* vd, aitIndex count, const smartConstGDDReference &dd, + const std::vector< std::string > &enumStringTable) { dbr_put_acks_t* sv = (dbr_put_acks_t*)vd; - aitIndex sz = dd.getDataSizeElements(); - const void* v=dd.dataVoid(); + aitIndex sz = (*dd).getDataSizeElements(); + const void* v=(*dd).dataVoid(); int status; // Count should be 1, but leave it general @@ -1680,7 +1707,7 @@ static int mapGddToAcks(void* vd, aitIndex count, const gdd &dd, const std::vect if (local_data_format==aitLocalDataFormat) { if((dbr_put_acks_t*)v!=sv) { status = - aitConvert(aitEnumUint16,sv,dd.primitiveType(),v,sz, enumStringTable); + aitConvert(aitEnumUint16,sv,(*dd).primitiveType(),v,sz, enumStringTable); } else { status = sz*sizeof(dbr_put_acks_t); @@ -1688,7 +1715,7 @@ static int mapGddToAcks(void* vd, aitIndex count, const gdd &dd, const std::vect } else { status = - aitConvertToNet(aitEnumUint16,sv,dd.primitiveType(),v,sz, enumStringTable); + aitConvertToNet(aitEnumUint16,sv,(*dd).primitiveType(),v,sz, enumStringTable); } } else { @@ -1700,22 +1727,23 @@ static int mapGddToAcks(void* vd, aitIndex count, const gdd &dd, const std::vect // -------------map the class name element -------------- -static gdd* mapClassNameToGdd(void* v,aitIndex count) { +static smartGDDPointer mapClassNameToGdd(void* v,aitIndex count) { aitFixedString* db = (aitFixedString*)v; aitEnum to_type = gddDbrToAit[DBR_CLASS_NAME].type; aitUint16 to_app = gddDbrToAit[DBR_CLASS_NAME].app; - gdd* dd; + smartGDDPointer dd; // Count should be 1, but leave it general if(count<=1) { dd=new gddScalar(to_app,to_type); + dd->unreference(); dd->put(*db); } else { dd=new gddAtomic(to_app,to_type,1,count); - + dd->unreference(); aitFixedString* pCopy = (aitFixedString*) new char [sizeof(aitFixedString)*count]; memcpy (pCopy,db,sizeof(aitFixedString)*count); dd->putRef(pCopy, new gddDestructor); @@ -1723,10 +1751,11 @@ static gdd* mapClassNameToGdd(void* v,aitIndex count) { return dd; } -static int mapGddToClassName(void* vd, aitIndex count, const gdd &dd, const std::vector< std::string > &enumStringTable) { +static int mapGddToClassName(void* vd, aitIndex count, const smartConstGDDReference & dd, + const std::vector< std::string > &enumStringTable) { aitFixedString* db = (aitFixedString*)vd; - aitIndex sz = dd.getDataSizeElements(); - const void* v = dd.dataVoid(); + aitIndex sz = (*dd).getDataSizeElements(); + const void* v = (*dd).dataVoid(); int status; // Count should be 1, but leave it general @@ -1734,7 +1763,7 @@ static int mapGddToClassName(void* vd, aitIndex count, const gdd &dd, const std: if(local_data_format==aitLocalDataFormat) { if((aitFixedString*)v!=db) { status = - aitConvert(aitEnumFixedString,db,dd.primitiveType(),v,count, enumStringTable); + aitConvert(aitEnumFixedString,db,(*dd).primitiveType(),v,count, enumStringTable); } else { status = sz*sizeof(aitFixedString); @@ -1742,7 +1771,7 @@ static int mapGddToClassName(void* vd, aitIndex count, const gdd &dd, const std: } else { status = - aitConvertToNet(aitEnumFixedString,db,dd.primitiveType(),v,count, enumStringTable); + aitConvertToNet(aitEnumFixedString,db,(*dd).primitiveType(),v,count, enumStringTable); } } else { diff --git a/src/gdd/dbMapper.h b/src/gdd/dbMapper.h index 3976fa6e6..da83680f3 100644 --- a/src/gdd/dbMapper.h +++ b/src/gdd/dbMapper.h @@ -8,6 +8,9 @@ * $Id$ * * $Log$ + * Revision 1.9 2000/03/08 16:23:29 jhill + * dont wrap include files with extern "C" - let the files themselves take care of it + * * Revision 1.8 1999/10/28 23:33:41 jhill * use fully qualified namespace names for C++ RTL classes * @@ -38,12 +41,13 @@ * */ +#include "db_access.h" +#include "cadef.h" + #include "shareLib.h" #include "aitTypes.h" #include "gdd.h" - -#include "db_access.h" -#include "cadef.h" +#include "smartGDDPointer.h" class gddApplicationTypeTable; @@ -51,14 +55,14 @@ class gddApplicationTypeTable; // reference the data in the db_struct if the db_struct points to an // array. The second argument is the number of elements if db_struct // represents an array, or zero if the db_struct is a scalar. -typedef gdd* (*to_gdd)(void* db_struct, aitIndex element_count); +typedef smartGDDPointer (*to_gdd)(void* db_struct, aitIndex element_count); // Function proto to convert from a gdd to a dbr structure, returns the // number of elements that the value field of db_struct points to if the // gdd points to an array or -1 if the number of elements in the value // field is not identical to element_count available in db_struct. typedef int (*to_dbr)(void* db_struct, aitIndex element_count, - const gdd &, const std::vector< std::string > &enumStringTable); + const smartConstGDDReference &, const std::vector< std::string > &enumStringTable); struct gddDbrMapFuncTable { to_gdd conv_gdd;