More fixes to make strings and fixed string work better.
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.2 1996/08/13 15:07:42 jbk
|
||||
// changes for better string manipulation and fixes for the units field
|
||||
//
|
||||
// Revision 1.1 1996/06/25 19:11:28 jbk
|
||||
// new in EPICS base
|
||||
//
|
||||
@@ -72,7 +75,7 @@ static void aitConvertStringFixedString(void* d,const void* s,aitIndex c)
|
||||
aitString* out = (aitString*)d;
|
||||
aitFixedString* in = (aitFixedString*)s;
|
||||
|
||||
for(i=0;i<c;i++) out[i].copy(in[i].fixed_string);
|
||||
for(i=0;i<c;i++) out[i].installString(in[i].fixed_string);
|
||||
}
|
||||
|
||||
static void aitConvertFixedStringString(void* d,const void* s,aitIndex c)
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.3 1996/08/09 02:28:08 jbk
|
||||
// rewrite of aitString class - more intuitive now, I think
|
||||
//
|
||||
// Revision 1.2 1996/08/06 19:14:06 jbk
|
||||
// Fixes to the string class.
|
||||
// Changes units field to a aitString instead of aitInt8.
|
||||
@@ -59,6 +62,7 @@ aitIndex aitString::compact(aitString* array, aitIndex arraySize,
|
||||
if(str[i].string())
|
||||
{
|
||||
memcpy(&ptr[pos],str[i].string(),str[i].length()+1); // include NULL
|
||||
str[i].init();
|
||||
str[i]=&ptr[pos];
|
||||
pos+=str[i].length()+1;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
* $Id$
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.6 1996/08/14 12:30:10 jbk
|
||||
* fixes for converting aitString to aitInt8* and back
|
||||
* fixes for managing the units field for the dbr types
|
||||
*
|
||||
* Revision 1.5 1996/08/12 15:37:46 jbk
|
||||
* Re-added the installString() function I took out.
|
||||
*
|
||||
@@ -185,18 +189,26 @@ public:
|
||||
int copy(const aitString* p);
|
||||
int copy(const aitString& p);
|
||||
int copy(const char* p);
|
||||
void installString(char* p) { copy(p); }
|
||||
|
||||
int installString(aitString* p);
|
||||
int installString(aitString& p);
|
||||
int installString(char* p);
|
||||
int installString(const aitString* p);
|
||||
int installString(const aitString& p);
|
||||
int installString(const char* p);
|
||||
|
||||
// set data in the aitString and retrieve data from the aitString
|
||||
void replaceData(const char* p);
|
||||
void replaceData(const aitString* p);
|
||||
void replaceData(aitString& p);
|
||||
void replaceData(const aitString& p);
|
||||
void extractString(char* to_here);
|
||||
|
||||
// special function to change the string - internal use with gdd library
|
||||
void force(char* x) { str=x; }
|
||||
void force(unsigned char* x) { str=(char*)x; }
|
||||
void force(unsigned long x) { str=(char*)x; }
|
||||
void forceConstant(void) { type=aitStrConst; }
|
||||
void init(void);
|
||||
|
||||
// take the aitString array, and put it and all the string into buf,
|
||||
@@ -279,9 +291,24 @@ inline void aitString::replaceData(const aitString* p)
|
||||
{ if(p && str) strncpy(str,p->string(),len); }
|
||||
inline void aitString::replaceData(aitString& p)
|
||||
{ if(str) strncpy(str,p.string(),len); }
|
||||
inline void aitString::replaceData(const aitString& p)
|
||||
{ if(str) strncpy(str,p.string(),len); }
|
||||
inline void aitString::extractString(char* p)
|
||||
{ if(p && str) strcpy(p,str); }
|
||||
|
||||
inline int aitString::installString(const char* p)
|
||||
{ int rc=0; if(isConstant()) replaceData(p); else rc=copy(p); return rc; }
|
||||
inline int aitString::installString(char* p)
|
||||
{ int rc=0; if(isConstant()) replaceData(p); else rc=copy(p); return rc; }
|
||||
inline int aitString::installString(aitString* p)
|
||||
{ int rc=0; if(isConstant()) replaceData(p); else rc=copy(p); return rc; }
|
||||
inline int aitString::installString(aitString& p)
|
||||
{ int rc=0; if(isConstant()) replaceData(p); else rc=copy(p); return rc; }
|
||||
inline int aitString::installString(const aitString* p)
|
||||
{ int rc=0; if(isConstant()) replaceData(p); else rc=copy(p); return rc; }
|
||||
inline int aitString::installString(const aitString& p)
|
||||
{ int rc=0; if(isConstant()) replaceData(p); else rc=copy(p); return rc; }
|
||||
|
||||
inline aitString& aitString::operator=(const aitString& p)
|
||||
{ this->copy(p); return *this; }
|
||||
inline aitString& aitString::operator=(const aitString* p)
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
* $Id$
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.1 1996/06/25 19:11:33 jbk
|
||||
* new in EPICS base
|
||||
*
|
||||
*
|
||||
* *Revision 1.2 1996/06/17 15:24:07 jbk
|
||||
* *many mods, string class corrections.
|
||||
@@ -68,7 +71,7 @@ typedef struct {
|
||||
#define aitTotal 13
|
||||
#define aitFirst aitEnumInvalid
|
||||
#define aitLast aitEnumContainer
|
||||
#define aitValid(x) ((x)<=aitLast)
|
||||
#define aitValid(x) ((x)<=aitLast && (x)>aitFirst)
|
||||
|
||||
/* all conversion types */
|
||||
#define aitConvertTotal 11
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.11 1996/08/14 12:30:12 jbk
|
||||
// fixes for converting aitString to aitInt8* and back
|
||||
// fixes for managing the units field for the dbr types
|
||||
//
|
||||
// Revision 1.10 1996/08/13 15:07:45 jbk
|
||||
// changes for better string manipulation and fixes for the units field
|
||||
//
|
||||
@@ -162,7 +166,7 @@ static int mapGddToString(void* v, gdd* dd) {
|
||||
dbx=(aitFixedString*)dd->dataPointer();
|
||||
|
||||
int len = dd->getDataSizeElements();
|
||||
if(dbx!=db) dd->getConvert(*db);
|
||||
if(dbx!=db) dd->get(db);
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -373,7 +377,7 @@ static int mapStsGddToString(void* v, gdd* dd)
|
||||
dbx=(aitFixedString*)dd->dataPointer();
|
||||
|
||||
// copy string into user buffer for now if not the same as one in gdd
|
||||
if(dbx!=dbv) dd->getConvert(*dbv);
|
||||
if(dbx!=dbv) dd->get(dbv);
|
||||
dd->getStatSevr(db->status,db->severity);
|
||||
return dd->getDataSizeElements();
|
||||
}
|
||||
@@ -514,7 +518,7 @@ static int mapTimeGddToString(void* v, gdd* dd)
|
||||
else
|
||||
dbx=(aitFixedString*)dd->dataPointer();
|
||||
|
||||
if(dbv!=dbx) dd->getConvert(*dbv);
|
||||
if(dbv!=dbx) dd->get(dbv);
|
||||
|
||||
dd->getStatSevr(db->status,db->severity);
|
||||
dd->getTimeStamp((aitTimeStamp*)&db->stamp);
|
||||
@@ -643,7 +647,7 @@ static gdd* mapGraphicShortToGdd(void* v, aitIndex count)
|
||||
|
||||
aitString* str=NULL;
|
||||
dd[gddAppTypeIndex_dbr_gr_short_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
str->installString(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_gr_short_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_gr_short_graphicHigh]=db->upper_disp_limit;
|
||||
@@ -675,7 +679,7 @@ static gdd* mapControlShortToGdd(void* v, aitIndex count)
|
||||
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_short_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
str->installString(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_ctrl_short_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_short_graphicHigh]=db->upper_disp_limit;
|
||||
@@ -768,7 +772,7 @@ static gdd* mapGraphicFloatToGdd(void* v, aitIndex count)
|
||||
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_gr_float_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
str->installString(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_gr_float_precision]=db->precision;
|
||||
dd[gddAppTypeIndex_dbr_gr_float_graphicLow]=db->lower_disp_limit;
|
||||
@@ -801,7 +805,7 @@ static gdd* mapControlFloatToGdd(void* v, aitIndex count)
|
||||
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_float_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
str->installString(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_ctrl_float_precision]=db->precision;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_float_graphicLow]=db->lower_disp_limit;
|
||||
@@ -986,7 +990,7 @@ static gdd* mapGraphicCharToGdd(void* v, aitIndex count)
|
||||
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_gr_char_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
str->installString(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_gr_char_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_gr_char_graphicHigh]=db->upper_disp_limit;
|
||||
@@ -1018,7 +1022,7 @@ static gdd* mapControlCharToGdd(void* v, aitIndex count)
|
||||
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_char_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
str->installString(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_ctrl_char_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_char_graphicHigh]=db->upper_disp_limit;
|
||||
@@ -1111,7 +1115,7 @@ static gdd* mapGraphicLongToGdd(void* v, aitIndex count)
|
||||
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_gr_long_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
str->installString(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_gr_long_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_gr_long_graphicHigh]=db->upper_disp_limit;
|
||||
@@ -1143,7 +1147,7 @@ static gdd* mapControlLongToGdd(void* v, aitIndex count)
|
||||
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_long_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
str->installString(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_ctrl_long_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_long_graphicHigh]=db->upper_disp_limit;
|
||||
@@ -1236,7 +1240,7 @@ static gdd* mapGraphicDoubleToGdd(void* v, aitIndex count)
|
||||
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_gr_double_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
str->installString(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_gr_double_precision]=db->precision;
|
||||
dd[gddAppTypeIndex_dbr_gr_double_graphicLow]=db->lower_disp_limit;
|
||||
@@ -1269,7 +1273,7 @@ static gdd* mapControlDoubleToGdd(void* v, aitIndex count)
|
||||
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_double_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
str->installString(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_ctrl_double_precision]=db->precision;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_double_graphicLow]=db->lower_disp_limit;
|
||||
|
||||
429
src/gdd/gdd.cc
429
src/gdd/gdd.cc
@@ -4,6 +4,10 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.8 1996/08/14 12:30:14 jbk
|
||||
// fixes for converting aitString to aitInt8* and back
|
||||
// fixes for managing the units field for the dbr types
|
||||
//
|
||||
// Revision 1.7 1996/08/13 15:07:46 jbk
|
||||
// changes for better string manipulation and fixes for the units field
|
||||
//
|
||||
@@ -122,6 +126,7 @@ void gdd::init(int app, aitEnum prim, int dimen)
|
||||
flags=0;
|
||||
bounds=NULL;
|
||||
setData(NULL);
|
||||
setStatSevr(0u,0u);
|
||||
|
||||
if(dim)
|
||||
{
|
||||
@@ -172,7 +177,7 @@ gdd::~gdd(void)
|
||||
destruct->destroy(dataAddress());
|
||||
else
|
||||
{
|
||||
aitString* s = (aitString*)&data;
|
||||
aitString* s = (aitString*)dataAddress();
|
||||
s->clear();
|
||||
}
|
||||
}
|
||||
@@ -180,10 +185,10 @@ gdd::~gdd(void)
|
||||
else if(isContainer())
|
||||
{
|
||||
if(destruct)
|
||||
destruct->destroy(voidData());
|
||||
destruct->destroy(dataPointer());
|
||||
else
|
||||
{
|
||||
for(dd=(gdd*)voidData();dd;)
|
||||
for(dd=(gdd*)dataPointer();dd;)
|
||||
{
|
||||
temp=dd;
|
||||
dd=dd->next();
|
||||
@@ -194,7 +199,7 @@ gdd::~gdd(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(destruct) destruct->destroy(voidData());
|
||||
if(destruct) destruct->destroy(dataPointer());
|
||||
if(bounds) freeBounds();
|
||||
}
|
||||
}
|
||||
@@ -213,6 +218,25 @@ void gdd::freeBounds(void)
|
||||
}
|
||||
bounds=NULL;
|
||||
}
|
||||
dim=0; // Reflect the fact that this now a scalar? Bounds and dim
|
||||
// should be tightly coupled, so no bounds means no dimension.
|
||||
}
|
||||
|
||||
void gdd::setDimension(int d)
|
||||
{
|
||||
if(dim!=d)
|
||||
{
|
||||
freeBounds();
|
||||
dim=(aitUint8)d;
|
||||
switch(dim)
|
||||
{
|
||||
case 0: break;
|
||||
case 1: bounds=(gddBounds*)new gddBounds1D; bounds->set(0,0); break;
|
||||
case 2: bounds=(gddBounds*)new gddBounds2D; break;
|
||||
case 3: bounds=(gddBounds*)new gddBounds3D; break;
|
||||
default: bounds=(gddBounds*)new gddBounds[dim]; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gddStatus gdd::registerDestructor(gddDestructor* dest)
|
||||
@@ -241,23 +265,25 @@ gddStatus gdd::genCopy(aitEnum t, const void* d)
|
||||
gddStatus rc=0;
|
||||
|
||||
if(isScalar())
|
||||
aitConvert(primitiveType(),&data,t,d,1);
|
||||
aitConvert(primitiveType(),dataAddress(),t,d,1);
|
||||
else if(isAtomic())
|
||||
{
|
||||
if(!voidData())
|
||||
if(!dataPointer())
|
||||
{
|
||||
sz=DescribedDataSizeBytes();
|
||||
sz=describedDataSizeBytes();
|
||||
if((buf=new aitInt8[sz])==NULL)
|
||||
rc=gddErrorNewFailed;
|
||||
else
|
||||
{
|
||||
setData(buf);
|
||||
destruct=new gddDestructor;
|
||||
aitConvert(primitiveType(),voidData(),t,d,getDataSizeElements());
|
||||
aitConvert(primitiveType(),dataPointer(),t,d,
|
||||
getDataSizeElements());
|
||||
}
|
||||
}
|
||||
else
|
||||
aitConvert(primitiveType(),voidData(),t,d,getDataSizeElements());
|
||||
aitConvert(primitiveType(),dataPointer(),t,d,
|
||||
getDataSizeElements());
|
||||
}
|
||||
else
|
||||
rc=gddErrorTypeMismatch;
|
||||
@@ -328,7 +354,7 @@ gddStatus gdd::copyStuff(gdd* dd,int ctype)
|
||||
{
|
||||
pdd=new gdd(ndd->applicationType(),
|
||||
ndd->primitiveType(),ndd->dimension());
|
||||
pdd->setNext((gdd*)voidData());
|
||||
pdd->setNext((gdd*)dataPointer());
|
||||
setData(pdd);
|
||||
bounds->setSize(bounds->size()+1);
|
||||
pdd->copyStuff(ndd,ctype);
|
||||
@@ -354,7 +380,7 @@ gddStatus gdd::copyStuff(gdd* dd,int ctype)
|
||||
if(array=new aitUint8[a_size])
|
||||
{
|
||||
destruct=new gddDestructor;
|
||||
memcpy(array,dd->voidData(),a_size);
|
||||
memcpy(array,dd->dataPointer(),a_size);
|
||||
setData(array);
|
||||
}
|
||||
else
|
||||
@@ -404,14 +430,14 @@ size_t gdd::getDataSizeBytes(void) const
|
||||
return sz;
|
||||
}
|
||||
|
||||
size_t gdd::DescribedDataSizeBytes(void) const
|
||||
size_t gdd::describedDataSizeBytes(void) const
|
||||
{
|
||||
size_t sz=0;
|
||||
|
||||
// does not work well for aitString - only reports the aitString info
|
||||
|
||||
if(!isContainer())
|
||||
sz+=(size_t)(DescribedDataSizeElements())*aitSize[primitiveType()];
|
||||
sz+=(size_t)(describedDataSizeElements())*aitSize[primitiveType()];
|
||||
|
||||
return sz;
|
||||
}
|
||||
@@ -471,14 +497,14 @@ aitUint32 gdd::getDataSizeElements(void) const
|
||||
total=1;
|
||||
else
|
||||
{
|
||||
if(voidData())
|
||||
if(dataPointer())
|
||||
for(i=0;i<dimension();i++) total+=bounds[i].size();
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
aitUint32 gdd::DescribedDataSizeElements(void) const
|
||||
aitUint32 gdd::describedDataSizeElements(void) const
|
||||
{
|
||||
unsigned long total=0;
|
||||
unsigned i;
|
||||
@@ -544,8 +570,8 @@ size_t gdd::flattenWithAddress(void* buf, size_t size, aitIndex* total_dd)
|
||||
{
|
||||
if(data.FString)
|
||||
memcpy((char*)&pdd[pos],data.FString,sizeof(aitFixedString));
|
||||
else
|
||||
pdd[0].data.FString=(aitFixedString*)&pdd[pos];
|
||||
|
||||
pdd[0].data.FString=(aitFixedString*)&pdd[pos];
|
||||
}
|
||||
else if(primitiveType()==aitEnumString)
|
||||
{
|
||||
@@ -554,6 +580,7 @@ size_t gdd::flattenWithAddress(void* buf, size_t size, aitIndex* total_dd)
|
||||
{
|
||||
memcpy((char*)&pdd[pos],str->string(),str->length()+1);
|
||||
str->force((char*)&pdd[pos]);
|
||||
str->forceConstant();
|
||||
}
|
||||
else
|
||||
str->init();
|
||||
@@ -562,7 +589,7 @@ size_t gdd::flattenWithAddress(void* buf, size_t size, aitIndex* total_dd)
|
||||
else if(isContainer())
|
||||
{
|
||||
// need to check for bounds in the container and flatten them
|
||||
if(voidData())
|
||||
if(dataPointer())
|
||||
{
|
||||
// process all the container's DDs
|
||||
spos=pos;
|
||||
@@ -587,16 +614,17 @@ size_t gdd::flattenWithAddress(void* buf, size_t size, aitIndex* total_dd)
|
||||
bnds=(gddBounds*)(&pdd[pos]);
|
||||
for(i=0;i<dimension();i++) bnds[i]=bounds[i];
|
||||
pdd[0].bounds=bnds;
|
||||
if(voidData())
|
||||
if(dataPointer())
|
||||
{
|
||||
if(primitiveType()==aitEnumString)
|
||||
{
|
||||
// not very good way to do it, size info bad
|
||||
aitString::compact((aitString*)dataPointer(),
|
||||
getDataSizeElements(),&bnds[i],size);
|
||||
aitString* str = (aitString*)dataPointer();
|
||||
aitString::compact(str,getDataSizeElements(),&bnds[i],size);
|
||||
str->forceConstant();
|
||||
}
|
||||
else
|
||||
memcpy(&bnds[i],voidData(),getDataSizeBytes());
|
||||
memcpy(&bnds[i],dataPointer(),getDataSizeBytes());
|
||||
|
||||
pdd[0].setData(&bnds[i]);
|
||||
}
|
||||
@@ -653,19 +681,21 @@ gddStatus gdd::flattenData(gdd* dd, int tot_dds, void* buf,size_t size)
|
||||
ptr+=j*sizeof(gddBounds);
|
||||
|
||||
// copy the data
|
||||
if(dd[i].voidData())
|
||||
if(dd[i].dataPointer())
|
||||
{
|
||||
if(dd[i].primitiveType()==aitEnumString)
|
||||
{
|
||||
// not very good way to do it, size info bad
|
||||
sz=aitString::compact((aitString*)dd[i].dataPointer(),
|
||||
aitString* str = (aitString*)dd[i].dataPointer();
|
||||
sz=aitString::compact(str,
|
||||
dd[i].getDataSizeElements(),ptr,size);
|
||||
str->forceConstant();
|
||||
}
|
||||
else
|
||||
{
|
||||
// need to copy data here, align to size of double
|
||||
sz=dd[i].getDataSizeBytes();
|
||||
memcpy(ptr,dd[i].voidData(),sz);
|
||||
memcpy(ptr,dd[i].dataPointer(),sz);
|
||||
}
|
||||
dd[i].setData(ptr);
|
||||
ptr+=align8(sz); // do alignment
|
||||
@@ -687,6 +717,7 @@ gddStatus gdd::flattenData(gdd* dd, int tot_dds, void* buf,size_t size)
|
||||
{
|
||||
memcpy(ptr,str->string(),str->length()+1);
|
||||
str->force((char*)ptr);
|
||||
str->forceConstant();
|
||||
ptr+=str->length()+1;
|
||||
}
|
||||
else
|
||||
@@ -728,7 +759,7 @@ int gdd::flattenDDs(gddContainer* dd, void* buf, size_t size)
|
||||
{
|
||||
if(ptr[i].isContainer())
|
||||
{
|
||||
if(ptr[i].voidData())
|
||||
if(ptr[i].dataPointer())
|
||||
{
|
||||
spos=pos;
|
||||
pos+=flattenDDs((gddContainer*)&ptr[i],&ptr[pos],
|
||||
@@ -750,7 +781,7 @@ gddStatus gdd::convertOffsetsToAddress(void)
|
||||
{
|
||||
aitUint8* pdd = (aitUint8*)this;
|
||||
aitUint32 bnds = (aitUint32)(bounds);
|
||||
aitUint32 dp = (aitUint32)(voidData());
|
||||
aitUint32 dp = (aitUint32)(dataPointer());
|
||||
gdd* tdd;
|
||||
gddContainer* cdd;
|
||||
gddCursor cur;
|
||||
@@ -818,7 +849,7 @@ gddStatus gdd::convertAddressToOffsets(void)
|
||||
{
|
||||
aitUint8* pdd = (aitUint8*)this;
|
||||
aitUint8* bnds = (aitUint8*)(bounds);
|
||||
aitUint8* dp = (aitUint8*)(voidData());
|
||||
aitUint8* dp = (aitUint8*)(dataPointer());
|
||||
gddContainer* tdd;
|
||||
gddCursor cur;
|
||||
gdd *cdd,*ddd;
|
||||
@@ -883,6 +914,25 @@ gddStatus gdd::convertAddressToOffsets(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
gddStatus gdd::clearData(void)
|
||||
{
|
||||
gddStatus rc=0;
|
||||
|
||||
if(isContainer())
|
||||
rc=gddErrorNotAllowed;
|
||||
else
|
||||
{
|
||||
if(destruct)
|
||||
{
|
||||
destruct->destroy(dataPointer());
|
||||
destruct=NULL;
|
||||
}
|
||||
freeBounds();
|
||||
setData(NULL);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
gddStatus gdd::clear(void)
|
||||
{
|
||||
if(isFlat()||isManaged())
|
||||
@@ -892,7 +942,7 @@ gddStatus gdd::clear(void)
|
||||
{
|
||||
if(destruct)
|
||||
{
|
||||
destruct->destroy(voidData());
|
||||
destruct->destroy(dataPointer());
|
||||
destruct=NULL;
|
||||
}
|
||||
freeBounds();
|
||||
@@ -959,12 +1009,12 @@ void gdd::get(aitString& d)
|
||||
if(isConstant())
|
||||
{
|
||||
const char* ci=(const char*)dataPointer();
|
||||
d.copy(ci);
|
||||
d.installString(ci);
|
||||
}
|
||||
else
|
||||
{
|
||||
char* i=(char*)dataPointer();
|
||||
d.copy(i);
|
||||
d.installString(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -987,12 +1037,12 @@ void gdd::getConvert(aitString& d)
|
||||
if(isConstant())
|
||||
{
|
||||
const char* ci=(const char*)dataPointer();
|
||||
d.copy(ci);
|
||||
d.installString(ci);
|
||||
}
|
||||
else
|
||||
{
|
||||
char* i=(char*)dataPointer();
|
||||
d.copy(i);
|
||||
d.installString(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1007,18 +1057,40 @@ void gdd::getConvert(aitFixedString& d)
|
||||
get(aitEnumFixedString,d.fixed_string);
|
||||
}
|
||||
|
||||
void gdd::put(aitString d)
|
||||
gddStatus gdd::put(aitString d)
|
||||
{
|
||||
aitString* s=(aitString*)dataAddress();
|
||||
*s=d;
|
||||
setPrimType(aitEnumString);
|
||||
gddStatus rc=0;
|
||||
if(isScalar())
|
||||
{
|
||||
aitString* s=(aitString*)dataAddress();
|
||||
*s=d;
|
||||
setPrimType(aitEnumString);
|
||||
}
|
||||
else
|
||||
rc=gddErrorNotAllowed;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
// this is dangerous, should the fixed string be copied here?
|
||||
void gdd::put(aitFixedString& d)
|
||||
gddStatus gdd::put(aitFixedString& d)
|
||||
{
|
||||
data.FString=&d;
|
||||
setPrimType(aitEnumFixedString);
|
||||
gddStatus rc=0;
|
||||
|
||||
if(primitiveType()==aitEnumFixedString)
|
||||
{
|
||||
if(data.FString==NULL)
|
||||
data.FString=new aitFixedString;
|
||||
}
|
||||
else
|
||||
{
|
||||
// this is so bad, like the other put() functions, need fixen
|
||||
setPrimType(aitEnumFixedString);
|
||||
data.FString=new aitFixedString;
|
||||
}
|
||||
|
||||
memcpy(data.FString->fixed_string,d.fixed_string,sizeof(d.fixed_string));
|
||||
return rc;
|
||||
}
|
||||
|
||||
void gdd::putConvert(aitString d)
|
||||
@@ -1052,14 +1124,7 @@ void gdd::putConvert(aitFixedString& d)
|
||||
// copy each of the strings into this DDs storage area
|
||||
gddStatus gdd::put(const aitString* const d)
|
||||
{
|
||||
gddStatus rc=0;
|
||||
|
||||
if(isAtomic())
|
||||
aitConvert(primitiveType(),voidData(),aitEnumString,d,getDataSizeElements());
|
||||
else
|
||||
rc=gddErrorTypeMismatch;
|
||||
|
||||
return rc;
|
||||
return genCopy(aitEnumString,d);
|
||||
}
|
||||
|
||||
// copy each of the strings into this DDs storage area
|
||||
@@ -1068,12 +1133,11 @@ gddStatus gdd::put(const aitFixedString* const d)
|
||||
gddStatus rc=0;
|
||||
|
||||
if(isAtomic())
|
||||
if(data.FString)
|
||||
{
|
||||
aitConvert(primitiveType(),voidData(),aitEnumFixedString,d,
|
||||
if(dataPointer())
|
||||
aitConvert(primitiveType(),dataPointer(),aitEnumFixedString,d,
|
||||
getDataSizeElements());
|
||||
}
|
||||
// should have else error condition
|
||||
else
|
||||
genCopy(aitEnumFixedString,d);
|
||||
else
|
||||
rc=gddErrorTypeMismatch;
|
||||
|
||||
@@ -1084,25 +1148,107 @@ gddStatus gdd::put(const gdd* dd)
|
||||
{
|
||||
gddStatus rc=0;
|
||||
|
||||
// bail out quickly is either dd is a container
|
||||
if(isContainer() || dd->isContainer())
|
||||
rc=gddErrorNotSupported;
|
||||
else if(isScalar() && dd->isScalar())
|
||||
return gddErrorNotSupported;
|
||||
|
||||
if(!aitConvertValid(primitiveType()))
|
||||
{
|
||||
// can't change application type here
|
||||
int app = applicationType();
|
||||
init(app,dd->primitiveType(),dd->dimension());
|
||||
}
|
||||
|
||||
if(isScalar() && dd->isScalar())
|
||||
{
|
||||
// this is the simple case - just make this scaler look like the other
|
||||
// not protected against screwing up the string type
|
||||
setPrimType(dd->primitiveType());
|
||||
put(((aitType*)dd->dataAddress()));
|
||||
// set(dd->primitiveType(),dd->dataAddress());
|
||||
// need to make sure that aitString and aitFixedString work right
|
||||
|
||||
if(primitiveType()==aitEnumFixedString && data.FString==NULL)
|
||||
data.FString=new aitFixedString;
|
||||
|
||||
if(dd->primitiveType()==aitEnumFixedString)
|
||||
set(dd->primitiveType(),dd->dataPointer());
|
||||
else
|
||||
set(dd->primitiveType(),dd->dataAddress());
|
||||
}
|
||||
else if(isAtomic() && dd->isAtomic())
|
||||
else if(isScalar()) // dd must be atomic if this is true
|
||||
{
|
||||
if((primitiveType()==aitEnumString ||
|
||||
primitiveType()==aitEnumFixedString) &&
|
||||
dd->primitiveType()==aitEnumInt8)
|
||||
{
|
||||
// special case for aitInt8--->aitString (hate this)
|
||||
aitInt8* i1=(aitInt8*)dd->dataPointer();
|
||||
put(i1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(primitiveType()==aitEnumFixedString && data.FString==NULL)
|
||||
data.FString=new aitFixedString;
|
||||
|
||||
set(dd->primitiveType(),dd->dataPointer());
|
||||
}
|
||||
}
|
||||
else if(dd->isScalar()) // this must be atomic if true
|
||||
{
|
||||
if(primitiveType()==aitEnumInt8 &&
|
||||
dd->primitiveType()==aitEnumString)
|
||||
{
|
||||
// special case for aitString--->aitInt8
|
||||
aitString* s1=(aitString*)dd->dataAddress();
|
||||
put(*s1);
|
||||
}
|
||||
else if(primitiveType()==aitEnumInt8 &&
|
||||
dd->primitiveType()==aitEnumFixedString)
|
||||
{
|
||||
// special case for aitFixedString--->aitInt8
|
||||
aitFixedString* s2=data.FString;
|
||||
if(s2) put(*s2);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(getDataSizeElements()>0)
|
||||
{
|
||||
aitConvert(primitiveType(),dataPointer(),
|
||||
dd->primitiveType(),dd->dataAddress(),1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// this may expose an inconsistancy in the library.
|
||||
// you can register a gdd with bounds and no data
|
||||
// which marks it flat
|
||||
|
||||
if(isFlat())
|
||||
rc=gddErrorNotAllowed;
|
||||
else
|
||||
{
|
||||
// convert it to a scalar - is this OK to do?
|
||||
clearData();
|
||||
setPrimType(dd->primitiveType());
|
||||
setApplType(applicationType());
|
||||
setDimension(0);
|
||||
put((aitType*)dd->dataAddress());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else // both dd and this must be atomic
|
||||
{
|
||||
// carefully place values from dd into this
|
||||
if(dd->getDataSizeElements()>getDataSizeElements())
|
||||
if(dataPointer()==NULL)
|
||||
{
|
||||
if(destruct)
|
||||
rc=gddErrorNotAllowed;
|
||||
else
|
||||
rc=copyData(dd); // is this the correct thing to do?
|
||||
}
|
||||
else if(dd->getDataSizeElements()>getDataSizeElements())
|
||||
rc=gddErrorOutOfBounds;
|
||||
else
|
||||
{
|
||||
if(dd->dimension()>1)
|
||||
return gddErrorNotSupported;
|
||||
rc=gddErrorNotSupported;
|
||||
else
|
||||
{
|
||||
aitUint8* arr = (aitUint8*)dataPointer();
|
||||
@@ -1113,90 +1259,9 @@ gddStatus gdd::put(const gdd* dd)
|
||||
dd->dataPointer(),
|
||||
dd->getBounds()->size());
|
||||
}
|
||||
#if 0
|
||||
// should handle single dimensional array as a special case
|
||||
const Bounds* b = dd->getBounds();
|
||||
const Bounds* bs = getBounds();
|
||||
aitIndex x[dd->dimension()];
|
||||
aitIndex offset,mult;
|
||||
aitUint8* arr_dest=(aitUint8*)dataPointer();
|
||||
aitUint8* arr_src=(aitUint8*)dd->dataPointer();
|
||||
int d = dd->dimension();
|
||||
int i,j;
|
||||
|
||||
for(i=0;i<d;i++) x[i]=b[i].first();
|
||||
|
||||
// look at this ugly mess - slow and horrible, but generic
|
||||
// this is so unbelievably sucky, I hate it
|
||||
j=0;
|
||||
while(x[d-1]<b[d-1].size())
|
||||
{
|
||||
// modify coordinate here
|
||||
for(offset=x[0],mult=1,i=1;i<d;i++)
|
||||
{
|
||||
mult*=bs[i];
|
||||
offset+=x[i]*mult;
|
||||
}
|
||||
|
||||
aitConvert(primitiveType(),
|
||||
arr_dest[offset*aitSize[dd->primitiveType()],
|
||||
dd->primitiveType(),arr_src[j],1);
|
||||
|
||||
if(++x[0]>=b[0].size())
|
||||
{
|
||||
for(i=0;i<(d-1);i++)
|
||||
{
|
||||
if(x[i]>=b[i].size())
|
||||
{
|
||||
++x[i+1];
|
||||
x[i]=b[i].first();
|
||||
}
|
||||
}
|
||||
}
|
||||
j++;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if((primitiveType()==aitEnumString ||
|
||||
primitiveType()==aitEnumFixedString) &&
|
||||
dd->primitiveType()==aitEnumInt8 &&
|
||||
isScalar() && dd->isAtomic())
|
||||
{
|
||||
// special case for aitInt8--->aitString (hate this)
|
||||
aitInt8* i1=(aitInt8*)dd->dataPointer();
|
||||
put(i1);
|
||||
}
|
||||
else if(primitiveType()==aitEnumInt8 &&
|
||||
dd->primitiveType()==aitEnumString &&
|
||||
dd->isScalar() && isAtomic())
|
||||
{
|
||||
// special case for aitString--->aitInt8
|
||||
aitString* s1=(aitString*)dd->dataAddress();
|
||||
put(*s1);
|
||||
}
|
||||
else if(primitiveType()==aitEnumInt8 &&
|
||||
dd->primitiveType()==aitEnumFixedString &&
|
||||
dd->isScalar() && isAtomic())
|
||||
{
|
||||
// special case for aitFixedString--->aitInt8
|
||||
aitFixedString* s2=data.FString;
|
||||
if(s2) put(*s2);
|
||||
}
|
||||
else if(isScalar())
|
||||
{
|
||||
// just put first element of dd into this scaler - sucks
|
||||
if(dd->getDataSizeElements()>0)
|
||||
aitConvert(primitiveType(),dataAddress(),
|
||||
dd->primitiveType(),dd->dataPointer(),1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// just put dd scaler into first element of this - sucks
|
||||
if(getDataSizeElements()>0)
|
||||
aitConvert(primitiveType(),dataPointer(),
|
||||
dd->primitiveType(),dd->dataAddress(),1);
|
||||
}
|
||||
|
||||
aitTimeStamp ts;
|
||||
setStatSevr(dd->getStat(),dd->getSevr());
|
||||
@@ -1206,6 +1271,36 @@ gddStatus gdd::put(const gdd* dd)
|
||||
return rc;
|
||||
}
|
||||
|
||||
gddStatus gdd::copyData(const gdd* dd)
|
||||
{
|
||||
gddStatus rc=0;
|
||||
|
||||
if(isFlat() || isManaged() || isContainer())
|
||||
rc=gddErrorNotAllowed;
|
||||
else
|
||||
{
|
||||
if((rc=clear())==0)
|
||||
{
|
||||
int i;
|
||||
init(dd->applicationType(),dd->primitiveType(),dd->dimension());
|
||||
const gddBounds* bnds = dd->getBounds();
|
||||
for(i=0;i<dd->dimension();i++) bounds[i]=bnds[i];
|
||||
|
||||
size_t sz = dd->getDataSizeBytes();
|
||||
aitUint8* arr;
|
||||
if((arr=new aitUint8[sz]))
|
||||
{
|
||||
destruct=new gddDestructor;
|
||||
memcpy(arr,dd->dataPointer(),sz);
|
||||
setData(arr);
|
||||
}
|
||||
else
|
||||
rc=gddErrorNewFailed;
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
// ----------------------The gddAtomic functions-------------------------
|
||||
|
||||
gddAtomic::gddAtomic(int app, aitEnum prim, int dimen, ...):
|
||||
@@ -1336,7 +1431,7 @@ gddContainer::gddContainer(gddContainer* ec)
|
||||
gdd* gddContainer::getDD(aitIndex index)
|
||||
{
|
||||
aitIndex i;
|
||||
gdd* dd=(gdd*)voidData();
|
||||
gdd* dd=(gdd*)dataPointer();
|
||||
for(i=0;i<index && i<bounds->size();i++) dd=(gdd*)dd->next();
|
||||
return dd;
|
||||
}
|
||||
@@ -1398,3 +1493,49 @@ gdd* gddCursor::operator[](int index)
|
||||
return dd;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
code section for handling transfer of element from
|
||||
multidimensional space
|
||||
// should handle single dimensional array as a special case
|
||||
const Bounds* b = dd->getBounds();
|
||||
const Bounds* bs = getBounds();
|
||||
aitIndex x[dd->dimension()];
|
||||
aitIndex offset,mult;
|
||||
aitUint8* arr_dest=(aitUint8*)dataPointer();
|
||||
aitUint8* arr_src=(aitUint8*)dd->dataPointer();
|
||||
int d = dd->dimension();
|
||||
int i,j;
|
||||
|
||||
for(i=0;i<d;i++) x[i]=b[i].first();
|
||||
|
||||
// look at this ugly mess - slow and horrible, but generic
|
||||
// this is so unbelievably sucky, I hate it
|
||||
j=0;
|
||||
while(x[d-1]<b[d-1].size())
|
||||
{
|
||||
// modify coordinate here
|
||||
for(offset=x[0],mult=1,i=1;i<d;i++)
|
||||
{
|
||||
mult*=bs[i];
|
||||
offset+=x[i]*mult;
|
||||
}
|
||||
|
||||
aitConvert(primitiveType(),
|
||||
arr_dest[offset*aitSize[dd->primitiveType()],
|
||||
dd->primitiveType(),arr_src[j],1);
|
||||
|
||||
if(++x[0]>=b[0].size())
|
||||
{
|
||||
for(i=0;i<(d-1);i++)
|
||||
{
|
||||
if(x[i]>=b[i].size())
|
||||
{
|
||||
++x[i+1];
|
||||
x[i]=b[i].first();
|
||||
}
|
||||
}
|
||||
}
|
||||
j++;
|
||||
}
|
||||
#endif
|
||||
|
||||
305
src/gdd/gdd.h
305
src/gdd/gdd.h
@@ -8,6 +8,9 @@
|
||||
* $Id$
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.10 1996/08/14 16:29:38 jbk
|
||||
* fixed a put() function that did not return anything
|
||||
*
|
||||
* Revision 1.9 1996/08/14 12:30:15 jbk
|
||||
* fixes for converting aitString to aitInt8* and back
|
||||
* fixes for managing the units field for the dbr types
|
||||
@@ -311,9 +314,11 @@ public:
|
||||
|
||||
void setPrimType(aitEnum t);
|
||||
void setApplType(int t);
|
||||
void setDimension(int d);
|
||||
void destroyData(void);
|
||||
gddStatus reset(aitEnum primtype,int dimension, aitIndex* dim_counts);
|
||||
gddStatus clear(void); // clear all fields of the DD, including arrays
|
||||
gddStatus clearData(void);
|
||||
gddStatus changeType(int appltype, aitEnum primtype);
|
||||
gddStatus setBound(unsigned dim_to_set, aitIndex first, aitIndex count);
|
||||
gddStatus getBound(unsigned dim_to_get, aitIndex& first, aitIndex& count);
|
||||
@@ -353,6 +358,7 @@ public:
|
||||
// copy data into it.
|
||||
// Dup() will copy DD info. bounds, data references copied only.
|
||||
|
||||
gddStatus copyData(const gdd*);
|
||||
gddStatus copyInfo(gdd*);
|
||||
gddStatus copy(gdd*);
|
||||
gddStatus Dup(gdd*);
|
||||
@@ -463,17 +469,17 @@ public:
|
||||
gddStatus put(const gdd* dd);
|
||||
|
||||
// put the user data into the DD and reset the primitive type
|
||||
void put(aitFloat64 d);
|
||||
void put(aitFloat32 d);
|
||||
void put(aitUint32 d);
|
||||
void put(aitInt32 d);
|
||||
void put(aitUint16 d);
|
||||
void put(aitInt16 d);
|
||||
void put(aitUint8 d);
|
||||
void put(aitInt8 d);
|
||||
void put(aitString d);
|
||||
void put(aitFixedString& d);
|
||||
void put(aitType* d);
|
||||
gddStatus put(aitFloat64 d);
|
||||
gddStatus put(aitFloat32 d);
|
||||
gddStatus put(aitUint32 d);
|
||||
gddStatus put(aitInt32 d);
|
||||
gddStatus put(aitUint16 d);
|
||||
gddStatus put(aitInt16 d);
|
||||
gddStatus put(aitUint8 d);
|
||||
gddStatus put(aitInt8 d);
|
||||
gddStatus put(aitString d);
|
||||
gddStatus put(aitFixedString& d);
|
||||
gddStatus put(aitType* d);
|
||||
|
||||
// copy the array data out of the DD
|
||||
void get(void* d);
|
||||
@@ -565,15 +571,14 @@ protected:
|
||||
void dumpInfo(void);
|
||||
gddStatus copyStuff(gdd*,int type);
|
||||
|
||||
size_t DescribedDataSizeBytes(void) const;
|
||||
aitUint32 DescribedDataSizeElements(void) const;
|
||||
size_t describedDataSizeBytes(void) const;
|
||||
aitUint32 describedDataSizeElements(void) const;
|
||||
|
||||
void markFlat(void);
|
||||
gddStatus flattenData(gdd* dd, int tot_dds, void* buf, size_t size);
|
||||
int flattenDDs(gddContainer* dd, void* buf, size_t size);
|
||||
aitUint32 align8(unsigned long count) const;
|
||||
|
||||
void* voidData(void) const;
|
||||
void setData(void* d);
|
||||
|
||||
aitType data; // array pointer or scaler data
|
||||
@@ -590,7 +595,6 @@ private:
|
||||
aitUint8 flags;
|
||||
};
|
||||
|
||||
inline void* gdd::voidData(void) const { return data.Pointer; }
|
||||
inline void gdd::setData(void* d) { data.Pointer=d; }
|
||||
inline gddDestructor* gdd::destructor(void) const { return destruct; }
|
||||
|
||||
@@ -612,7 +616,7 @@ inline gddStatus gdd::copyInfo(gdd* dd) { return copyStuff(dd,0); }
|
||||
inline gddStatus gdd::copy(gdd* dd) { return copyStuff(dd,1); }
|
||||
inline gddStatus gdd::Dup(gdd* dd) { return copyStuff(dd,2); }
|
||||
inline void* gdd::dataAddress(void) const { return (void*)&data; }
|
||||
inline void* gdd::dataPointer(void) const { return voidData(); }
|
||||
inline void* gdd::dataPointer(void) const { return data.Pointer; }
|
||||
|
||||
inline aitUint32 gdd::align8(unsigned long count) const
|
||||
{
|
||||
@@ -621,7 +625,7 @@ inline aitUint32 gdd::align8(unsigned long count) const
|
||||
}
|
||||
|
||||
inline void* gdd::dataPointer(aitIndex f) const
|
||||
{ return (void*)(((aitUint8*)voidData())+aitSize[primitiveType()]*f); }
|
||||
{ return (void*)(((aitUint8*)dataPointer())+aitSize[primitiveType()]*f); }
|
||||
|
||||
inline int gdd::isManaged(void) const { return flags&GDD_MANAGED_MASK; }
|
||||
inline int gdd::isFlat(void) const { return flags&GDD_FLAT_MASK; }
|
||||
@@ -723,7 +727,7 @@ inline void gdd::destroyData(void)
|
||||
if(isContainer())
|
||||
destruct->run(this);
|
||||
else
|
||||
destruct->run(voidData());
|
||||
destruct->run(dataPointer());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -737,32 +741,56 @@ inline void gdd::destroyData(void)
|
||||
|
||||
inline void gdd::adjust(gddDestructor* d, void* v, aitEnum type)
|
||||
{
|
||||
if(destruct) destruct->destroy(voidData());
|
||||
if(destruct) destruct->destroy(dataPointer());
|
||||
destruct=d;
|
||||
if(destruct) destruct->reference();
|
||||
setPrimType(type);
|
||||
setData(v);
|
||||
}
|
||||
|
||||
// These function do NOT work well for aitFixedString because
|
||||
// fixed strings are always stored by reference. You WILL get
|
||||
// into trouble is the gdd does not contain a fixed string
|
||||
// before you putConvert() something into it.
|
||||
|
||||
inline void gdd::get(aitEnum t,void* v)
|
||||
{ aitConvert(t,v,primitiveType(),&data,1); }
|
||||
{
|
||||
if(primitiveType()==aitEnumFixedString)
|
||||
{
|
||||
if(dataPointer()) aitConvert(t,v,primitiveType(),dataPointer(),1);
|
||||
}
|
||||
else
|
||||
aitConvert(t,v,primitiveType(),dataAddress(),1);
|
||||
}
|
||||
|
||||
inline void gdd::set(aitEnum t,void* v)
|
||||
{ aitConvert(primitiveType(),&data,t,v,1); }
|
||||
{
|
||||
if(primitiveType()==aitEnumFixedString)
|
||||
{
|
||||
if(dataPointer()==NULL) data.FString=new aitFixedString;
|
||||
aitConvert(primitiveType(),dataPointer(),t,v,1);
|
||||
}
|
||||
else
|
||||
aitConvert(primitiveType(),dataAddress(),t,v,1);
|
||||
}
|
||||
|
||||
inline void gdd::getRef(aitFloat64*& d) { d=(aitFloat64*)voidData(); }
|
||||
inline void gdd::getRef(aitFloat32*& d) { d=(aitFloat32*)voidData(); }
|
||||
inline void gdd::getRef(aitUint32*& d) { d=(aitUint32*)voidData(); }
|
||||
inline void gdd::getRef(aitInt32*& d) { d=(aitInt32*)voidData(); }
|
||||
inline void gdd::getRef(aitUint16*& d) { d=(aitUint16*)voidData(); }
|
||||
inline void gdd::getRef(aitInt16*& d) { d=(aitInt16*)voidData(); }
|
||||
inline void gdd::getRef(aitUint8*& d) { d=(aitUint8*)voidData(); }
|
||||
inline void gdd::getRef(aitInt8*& d) { d=(aitInt8*)voidData(); }
|
||||
inline void gdd::getRef(void*& d) { d=voidData(); }
|
||||
inline void gdd::getRef(aitFixedString*& d) { d=(aitFixedString*)voidData(); }
|
||||
|
||||
inline void gdd::getRef(aitString*& d)
|
||||
{ if(isScalar()) d=(aitString*)dataAddress(); else d=(aitString*)voidData(); }
|
||||
// -------------------getRef(data pointer) functions----------------
|
||||
inline void gdd::getRef(aitFloat64*& d) { d=(aitFloat64*)dataPointer(); }
|
||||
inline void gdd::getRef(aitFloat32*& d) { d=(aitFloat32*)dataPointer(); }
|
||||
inline void gdd::getRef(aitUint32*& d) { d=(aitUint32*)dataPointer(); }
|
||||
inline void gdd::getRef(aitInt32*& d) { d=(aitInt32*)dataPointer(); }
|
||||
inline void gdd::getRef(aitUint16*& d) { d=(aitUint16*)dataPointer(); }
|
||||
inline void gdd::getRef(aitInt16*& d) { d=(aitInt16*)dataPointer(); }
|
||||
inline void gdd::getRef(aitUint8*& d) { d=(aitUint8*)dataPointer(); }
|
||||
inline void gdd::getRef(aitInt8*& d) { d=(aitInt8*)dataPointer(); }
|
||||
inline void gdd::getRef(void*& d) { d=dataPointer(); }
|
||||
inline void gdd::getRef(aitFixedString*& d) {d=(aitFixedString*)dataPointer();}
|
||||
inline void gdd::getRef(aitString*& d) {
|
||||
if(isScalar()) d=(aitString*)dataAddress();
|
||||
else d=(aitString*)dataPointer();
|
||||
}
|
||||
|
||||
// -------------------putRef(data pointer) functions----------------
|
||||
inline void gdd::putRef(void* v,aitEnum code, gddDestructor* d)
|
||||
{ adjust(d, v, code); }
|
||||
inline void gdd::putRef(aitFloat64* v, gddDestructor* d)
|
||||
@@ -786,6 +814,7 @@ inline void gdd::putRef(aitString* v, gddDestructor* d)
|
||||
inline void gdd::putRef(aitFixedString* v, gddDestructor* d)
|
||||
{ adjust(d, (void*)v, aitEnumFixedString); }
|
||||
|
||||
// -------------------putRef(const data pointer) functions----------------
|
||||
inline void gdd::putRef(const aitFloat64* v, gddDestructor* d)
|
||||
{ adjust(d, (void*)v, aitEnumFloat64); markConstant(); }
|
||||
inline void gdd::putRef(const aitFloat32* v, gddDestructor* d)
|
||||
@@ -807,6 +836,7 @@ inline void gdd::putRef(const aitString* v, gddDestructor* d)
|
||||
inline void gdd::putRef(const aitFixedString* v, gddDestructor* d)
|
||||
{ adjust(d, (void*)v, aitEnumFixedString); markConstant(); }
|
||||
|
||||
// -------------------getConvert(scalar) functions ----------------------
|
||||
inline void gdd::getConvert(aitFloat64& d) { get(aitEnumFloat64,&d); }
|
||||
inline void gdd::getConvert(aitFloat32& d) { get(aitEnumFloat32,&d); }
|
||||
inline void gdd::getConvert(aitUint32& d) { get(aitEnumUint32,&d); }
|
||||
@@ -816,6 +846,7 @@ inline void gdd::getConvert(aitInt16& d) { get(aitEnumInt16,&d); }
|
||||
inline void gdd::getConvert(aitUint8& d) { get(aitEnumUint8,&d); }
|
||||
inline void gdd::getConvert(aitInt8& d) { get(aitEnumInt8,&d); }
|
||||
|
||||
// -------------------putConvert(scalar) functions ----------------------
|
||||
inline void gdd::putConvert(aitFloat64 d){ set(aitEnumFloat64,&d); }
|
||||
inline void gdd::putConvert(aitFloat32 d){ set(aitEnumFloat32,&d); }
|
||||
inline void gdd::putConvert(aitUint32 d) { set(aitEnumUint32,&d); }
|
||||
@@ -825,6 +856,7 @@ inline void gdd::putConvert(aitInt16 d) { set(aitEnumInt16,&d); }
|
||||
inline void gdd::putConvert(aitUint8 d) { set(aitEnumUint8,&d); }
|
||||
inline void gdd::putConvert(aitInt8 d) { set(aitEnumInt8,&d); }
|
||||
|
||||
// ------------------------put(pointer) functions----------------------
|
||||
inline gddStatus gdd::put(const aitFloat64* const d)
|
||||
{ return genCopy(aitEnumFloat64,d); }
|
||||
inline gddStatus gdd::put(const aitFloat32* const d)
|
||||
@@ -848,10 +880,7 @@ inline gddStatus gdd::put(const aitInt8* const d)
|
||||
if(primitiveType()==aitEnumString && dim==0)
|
||||
{
|
||||
aitString* p = (aitString*)dataAddress();
|
||||
if(isConstant())
|
||||
p->replaceData((char*)d);
|
||||
else
|
||||
p->copy((char*)d);
|
||||
p->installString((char*)d);
|
||||
}
|
||||
else if(primitiveType()==aitEnumFixedString && dim==0)
|
||||
strcpy(data.FString->fixed_string,(char*)d);
|
||||
@@ -861,39 +890,108 @@ inline gddStatus gdd::put(const aitInt8* const d)
|
||||
return rc;
|
||||
}
|
||||
|
||||
// currently unprotected from destroying an atomic gdd
|
||||
inline void gdd::put(aitFloat64 d){ data.Float64=d;setPrimType(aitEnumFloat64);}
|
||||
inline void gdd::put(aitFloat32 d){ data.Float32=d;setPrimType(aitEnumFloat32);}
|
||||
inline void gdd::put(aitUint32 d) { data.Uint32=d; setPrimType(aitEnumUint32); }
|
||||
inline void gdd::put(aitInt32 d) { data.Int32=d; setPrimType(aitEnumInt32); }
|
||||
inline void gdd::put(aitUint16 d) { data.Uint16=d; setPrimType(aitEnumUint16); }
|
||||
inline void gdd::put(aitInt16 d) { data.Int16=d; setPrimType(aitEnumInt16); }
|
||||
inline void gdd::put(aitUint8 d) { data.Uint8=d; setPrimType(aitEnumUint8); }
|
||||
inline void gdd::put(aitInt8 d) { data.Int8=d; setPrimType(aitEnumInt8); }
|
||||
inline void gdd::put(aitType* d) { data=*d; }
|
||||
// ----------------put(scalar) functions----------------
|
||||
inline gddStatus gdd::put(aitFloat64 d) {
|
||||
gddStatus rc=0;
|
||||
if(isScalar()) { data.Float64=d; setPrimType(aitEnumFloat64); }
|
||||
else rc=gddErrorNotAllowed;
|
||||
return rc;
|
||||
}
|
||||
inline gddStatus gdd::put(aitFloat32 d) {
|
||||
gddStatus rc=0;
|
||||
if(isScalar()) { data.Float32=d;setPrimType(aitEnumFloat32); }
|
||||
else rc=gddErrorNotAllowed;
|
||||
return rc;
|
||||
}
|
||||
inline gddStatus gdd::put(aitUint32 d) {
|
||||
gddStatus rc=0;
|
||||
if(isScalar()) { data.Uint32=d; setPrimType(aitEnumUint32); }
|
||||
else rc=gddErrorNotAllowed;
|
||||
return rc;
|
||||
}
|
||||
inline gddStatus gdd::put(aitInt32 d) {
|
||||
gddStatus rc=0;
|
||||
if(isScalar()) { data.Int32=d; setPrimType(aitEnumInt32); }
|
||||
else rc=gddErrorNotAllowed;
|
||||
return rc;
|
||||
}
|
||||
inline gddStatus gdd::put(aitUint16 d) {
|
||||
gddStatus rc=0;
|
||||
if(isScalar()) { data.Uint16=d; setPrimType(aitEnumUint16); }
|
||||
else rc=gddErrorNotAllowed;
|
||||
return rc;
|
||||
}
|
||||
inline gddStatus gdd::put(aitInt16 d) {
|
||||
gddStatus rc=0;
|
||||
if(isScalar()) { data.Int16=d; setPrimType(aitEnumInt16); }
|
||||
else rc=gddErrorNotAllowed;
|
||||
return rc;
|
||||
}
|
||||
inline gddStatus gdd::put(aitUint8 d) {
|
||||
gddStatus rc=0;
|
||||
if(isScalar()) { data.Uint8=d; setPrimType(aitEnumUint8); }
|
||||
else rc=gddErrorNotAllowed;
|
||||
return rc;
|
||||
}
|
||||
inline gddStatus gdd::put(aitInt8 d) {
|
||||
gddStatus rc=0;
|
||||
if(isScalar()) { data.Int8=d; setPrimType(aitEnumInt8); }
|
||||
else rc=gddErrorNotAllowed;
|
||||
return rc;
|
||||
}
|
||||
inline gddStatus gdd::put(aitType* d) {
|
||||
gddStatus rc=0;
|
||||
if(isScalar()) { data=*d; }
|
||||
else rc=gddErrorNotAllowed;
|
||||
return rc;
|
||||
}
|
||||
|
||||
inline void gdd::get(void* d)
|
||||
{ aitConvert(primitiveType(),d,primitiveType(),voidData(),getDataSizeElements());}
|
||||
inline void gdd::get(void* d,aitEnum e)
|
||||
{ aitConvert(e,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
// ---------------------get(pointer) functions--------------------------
|
||||
inline void gdd::get(void* d) {
|
||||
aitConvert(primitiveType(),d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
inline void gdd::get(void* d,aitEnum e) {
|
||||
aitConvert(e,d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
inline void gdd::get(aitFloat64* d)
|
||||
{ aitConvert(aitEnumFloat64,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitFloat32* d)
|
||||
{ aitConvert(aitEnumFloat32,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitUint32* d)
|
||||
{ aitConvert(aitEnumUint32,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitInt32* d)
|
||||
{ aitConvert(aitEnumInt32,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitUint16* d)
|
||||
{ aitConvert(aitEnumUint16,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitInt16* d)
|
||||
{ aitConvert(aitEnumInt16,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitUint8* d)
|
||||
{ aitConvert(aitEnumUint8,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitString* d)
|
||||
{ aitConvert(aitEnumString,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitFixedString* d)
|
||||
{ aitConvert(aitEnumFixedString,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
{
|
||||
aitConvert(aitEnumFloat64,d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
inline void gdd::get(aitFloat32* d) {
|
||||
aitConvert(aitEnumFloat32,d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
inline void gdd::get(aitUint32* d) {
|
||||
aitConvert(aitEnumUint32,d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
inline void gdd::get(aitInt32* d) {
|
||||
aitConvert(aitEnumInt32,d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
inline void gdd::get(aitUint16* d) {
|
||||
aitConvert(aitEnumUint16,d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
inline void gdd::get(aitInt16* d) {
|
||||
aitConvert(aitEnumInt16,d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
inline void gdd::get(aitUint8* d) {
|
||||
aitConvert(aitEnumUint8,d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
inline void gdd::get(aitString* d) {
|
||||
aitConvert(aitEnumString,d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
inline void gdd::get(aitFixedString* d) {
|
||||
aitConvert(aitEnumFixedString,d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
|
||||
// special case for string scalar to aitInt8 array!
|
||||
inline void gdd::get(aitInt8* d)
|
||||
@@ -906,9 +1004,11 @@ inline void gdd::get(aitInt8* d)
|
||||
else if(primitiveType()==aitEnumFixedString && dim==0)
|
||||
strcpy((char*)d,data.FString->fixed_string);
|
||||
else
|
||||
aitConvert(aitEnumInt8,d,primitiveType(),voidData(),getDataSizeElements());
|
||||
aitConvert(aitEnumInt8,d,primitiveType(),dataPointer(),
|
||||
getDataSizeElements());
|
||||
}
|
||||
|
||||
// ------------------get(scalar) functions-----------------
|
||||
inline void gdd::get(aitFloat64& d) {
|
||||
if(primitiveType()==aitEnumFloat64) d=getData().Float64;
|
||||
else get(aitEnumFloat64,&d);
|
||||
@@ -943,6 +1043,7 @@ inline void gdd::get(aitInt8& d) {
|
||||
}
|
||||
inline void gdd::get(aitType& d) { d=data; }
|
||||
|
||||
// ---------- gdd x = primitive data type pointer functions----------
|
||||
inline gdd& gdd::operator=(aitFloat64* v) { putRef(v); return *this;}
|
||||
inline gdd& gdd::operator=(aitFloat32* v) { putRef(v); return *this;}
|
||||
inline gdd& gdd::operator=(aitUint32* v) { putRef(v); return *this;}
|
||||
@@ -954,28 +1055,49 @@ inline gdd& gdd::operator=(aitInt8* v) { putRef(v); return *this;}
|
||||
inline gdd& gdd::operator=(aitString* v) { putRef(v); return *this;}
|
||||
inline gdd& gdd::operator=(aitFixedString* v){ putRef(v); return *this;}
|
||||
|
||||
inline gdd& gdd::operator=(aitFloat64 d) { put(d); return *this; }
|
||||
inline gdd& gdd::operator=(aitFloat32 d) { put(d); return *this; }
|
||||
inline gdd& gdd::operator=(aitUint32 d) { put(d); return *this; }
|
||||
inline gdd& gdd::operator=(aitInt32 d) { put(d); return *this; }
|
||||
inline gdd& gdd::operator=(aitUint16 d) { put(d); return *this; }
|
||||
inline gdd& gdd::operator=(aitInt16 d) { put(d); return *this; }
|
||||
inline gdd& gdd::operator=(aitUint8 d) { put(d); return *this; }
|
||||
inline gdd& gdd::operator=(aitInt8 d) { put(d); return *this; }
|
||||
inline gdd& gdd::operator=(aitString d) { put(d); return *this; }
|
||||
// ----------------- gdd x = primitive data type functions----------------
|
||||
inline gdd& gdd::operator=(aitFloat64 d)
|
||||
{ data.Float64=d; setPrimType(aitEnumFloat64); return *this; }
|
||||
inline gdd& gdd::operator=(aitFloat32 d)
|
||||
{ data.Float32=d;setPrimType(aitEnumFloat32); return *this; }
|
||||
inline gdd& gdd::operator=(aitUint32 d)
|
||||
{ data.Uint32=d; setPrimType(aitEnumUint32); return *this; }
|
||||
inline gdd& gdd::operator=(aitInt32 d)
|
||||
{ data.Int32=d; setPrimType(aitEnumInt32); return *this; }
|
||||
inline gdd& gdd::operator=(aitUint16 d)
|
||||
{ data.Uint16=d; setPrimType(aitEnumUint16); return *this; }
|
||||
inline gdd& gdd::operator=(aitInt16 d)
|
||||
{ data.Int16=d; setPrimType(aitEnumInt16); return *this; }
|
||||
inline gdd& gdd::operator=(aitUint8 d)
|
||||
{ data.Uint8=d; setPrimType(aitEnumUint8); return *this; }
|
||||
inline gdd& gdd::operator=(aitInt8 d)
|
||||
{ data.Int8=d; setPrimType(aitEnumInt8); return *this; }
|
||||
inline gdd& gdd::operator=(aitString d)
|
||||
{ put(d); return *this; }
|
||||
|
||||
inline gdd::operator aitFloat64*(void) const{ return (aitFloat64*)voidData(); }
|
||||
inline gdd::operator aitFloat32*(void) const{ return (aitFloat32*)voidData(); }
|
||||
inline gdd::operator aitUint32*(void) const { return (aitUint32*)voidData(); }
|
||||
inline gdd::operator aitInt32*(void) const { return (aitInt32*)voidData(); }
|
||||
inline gdd::operator aitUint16*(void) const { return (aitUint16*)voidData(); }
|
||||
inline gdd::operator aitInt16*(void) const { return (aitInt16*)voidData(); }
|
||||
inline gdd::operator aitUint8*(void) const { return (aitUint8*)voidData(); }
|
||||
inline gdd::operator aitInt8*(void) const { return (aitInt8*)voidData(); }
|
||||
inline gdd::operator aitString*(void) const { return (aitString*)voidData(); }
|
||||
// ------------- primitive type pointer = gdd x functions --------------
|
||||
inline gdd::operator aitFloat64*(void) const
|
||||
{ return (aitFloat64*)dataPointer(); }
|
||||
inline gdd::operator aitFloat32*(void) const
|
||||
{ return (aitFloat32*)dataPointer(); }
|
||||
inline gdd::operator aitUint32*(void) const
|
||||
{ return (aitUint32*)dataPointer(); }
|
||||
inline gdd::operator aitInt32*(void) const
|
||||
{ return (aitInt32*)dataPointer(); }
|
||||
inline gdd::operator aitUint16*(void) const
|
||||
{ return (aitUint16*)dataPointer(); }
|
||||
inline gdd::operator aitInt16*(void) const
|
||||
{ return (aitInt16*)dataPointer(); }
|
||||
inline gdd::operator aitUint8*(void) const
|
||||
{ return (aitUint8*)dataPointer(); }
|
||||
inline gdd::operator aitInt8*(void) const
|
||||
{ return (aitInt8*)dataPointer(); }
|
||||
inline gdd::operator aitString*(void) const
|
||||
{ return (aitString*)dataPointer(); }
|
||||
inline gdd::operator aitFixedString*(void) const
|
||||
{ return (aitFixedString*)voidData(); }
|
||||
{ return (aitFixedString*)dataPointer(); }
|
||||
|
||||
// ------------- primitive type = gdd x functions --------------
|
||||
inline gdd::operator aitFloat64(void) { aitFloat64 d; get(d); return d; }
|
||||
inline gdd::operator aitFloat32(void) { aitFloat32 d; get(d); return d; }
|
||||
inline gdd::operator aitUint32(void) { aitUint32 d; get(d); return d; }
|
||||
@@ -986,8 +1108,9 @@ inline gdd::operator aitUint8(void) { aitUint8 d; get(d); return d; }
|
||||
inline gdd::operator aitInt8(void) { aitInt8 d; get(d); return d; }
|
||||
inline gdd::operator aitString(void) { aitString d; get(d); return d; }
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// ***********************************************************************
|
||||
// Adds ability to put array data into a DD, get it out, and adjust it
|
||||
// ***********************************************************************
|
||||
|
||||
class gddAtomic : public gdd
|
||||
{
|
||||
@@ -1123,7 +1246,7 @@ private:
|
||||
};
|
||||
|
||||
inline gdd* gddContainer::cData(void) const
|
||||
{ return (gdd*)voidData(); }
|
||||
{ return (gdd*)dataPointer(); }
|
||||
inline int gddContainer::total(void)
|
||||
{ return bounds->size(); }
|
||||
inline gdd* gddContainer::operator[](aitIndex index)
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.4 1996/08/06 19:14:13 jbk
|
||||
// Fixes to the string class.
|
||||
// Changes units field to a aitString instead of aitInt8.
|
||||
//
|
||||
// Revision 1.3 1996/07/26 02:23:18 jbk
|
||||
// Fixed the spelling error with Scalar.
|
||||
//
|
||||
@@ -47,7 +51,7 @@ void gddApplicationTypeTable::GenerateTypes(void)
|
||||
|
||||
// Just describe the menu - allow the block of choiced to be
|
||||
// referenced in.
|
||||
gddAtomic* add_enum = new gddAtomic(0,aitEnumFixedString,1);
|
||||
gddAtomic* add_enum = new gddAtomic(0,aitEnumFixedString,1,16);
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// register simple types
|
||||
@@ -78,8 +82,11 @@ void gddApplicationTypeTable::GenerateTypes(void)
|
||||
int type_awlow=registerApplicationType(GDD_NAME_ALARM_WARN_LOW);
|
||||
int type_maxele=registerApplicationType(GDD_NAME_MAX_ELEMENTS);
|
||||
int type_value=registerApplicationType(GDD_NAME_VALUE);
|
||||
int type_menu=registerApplicationType(GDD_NAME_ENUM);
|
||||
int type_units=registerApplicationTypeWithProto(GDD_NAME_UNITS,add_units);
|
||||
int type_menu=registerApplicationTypeWithProto(GDD_NAME_ENUM,add_enum);
|
||||
|
||||
// old menu method
|
||||
// int type_menu=registerApplicationTypeWithProto(GDD_NAME_ENUM,add_enum);
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// register container types - not as easy
|
||||
@@ -143,7 +150,8 @@ void gddApplicationTypeTable::GenerateTypes(void)
|
||||
|
||||
// DBR_GR_ENUM
|
||||
gddContainer* cdd_gr_enum=new gddContainer(0);
|
||||
cdd_gr_enum->insert(getDD(type_menu));
|
||||
// old menu method: cdd_gr_enum->insert(getDD(type_menu));
|
||||
cdd_gr_enum->insert(new gddAtomic(type_menu,aitEnumFixedString,1));
|
||||
cdd_gr_enum->insert(new gddScalar(type_value,aitEnumEnum16));
|
||||
registerApplicationTypeWithProto("dbr_gr_enum",cdd_gr_enum);
|
||||
|
||||
@@ -215,7 +223,8 @@ void gddApplicationTypeTable::GenerateTypes(void)
|
||||
|
||||
// DBR_CTRL_ENUM
|
||||
gddContainer* cdd_ctrl_enum=new gddContainer(0);
|
||||
cdd_ctrl_enum->insert(getDD(type_menu));
|
||||
// old method: cdd_ctrl_enum->insert(getDD(type_menu));
|
||||
cdd_ctrl_enum->insert(new gddAtomic(type_menu,aitEnumFixedString,1));
|
||||
cdd_ctrl_enum->insert(new gddScalar(type_value,aitEnumEnum16));
|
||||
registerApplicationTypeWithProto("dbr_ctrl_enum",cdd_ctrl_enum);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user