Commit 938df603 authored by Claes Sjofors's avatar Claes Sjofors

Class cache compatible with 4.6, and incompatible with 4.8.2 (refs #25)

parent edfeab38
......@@ -384,6 +384,9 @@ cmvolc_GetNonExistingClass (
net_sGclass *gcp;
pwr_tObjid poid;
pwr_tTime gcp_time;
pwr_sClassDef classdef;
pwr_sObjBodyDef objbodydef;
pwr_sParam attrdef;
gdb_AssumeLocked;
......@@ -448,22 +451,44 @@ cmvolc_GetNonExistingClass (
poid.vid = cvid;
poid.oix = 1; /* ClassHier object is the father */
memset( &classdef, 0, sizeof(classdef));
classdef.Editor = gcp->cb.Editor;
classdef.Method = gcp->cb.Method;
classdef.Flags = (pwr_mClassDef) gcp->cb.Flags;
classdef.NumOfObjBodies = gcp->cb.NumOfObjBodies;
gcp_time = net_NetTimeToTime(&gcp->time);
cop = createObject(sts, vp, &gcp->co, &gcp_time, gcp->dbsFlags,
&gcp->cb, sizeof(gcp->cb), poid);
&classdef, sizeof(classdef), poid);
if (cop == NULL)
goto cleanup;
memset( &objbodydef, 0, sizeof(objbodydef));
strcpy( objbodydef.StructName, gcp->bb.StructName);
objbodydef.NumOfParams = gcp->bb.NumOfParams;
objbodydef.Size = gcp->bb.Size;
objbodydef.NextAix = gcp->bb.NextAix;
objbodydef.Flags = gcp->bb.Flags;
bop = createObject(&lsts, vp, &gcp->bo, &gcp_time, 0,
&gcp->bb, sizeof(gcp->bb), cop->g.oid);
&objbodydef, sizeof(objbodydef), cop->g.oid);
if (bop == NULL)
errh_Bugcheck(lsts, "cmvolc_GetNonExistingClass, load sys body failed");
for (i = j = 0, gap = msgs[0]->attr; i < gcp->acount; i++, gap++) {
strcpy( attrdef.Info.PgmName, gap->ab.Info.PgmName);
attrdef.Info.Type = gap->ab.Info.Type;
attrdef.Info.Offset = gap->ab.Info.Offset;
attrdef.Info.Size = gap->ab.Info.Size;
attrdef.Info.Flags = gap->ab.Info.Flags;
attrdef.Info.Elements = gap->ab.Info.Elements;
attrdef.Info.ParamIndex = gap->ab.Info.ParamIndex;
attrdef.TypeRef = gap->ab.TypeRef;
aop = createObject(&lsts, vp, &gap->ao, &gcp_time, 0,
&gap->ab, sizeof(gap->ab), bop->g.oid);
&attrdef, sizeof(gap->ab), bop->g.oid);
if (aop == NULL)
errh_Bugcheck(lsts, "cmvolc_GetNonExistingClass, load attribute failed");
......
......@@ -231,7 +231,11 @@ cmvolsm_GetGclass (
cbp = pool_Address(&sts, gdbroot->rtdb, cp->cbr);
if (cbp == NULL)
break;
rmp->gclass.cb = *cbp;
rmp->gclass.cb.Editor = cbp->Editor;
rmp->gclass.cb.Method = cbp->Method;
rmp->gclass.cb.Flags = (pwr_tUInt32) cbp->Flags.m;
rmp->gclass.cb.NumOfObjBodies = cbp->NumOfObjBodies;
rmp->gclass.cb.PopEditor = cbp->PopEditor;
bop = pool_Address(&sts, gdbroot->pool, cp->bor);
if (bop == NULL)
......@@ -241,7 +245,11 @@ cmvolsm_GetGclass (
bbp = pool_Address(&sts, gdbroot->rtdb, cp->bbr);
if (bbp == NULL)
break;
rmp->gclass.bb = *bbp;
strcpy( rmp->gclass.bb.StructName, bbp->StructName);
rmp->gclass.bb.NumOfParams = bbp->NumOfParams;
rmp->gclass.bb.Size = bbp->Size;
rmp->gclass.bb.NextAix = bbp->NextAix;
rmp->gclass.bb.Flags = bbp->Flags;
}
rmp->gclass.size = cp->size;
......@@ -260,7 +268,14 @@ cmvolsm_GetGclass (
abp = pool_Address(&sts, gdbroot->rtdb, ap->abr);
if (aop == NULL)
break;
gap->ab = *abp;
strcpy( gap->ab.Info.PgmName, abp->Info.PgmName);
gap->ab.Info.Type = abp->Info.Type;
gap->ab.Info.Offset = abp->Info.Offset;
gap->ab.Info.Size = abp->Info.Size;
gap->ab.Info.Flags = abp->Info.Flags;
gap->ab.Info.Elements = abp->Info.Elements;
gap->ab.Info.ParamIndex = abp->Info.ParamIndex;
gap->ab.TypeRef = abp->TypeRef;
}
rmp->acntmsg = acnt;
......
......@@ -235,6 +235,39 @@ enum net_eState {
net_eState_
};
/* ClassDef backward compatible */
struct net_sClassDef {
pwr_tInt32 Editor;
pwr_tInt32 Method;
pwr_tUInt32 Flags;
pwr_tUInt32 NumOfObjBodies;
pwr_tInt32 PopEditor;
};
/* ObjBodyDef backward compatible */
struct net_sObjBodyDef {
pwr_tStructName StructName;
pwr_tUInt32 NumOfParams;
pwr_tUInt32 Size;
pwr_tUInt32 NextAix;
pwr_tUInt32 Flags;
};
struct net_sParInfo {
pwr_tPgmName PgmName;
pwr_eType Type;
pwr_tUInt32 Offset;
pwr_tUInt32 Size;
pwr_tUInt32 Flags;
pwr_tUInt32 Elements;
pwr_tUInt32 ParamIndex;
};
struct net_sParam {
net_sParInfo Info;
pwr_tTypeId TypeRef;
};
/* Add subscription. */
struct net_sSubSpec {
......@@ -1029,7 +1062,7 @@ struct net_sMount {
struct net_sGattribute {
net_sGobject ao;
pwr_sParam ab;
net_sParam ab;
};
......@@ -1037,9 +1070,9 @@ struct net_sGclass {
net_sTime time; /**< Time of last change */
pwr_tBitMask dbsFlags;
net_sGobject co;
pwr_sClassDef cb;
net_sClassDef cb;
net_sGobject bo;
pwr_sObjBodyDef bb;
net_sObjBodyDef bb;
pwr_tUInt32 size; /**< Size of objects body */
pwr_tUInt32 acount; /**< # of attributes */
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment