Commit ed5d1d07 authored by lw's avatar lw

Added pwr_mClassDef ohFlags to .dbs files

parent 52277a67
......@@ -437,6 +437,7 @@ struct dbs_sObject {
pwr_tOid foid; /**< object identifier of first child object. */
pwr_tOid loid; /**< object identifier of last child object. */
pwr_mClassDef ohFlags; /**< object header flags */
dbs_mFlags flags;
dbs_sBodyRef rbody; /**< runtime body */
dbs_sBodyRef dbody; /**< development body */
......
......@@ -297,6 +297,13 @@ pdr_pwr_tBitMask(PDR *pdrs, pwr_tBitMask *objp)
}
pwr_tBoolean
pdr_pwr_mClassDef(PDR *pdrs, pwr_mClassDef *objp)
{
PWR_PDR_INT(pdrs, &objp->m);
return TRUE;
}
pwr_tBoolean
pdr_pwr_tBoolean(PDR *pdrs, pwr_tBoolean *objp)
{
......
......@@ -121,6 +121,9 @@ pdr_pwr_tBit(PDR *pdrs, pwr_tBit *objp);
pwr_tBoolean
pdr_pwr_tBitMask(PDR *pdrs, pwr_tBitMask *objp);
pwr_tBoolean
pdr_pwr_mClassDef(PDR *pdrs, pwr_mClassDef *objp);
pwr_tBoolean
pdr_pwr_tBoolean(PDR *pdrs, pwr_tBoolean *objp);
......
......@@ -183,6 +183,8 @@ public:
const char *normname() {return m_o.normname;}
pwr_mClassDef flags() { return m_o.flags;}
size_t rbSize() { return m_o.body[0].size;}
size_t dbSize() { return m_o.body[1].size;}
pwr_tTime rbTime() { return m_o.body[0].time;}
......
......@@ -248,14 +248,8 @@ bool wb_dbs::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
m_nObjects++;
m_volume.cardinality++;
if ( flags.b.DevOnly)
if (flags.b.DevOnly)
oep->o.flags.b.devOnly = 1;
#if 0
if (fep == NULL)
oep->flags.b.devOnly = o.isDevOnly();
else
oep->flags.b.devOnly = fep->flags.b.devOnly || o.isDevOnly();
#endif
oep->o.oid = oid;
oep->o.cid = cid;
......@@ -280,6 +274,8 @@ bool wb_dbs::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
nep->oep = oep;
}
oep->o.ohFlags.m = flags.m;
classInsert(oep);
oep->o.rbody.time = rbTime;
......@@ -839,6 +835,9 @@ writeTree(wb_dbs::sOentry *oep, FILE *fp)
if (!oep)
return 1;
if (oep->poep)
oep->flags.b.devOnly |= oep->poep->flags.b.devOnly;
if (fwrite(&oep->o, dbs_dAlign(sizeof(oep->o)), 1, fp) < 1)
return LDH__FILEWRITE;
......
......@@ -139,8 +139,7 @@ pwr_tTime wb_orepdbs::ohTime() const
pwr_mClassDef wb_orepdbs::flags() const
{
pwr_mClassDef flags; flags.m = 0; // Fix !!!
return flags;
return m_o->ohFlags;
}
bool wb_orepdbs::isOffspringOf(const wb_orep *o) const
......
......@@ -771,8 +771,16 @@ pwr_tTime wb_vrepdb::ohTime(pwr_tStatus *sts, const wb_orep *orp)
pwr_mClassDef wb_vrepdb::flags(pwr_tStatus *sts, const wb_orep *orp)
{
pwr_mClassDef flags; flags.m = 0; // Fix !!
return flags;
*sts = LDH__SUCCESS;
try {
return m_ohead.get(m_db->m_txn, orp->oid()).flags();
}
catch (DbException &e) {
*sts = LDH__NOSUCHOBJ;
printf("vrepdb: %s\n", e.what());
pwr_mClassDef flags; flags.m = 0;
return flags;
}
}
pwr_tVid wb_vrepdb::vid(pwr_tStatus *sts, const wb_orep *orp)
......
......@@ -84,6 +84,70 @@ bool wb_vrepdbs::load()
return rsts;
}
pwr_tOid wb_vrepdbs::oid(pwr_tStatus *sts, const wb_orep *o)
{
return o->oid();
}
pwr_tVid wb_vrepdbs::vid(pwr_tStatus *sts, const wb_orep *o)
{
return o->vid();
}
pwr_tOix wb_vrepdbs::oix(pwr_tStatus *sts, const wb_orep *o)
{
return o->oix();
}
pwr_tCid wb_vrepdbs::cid(pwr_tStatus *sts, const wb_orep *o)
{
return o->cid();
}
pwr_tOid wb_vrepdbs::poid(pwr_tStatus *sts, const wb_orep *o)
{
return o->foid();
}
pwr_tOid wb_vrepdbs::foid(pwr_tStatus *sts, const wb_orep *o)
{
return o->foid();
}
pwr_tOid wb_vrepdbs::loid(pwr_tStatus *sts, const wb_orep *o)
{
return o->loid();
}
pwr_tOid wb_vrepdbs::boid(pwr_tStatus *sts, const wb_orep *o)
{
return o->boid();
}
pwr_tOid wb_vrepdbs::aoid(pwr_tStatus *sts, const wb_orep *o)
{
return o->aoid();
}
const char *wb_vrepdbs::objectName(pwr_tStatus *sts, const wb_orep *o)
{
return o->name();
}
wb_name wb_vrepdbs::longName(pwr_tStatus *sts, const wb_orep *o)
{
return wb_name();
}
pwr_tTime wb_vrepdbs::ohTime(pwr_tStatus *sts, const wb_orep *o)
{
return o->ohTime();
}
pwr_mClassDef wb_vrepdbs::flags(pwr_tStatus *sts, const wb_orep *o)
{
return o->flags();
}
wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, pwr_tOid oid)
{
......@@ -471,11 +535,10 @@ bool wb_vrepdbs::exportHead(wb_import &i)
{
dbs_sObject *op = 0;
pwr_tStatus sts;
pwr_mClassDef flags; flags.m = 0; // Fix !!!
while ((op = dbs_NextHead(&sts, dbsenv(), op))) {
i.importHead(op->oid, op->cid, op->poid, op->boid, op->aoid, op->foid, op->loid, op->name, op->normname,
flags, op->time, op->rbody.time, op->dbody.time, op->rbody.size, op->dbody.size);
op->ohFlags, op->time, op->rbody.time, op->dbody.time, op->rbody.size, op->dbody.size);
}
return true;
......@@ -551,8 +614,7 @@ bool wb_vrepdbs::exportTreeObject(wb_treeimport &i, dbs_sObject *op, bool isRoot
if ( op->dbody.size)
dbody = dbs_Body(&sts, dbsenv(), op, pwr_eBix_dev);
pwr_mClassDef flags; flags.m = 0; // Fix !!!
i.importTreeObject( m_merep, op->oid, op->cid, parentoid, beforeoid, op->name, flags,
i.importTreeObject( m_merep, op->oid, op->cid, parentoid, beforeoid, op->name, op->ohFlags,
op->rbody.size, op->dbody.size, rbody, dbody);
if ( first)
......
......@@ -36,27 +36,27 @@ public:
virtual ldh_eVolRep type() const { return ldh_eVolRep_Dbs;}
virtual wb_erep *erep() ;
virtual pwr_tOid oid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid oid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tVid vid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNVid;}
virtual pwr_tVid vid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOix oix(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOix;}
virtual pwr_tOix oix(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tCid cid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNCid;}
virtual pwr_tCid cid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid poid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid foid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid loid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid boid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid aoid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid poid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid foid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid loid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid boid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid aoid(pwr_tStatus *sts, const wb_orep *o);
virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o) { return "";}
virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o);
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();}
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { pwr_tTime t = {0, 0}; return t;}
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o) { pwr_mClassDef f; f.m = 0; return f;}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o);
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;}
......
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