Commit 1f887ab6 authored by lw's avatar lw

*** empty log message ***

parent 8dc40ca9
...@@ -92,8 +92,8 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, wb_adrep* adrep, int ...@@ -92,8 +92,8 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, wb_adrep* adrep, int
} }
} }
wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, const char* bname) : wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, const char *bname) :
wb_status(sts), m_orep(orep), m_adrep(0), m_size(0), m_offset(0), m_idx(0), m_tid(0), wb_status(sts), m_orep(orep), m_adrep(0), m_size(0), m_offset(0), m_idx(0), m_tid(0),
m_elements(0), m_type(pwr_eType_), m_flags(0), m_bix(pwr_eBix__) m_elements(0), m_type(pwr_eType_), m_flags(0), m_bix(pwr_eBix__)
{ {
if ( orep == 0) if ( orep == 0)
...@@ -115,7 +115,7 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, const char* bname) : ...@@ -115,7 +115,7 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, const char* bname) :
} }
} }
wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, const char* bname, const char* aname) : wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, const char *bname, const char *aname) :
wb_status(sts), m_orep(orep), m_adrep(0), m_size(0), m_offset(0), m_idx(0), m_tid(0), wb_status(sts), m_orep(orep), m_adrep(0), m_size(0), m_offset(0), m_idx(0), m_tid(0),
m_elements(0), m_type(pwr_eType_), m_flags(0), m_bix(pwr_eBix__) m_elements(0), m_type(pwr_eType_), m_flags(0), m_bix(pwr_eBix__)
{ {
...@@ -160,7 +160,7 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, const char* bname, co ...@@ -160,7 +160,7 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, const char* bname, co
} }
} }
wb_attribute::wb_attribute(const wb_attribute& pa, int idx, const char* aname) : wb_attribute::wb_attribute(const wb_attribute& pa, int idx, const char *aname) :
wb_status(LDH__NOSUCHATTR), m_orep(0), m_adrep(0), m_size(0), m_offset(0), m_tid(0), wb_status(LDH__NOSUCHATTR), m_orep(0), m_adrep(0), m_size(0), m_offset(0), m_tid(0),
m_elements(0), m_type(pwr_eType_), m_flags(0), m_bix(pwr_eBix__) m_elements(0), m_type(pwr_eType_), m_flags(0), m_bix(pwr_eBix__)
{ {
......
...@@ -45,9 +45,9 @@ public: ...@@ -45,9 +45,9 @@ public:
wb_attribute(const wb_attribute&); wb_attribute(const wb_attribute&);
wb_attribute(pwr_tStatus, wb_orep*); wb_attribute(pwr_tStatus, wb_orep*);
wb_attribute(pwr_tStatus, wb_orep*, wb_adrep*, int idx = -1); wb_attribute(pwr_tStatus, wb_orep*, wb_adrep*, int idx = -1);
wb_attribute(pwr_tStatus, wb_orep*, const char* bname); wb_attribute(pwr_tStatus, wb_orep*, const char *bname);
wb_attribute(pwr_tStatus, wb_orep*, const char* bname, const char* aname); wb_attribute(pwr_tStatus, wb_orep*, const char *bname, const char *aname);
wb_attribute(const wb_attribute& pa, int idx, const char* aname); wb_attribute(const wb_attribute& pa, int idx, const char *aname);
~wb_attribute(); ~wb_attribute();
wb_attribute& operator=(const wb_attribute&); wb_attribute& operator=(const wb_attribute&);
...@@ -92,7 +92,7 @@ public: ...@@ -92,7 +92,7 @@ public:
wb_attribute before() const; wb_attribute before() const;
wb_attribute first(int idx) const; wb_attribute first(int idx) const;
wb_attribute child(int idx, const char* name) const; wb_attribute child(int idx, const char *name) const;
const char *name() const; const char *name() const;
......
...@@ -43,7 +43,8 @@ wb_adrep *wb_bdrep::adrep( pwr_tStatus *sts) ...@@ -43,7 +43,8 @@ wb_adrep *wb_bdrep::adrep( pwr_tStatus *sts)
wb_adrep *wb_bdrep::adrep( pwr_tStatus *sts, const char *aname) wb_adrep *wb_bdrep::adrep( pwr_tStatus *sts, const char *aname)
{ {
wb_orepdbs *orep = (wb_orepdbs *)m_orep->m_vrep->child( sts, m_orep, aname); wb_name n(aname);
wb_orepdbs *orep = (wb_orepdbs *)m_orep->m_vrep->child( sts, m_orep, n);
if ( EVEN(*sts)) if ( EVEN(*sts))
return 0; return 0;
wb_adrep *adrep = new wb_adrep( *orep); wb_adrep *adrep = new wb_adrep( *orep);
......
...@@ -81,7 +81,9 @@ wb_cdrep::wb_cdrep( wb_adrep *adrep) : m_nRef(0) ...@@ -81,7 +81,9 @@ wb_cdrep::wb_cdrep( wb_adrep *adrep) : m_nRef(0)
wb_bdrep *wb_cdrep::bdrep( pwr_tStatus *sts, const char *bname) wb_bdrep *wb_cdrep::bdrep( pwr_tStatus *sts, const char *bname)
{ {
wb_orepdbs *orep = (wb_orepdbs *)m_orep->m_vrep->child( sts, m_orep, bname); wb_name n(bname);
wb_orepdbs *orep = (wb_orepdbs *)m_orep->m_vrep->child( sts, m_orep, n);
if ( EVEN(*sts)) if ( EVEN(*sts))
return 0; return 0;
wb_bdrep *bdrep = new wb_bdrep( *orep); wb_bdrep *bdrep = new wb_bdrep( *orep);
...@@ -138,7 +140,9 @@ wb_adrep *wb_cdrep::adrep( pwr_tStatus *sts, const char *aname) ...@@ -138,7 +140,9 @@ wb_adrep *wb_cdrep::adrep( pwr_tStatus *sts, const char *aname)
wb_orep *wb_cdrep::classBody( pwr_tStatus *sts, const char *bname) wb_orep *wb_cdrep::classBody( pwr_tStatus *sts, const char *bname)
{ {
wb_orepdbs *orep = (wb_orepdbs *)m_orep->m_vrep->child( sts, m_orep, bname); wb_name n(bname);
wb_orepdbs *orep = (wb_orepdbs *)m_orep->m_vrep->child( sts, m_orep, n);
if ( EVEN(*sts)) if ( EVEN(*sts))
return 0; return 0;
return orep; return orep;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "wb_ldh.h" #include "wb_ldh.h"
#include "wb_destination.h" #include "wb_destination.h"
#include "wb_db.h" #include "wb_db.h"
//#include "wb_import.h" #include "wb_name.h"
#include "wb_export.h" #include "wb_export.h"
...@@ -51,6 +51,13 @@ wb_db_class::wb_db_class(wb_db *db, pwr_tCid cid, pwr_tOid oid) : ...@@ -51,6 +51,13 @@ wb_db_class::wb_db_class(wb_db *db, pwr_tCid cid, pwr_tOid oid) :
m_k.cid = cid; m_k.cid = cid;
} }
wb_db_class::wb_db_class(wb_db *db, wb_db_ohead &o) :
m_db(db), m_key(&m_k, sizeof(m_k)), m_data(0, 0), m_dbc(0)
{
m_k.oid = o.oid();
m_k.cid = o.cid();
}
bool wb_db_class::succ(pwr_tOid oid) bool wb_db_class::succ(pwr_tOid oid)
{ {
m_k.oid = oid; m_k.oid = oid;
...@@ -104,11 +111,20 @@ wb_db_name::wb_db_name(wb_db *db, wb_db_ohead &o) : ...@@ -104,11 +111,20 @@ wb_db_name::wb_db_name(wb_db *db, wb_db_ohead &o) :
wb_db_name::wb_db_name(wb_db *db, pwr_tOid oid, pwr_tOid poid, const char *name) : wb_db_name::wb_db_name(wb_db *db, pwr_tOid oid, pwr_tOid poid, const char *name) :
m_db(db), m_key(&m_k, sizeof(m_k)), m_data(&m_d, sizeof(m_d)) m_db(db), m_key(&m_k, sizeof(m_k)), m_data(&m_d, sizeof(m_d))
{ {
wb_name n(name);
m_k.poid = poid; m_k.poid = poid;
strcpy(m_k.normname, name); strcpy(m_k.normname, n.normName(cdh_mName_object));
m_d.oid = oid; m_d.oid = oid;
} }
wb_db_name::wb_db_name(wb_db *db, wb_db_txn *txn, pwr_tOid poid, wb_name &name) :
m_db(db), m_key(&m_k, sizeof(m_k)), m_data(&m_d, sizeof(m_d))
{
m_k.poid = poid;
strcpy(m_k.normname, name.normName(cdh_mName_object));
m_d.oid = pwr_cNOid;
}
//wb_db_name::wb_db_name(wb_db *db, pwr_tOid, char *name) : //wb_db_name::wb_db_name(wb_db *db, pwr_tOid, char *name) :
// m_db(db), m_key(&m_k, sizeof(m_k)), m_data(&m_d, sizeof(m_d)) // m_db(db), m_key(&m_k, sizeof(m_k)), m_data(&m_d, sizeof(m_d))
...@@ -134,6 +150,20 @@ void wb_db_name::put(wb_db_txn *txn) ...@@ -134,6 +150,20 @@ void wb_db_name::put(wb_db_txn *txn)
m_db->m_t_name->put(txn, &m_key, &m_data, 0); m_db->m_t_name->put(txn, &m_key, &m_data, 0);
} }
void wb_db_name::del(wb_db_txn *txn)
{
m_db->m_t_name->del(txn, &m_key, 0);
}
void wb_db_name::name(wb_name &name)
{
strcpy(m_k.normname, name.normName(cdh_mName_object));
}
wb_db_ohead::wb_db_ohead() :
m_db(0), m_key(&m_o.oid, sizeof(m_o.oid)), m_data(&m_o, sizeof(m_o))
{
}
wb_db_ohead::wb_db_ohead(wb_db *db) : wb_db_ohead::wb_db_ohead(wb_db *db) :
m_db(db), m_key(&m_o.oid, sizeof(m_o.oid)), m_data(&m_o, sizeof(m_o)) m_db(db), m_key(&m_o.oid, sizeof(m_o.oid)), m_data(&m_o, sizeof(m_o))
{ {
...@@ -203,6 +233,17 @@ void wb_db_ohead::del(wb_db_txn *txn) ...@@ -203,6 +233,17 @@ void wb_db_ohead::del(wb_db_txn *txn)
m_db->m_t_ohead->del(txn, &m_key, 0); m_db->m_t_ohead->del(txn, &m_key, 0);
} }
void wb_db_ohead::name(wb_name &name)
{
strcpy(m_o.name, name.name(cdh_mName_object));
strcpy(m_o.normname, name.normName(cdh_mName_object));
}
void wb_db_ohead::clear()
{
memset(&m_o, 0, sizeof(m_o));
}
wb_db_rbody::wb_db_rbody(wb_db *db, pwr_tOid oid, size_t size, void *p) : wb_db_rbody::wb_db_rbody(wb_db *db, pwr_tOid oid, size_t size, void *p) :
m_db(db), m_oid(oid), m_size(size), m_p(p), m_key(&m_oid, sizeof(m_oid)), m_data(p, size) m_db(db), m_oid(oid), m_size(size), m_p(p), m_key(&m_oid, sizeof(m_oid)), m_data(p, size)
{ {
...@@ -284,8 +325,16 @@ void wb_db::create(pwr_tVid vid, pwr_tCid cid, const char *volumeName, const cha ...@@ -284,8 +325,16 @@ void wb_db::create(pwr_tVid vid, pwr_tCid cid, const char *volumeName, const cha
openDb(); openDb();
} }
wb_db_txn *wb_db::begin(wb_db_txn *txn)
{
wb_db_txn *new_txn;
void wb_db::open(const char *fileName) m_env->txn_begin((DbTxn *)txn, (DbTxn **)&new_txn, 0);
return new_txn;
}
void wb_db::open(const char *fileName)
{ {
dcli_translate_filename(m_fileName, fileName); dcli_translate_filename(m_fileName, fileName);
openDb(); openDb();
......
...@@ -153,12 +153,15 @@ public: ...@@ -153,12 +153,15 @@ public:
void del(wb_db_txn *txn); void del(wb_db_txn *txn);
pwr_tOid oid() { return m_o.oid;} pwr_tOid oid() { return m_o.oid;}
pwr_tVid vid() { return m_o.oid.vid;}
pwr_tOix oix() { return m_o.oid.oix;}
pwr_tCid cid() { return m_o.cid;} pwr_tCid cid() { return m_o.cid;}
pwr_tOid poid() { return m_o.poid;} pwr_tOid poid() { return m_o.poid;}
pwr_tOid foid() { return m_o.foid;} pwr_tOid foid() { return m_o.foid;}
pwr_tOid loid() { return m_o.loid;} pwr_tOid loid() { return m_o.loid;}
pwr_tOid boid() { return m_o.boid;} pwr_tOid boid() { return m_o.boid;}
pwr_tOid aoid() { return m_o.aoid;} pwr_tOid aoid() { return m_o.aoid;}
pwr_tTime ohTime() { return m_o.time;}
char *name() { return m_o.name;} char *name() { return m_o.name;}
...@@ -166,6 +169,8 @@ public: ...@@ -166,6 +169,8 @@ public:
size_t rbSize() { return m_o.body[0].size;} size_t rbSize() { return m_o.body[0].size;}
size_t dbSize() { return m_o.body[1].size;} size_t dbSize() { return m_o.body[1].size;}
pwr_tTime rbTime() { return m_o.body[0].time;}
pwr_tTime dbTime() { return m_o.body[1].time;}
void name(wb_name &name); void name(wb_name &name);
...@@ -202,7 +207,7 @@ public: ...@@ -202,7 +207,7 @@ public:
wb_db_name(wb_db *db, pwr_tOid, char *name); wb_db_name(wb_db *db, pwr_tOid, char *name);
wb_db_name(wb_db *db, pwr_tOid poid, const char *name); wb_db_name(wb_db *db, pwr_tOid poid, const char *name);
wb_db_name(wb_db *db, pwr_tOid oid, pwr_tOid poid, const char *name); wb_db_name(wb_db *db, pwr_tOid oid, pwr_tOid poid, const char *name);
wb_db_name(wb_db *db, wb_db_txn *txn, pwr_tOid poid, wb_name name); wb_db_name(wb_db *db, wb_db_txn *txn, pwr_tOid poid, wb_name &name);
void get(wb_db_txn *txn); void get(wb_db_txn *txn);
void put(wb_db_txn *txn); void put(wb_db_txn *txn);
......
...@@ -131,7 +131,8 @@ wb_dbs::checkObject(sOentry *oep) ...@@ -131,7 +131,8 @@ wb_dbs::checkObject(sOentry *oep)
} }
m_nTreeObjects++; m_nTreeObjects++;
//printf("tree: %s\n", oep->o.name); //printf("tree: %s\n", oep->o.name);
oep->ref = dbs_dMakeRef(dbs_eSect_object, m_sect[dbs_eSect_object].size); oep->ref = dbs_dMakeRef(dbs_eSect_object, m_sect[dbs_eSect_object].size);
...@@ -140,6 +141,30 @@ wb_dbs::checkObject(sOentry *oep) ...@@ -140,6 +141,30 @@ wb_dbs::checkObject(sOentry *oep)
dbs_Qinit(&sts, &oep->o.sib_ll, oep->ref + offsetof(dbs_sObject, sib_ll)); dbs_Qinit(&sts, &oep->o.sib_ll, oep->ref + offsetof(dbs_sObject, sib_ll));
dbs_Qinit(&sts, &oep->o.o_ll, oep->ref + offsetof(dbs_sObject, o_ll)); dbs_Qinit(&sts, &oep->o.o_ll, oep->ref + offsetof(dbs_sObject, o_ll));
switch (oep->o.cid) {
case pwr_eClass_LibHier:
if (m_volume.cid == pwr_eClass_ClassVolume)
break;
oep->o.flags.b.devOnly = 1;
break;
case pwr_eClass_Alias:
if (m_volume.cid == pwr_eClass_ClassVolume)
break;
oep->o.flags.b.isAliasClient = 1;
break;
case pwr_eClass_MountVolume:
case pwr_eClass_CreateVolume:
case pwr_eClass_MountObject:
if (m_volume.cid != pwr_eClass_RootVolume) {
oep->o.flags.b.isMountClient = 1;
}
break;
default:
break;
}
oep->o.flags.b.isMountClean = 1;
// Check all children // Check all children
sib_lh = sib_ll = &oep->o.sib_lh; sib_lh = sib_ll = &oep->o.sib_lh;
...@@ -755,7 +780,13 @@ wb_dbs::importRbody(pwr_tOid oid, size_t size, void *body) ...@@ -755,7 +780,13 @@ wb_dbs::importRbody(pwr_tOid oid, size_t size, void *body)
} }
//printf("install body: %u\n", (unsigned int)body); //printf("install body: %u\n", (unsigned int)body);
//printf(" 1 install Rbody %s, bsize: %d, ssize: %d\n", oep->o.name, oep->rbody.size, m_sect[dbs_eSect_rbody].size); //printf(" 1 install Rbody %s, bsize: %d, ssize: %d\n", oep->o.name, oep->rbody.size, m_sect[dbs_eSect_rbody].size);
if (oep->o.flags.b.isMountClient)
getMountServer(oep, body);
if (oep->o.flags.b.isAliasClient)
getAliasServer(oep, body);
if (oep->rbody.size == 0) { if (oep->rbody.size == 0) {
if (body != 0) printf("error body size\n"); if (body != 0) printf("error body size\n");
return true; return true;
...@@ -957,3 +988,126 @@ wb_dbs::importMeta(dbs_sEnv *ep) ...@@ -957,3 +988,126 @@ wb_dbs::importMeta(dbs_sEnv *ep)
{ {
return true; return true;
} }
void wb_dbs::getAliasServer(sOentry *oep, void *p)
{
pwr_tStatus sts;
pwr_sAlias *alias = (pwr_sAlias *)p;
sOentry *aep;
oep->o.flags.b.isAliasClient = 0;
if (cdh_ObjidIsNull(alias->Object)) {
printf("!! Alias does not refer to any object!\n");
printf(" Alias: %s\n", pathName(oep));
printf(" Alias will not be loaded.\n");
m_warnings++;
return;
}
if (alias->Object.vid != m_volume.vid) {
printf("!! Alias refers to object outside own volume!\n");
printf(" Alias: %s\n", pathName(oep));
printf(" Object: %s\n", cdh_ObjidToString(NULL, alias->Object, 1));
printf(" Alias will not be loaded.\n");
m_warnings++;
return;
}
aep = (sOentry *)tree_Find(&sts, m_oid_th, &alias->Object);
if (!aep) {
printf("!! Alias refers to a non existing object!\n");
printf(" Alias: %s\n", pathName(oep));
printf(" Alias will not be loaded.\n");
m_warnings++;
return;
}
if (aep->o.flags.b.devOnly) {
printf("!! An alias may not refer to a non runtime object!\n");
printf(" Alias: %s\n", pathName(oep));
printf(" Object: %s\n", pathName(aep));
printf(" Alias will not be loaded.\n");
m_warnings++;
return;
}
switch (aep->o.cid) {
case pwr_eClass_Alias:
printf("!! An alias may not refer to another alias!\n");
printf(" Alias: %s\n", pathName(oep));
printf(" Object: %s\n", pathName(aep));
printf(" Alias will not be loaded.\n");
m_warnings++;
return;
break;
case pwr_eClass_MountVolume:
case pwr_eClass_CreateVolume:
case pwr_eClass_MountObject:
printf("!! An alias may not refer to a mount object!\n");
printf(" Alias: %s\n", pathName(oep));
printf(" Object: %s\n", pathName(aep));
printf(" Alias will not be loaded.\n");
m_warnings++;
return;
break;
}
oep->o.flags.b.isAliasClient = 1;
oep->o.soid = aep->o.oid;
}
char *wb_dbs::pathName(sOentry *oep)
{
static char buff[512];
static int level = 0;
if (level == 0)
buff[0] = '\0';
if (oep != m_oep) {
level++;
pathName(oep->poep);
level--;
strcat(buff, oep->o.name);
if (level > 0)
strcat(buff, "-");
} else {
strcat(buff, oep->o.name);
strcat(buff, ":");
}
return buff;
}
void wb_dbs::getMountServer(sOentry *oep, void *p)
{
switch (oep->o.cid) {
case pwr_eClass_MountObject:
{
pwr_sMountObject *mountObject;
mountObject = (pwr_sMountObject *) p;
oep->o.soid = mountObject->Object;
break;
}
case pwr_eClass_MountVolume:
{
pwr_sMountVolume *mountVolume;
mountVolume = (pwr_sMountVolume *) p;
oep->o.soid = pwr_cNOid;
oep->o.soid.vid = mountVolume->Volume;
break;
}
case pwr_eClass_CreateVolume:
{
pwr_sCreateVolume *createVolume;
createVolume = (pwr_sCreateVolume *) p;
oep->o.soid = pwr_cNOid;
oep->o.soid.vid = createVolume->Volume;
break;
}
default:
break;
}
}
...@@ -100,10 +100,14 @@ public: ...@@ -100,10 +100,14 @@ public:
operator bool() const; operator bool() const;
bool operator==(wb_dbs&); bool operator==(const wb_dbs&) const;
void setFileName(const char *name); void setFileName(const char *name);
void getAliasServer(sOentry *oep, void *p);
char *pathName(sOentry *oep);
void getMountServer(sOentry *oep, void *p);
void buildSectName(); void buildSectName();
void buildSectOid(); void buildSectOid();
void buildSectClass(); void buildSectClass();
......
...@@ -487,9 +487,10 @@ wb_orep *wb_erep::object(pwr_tStatus *sts, pwr_tOid oid) ...@@ -487,9 +487,10 @@ wb_orep *wb_erep::object(pwr_tStatus *sts, pwr_tOid oid)
return vrep->object( sts, oid); return vrep->object( sts, oid);
} }
wb_orep *wb_erep::object(pwr_tStatus *sts, const char *name) wb_orep *wb_erep::object( pwr_tStatus *sts, const char *name)
{ {
wb_name n = wb_name(name); wb_name n(name);
if ( n.evenSts()) { if ( n.evenSts()) {
*sts = n.sts(); *sts = n.sts();
return 0; return 0;
...@@ -498,6 +499,19 @@ wb_orep *wb_erep::object(pwr_tStatus *sts, const char *name) ...@@ -498,6 +499,19 @@ wb_orep *wb_erep::object(pwr_tStatus *sts, const char *name)
wb_vrep *vrep = volume( sts, n.volume()); wb_vrep *vrep = volume( sts, n.volume());
if ( EVEN(*sts)) return 0; if ( EVEN(*sts)) return 0;
return vrep->object( sts, n);
}
wb_orep *wb_erep::object(pwr_tStatus *sts, wb_name &name)
{
if ( name.evenSts()) {
*sts = name.sts();
return 0;
}
wb_vrep *vrep = volume( sts, name.volume());
if ( EVEN(*sts)) return 0;
return vrep->object( sts, name); return vrep->object( sts, name);
} }
......
...@@ -11,6 +11,7 @@ class wb_cdrep; ...@@ -11,6 +11,7 @@ class wb_cdrep;
class wb_orep; class wb_orep;
class wb_tdrep; class wb_tdrep;
class wb_adrep; class wb_adrep;
class wb_name;
class wb_erep class wb_erep
{ {
...@@ -47,6 +48,7 @@ public: ...@@ -47,6 +48,7 @@ public:
void load( pwr_tStatus *sts); void load( pwr_tStatus *sts);
wb_orep *object( pwr_tStatus *sts, pwr_tOid oid); wb_orep *object( pwr_tStatus *sts, pwr_tOid oid);
wb_orep *object( pwr_tStatus *sts, wb_name &name);
wb_orep *object( pwr_tStatus *sts, const char *name); wb_orep *object( pwr_tStatus *sts, const char *name);
wb_cdrep *cdrep( pwr_tStatus *sts, const wb_orep& o); wb_cdrep *cdrep( pwr_tStatus *sts, const wb_orep& o);
......
...@@ -1236,6 +1236,7 @@ ldh_SetObjectBuffer(ldh_tSession session, pwr_tOid oid, char *bname, char *aname ...@@ -1236,6 +1236,7 @@ ldh_SetObjectBuffer(ldh_tSession session, pwr_tOid oid, char *bname, char *aname
wb_object o = sp->object(oid); wb_object o = sp->object(oid);
if (!o) return o.sts(); if (!o) return o.sts();
wb_attribute a = o.attribute(bname, aname); wb_attribute a = o.attribute(bname, aname);
if (!a) return a.sts(); if (!a) return a.sts();
...@@ -1255,7 +1256,8 @@ ldh_SetObjectName(ldh_tSession session, pwr_tOid oid, char *name) ...@@ -1255,7 +1256,8 @@ ldh_SetObjectName(ldh_tSession session, pwr_tOid oid, char *name)
wb_object o = sp->object(oid); wb_object o = sp->object(oid);
if (!o) return o.sts(); if (!o) return o.sts();
pwr_tStatus sts = sp->renameObject(o, name); wb_name n(name);
pwr_tStatus sts = sp->renameObject(o, n);
return sts; return sts;
} }
......
#include "wb_ldh_msg.h" #include "wb_ldh_msg.h"
#include "wb_object.h" #include "wb_object.h"
#include "wb_location.h"
#include "wb_error.h" #include "wb_error.h"
#include "wb_bdef.h" #include "wb_bdef.h"
...@@ -22,12 +21,6 @@ bool wb_object::check() ...@@ -22,12 +21,6 @@ bool wb_object::check()
return true; return true;
} }
// Return the current position of this object
wb_location wb_object::location()
{
return wb_location(*this);
}
wb_destination wb_object::destination(ldh_eDest dest) wb_destination wb_object::destination(ldh_eDest dest)
{ {
return wb_destination(*this, dest); return wb_destination(*this, dest);
...@@ -184,7 +177,7 @@ wb_object wb_object::first() ...@@ -184,7 +177,7 @@ wb_object wb_object::first()
// //
// Get the child with the given name. // Get the child with the given name.
// //
wb_object wb_object::child( const char* name) wb_object wb_object::child( wb_name &name)
{ {
check("wb_object::child()"); check("wb_object::child()");
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
class wb_bdef; class wb_bdef;
class wb_orep; class wb_orep;
class wb_location;
class wb_attribute; class wb_attribute;
class wb_destination; class wb_destination;
...@@ -71,12 +70,12 @@ public: ...@@ -71,12 +70,12 @@ public:
size_t rbSize(); //< size of run time body size_t rbSize(); //< size of run time body
size_t dbSize(); //< size of development body size_t dbSize(); //< size of development body
wb_bdef bdef(const char* bname); wb_bdef bdef(const char *bname);
wb_bdef bdef(pwr_eBix bix); wb_bdef bdef(pwr_eBix bix);
wb_attribute attribute(); wb_attribute attribute();
wb_attribute attribute(const char *aname); wb_attribute attribute(const char *aname);
wb_attribute attribute(const char *bname, const char *aname); wb_attribute attribute(const char *bname, const char*aname);
/* Navigational operations */ /* Navigational operations */
...@@ -85,13 +84,12 @@ public: ...@@ -85,13 +84,12 @@ public:
wb_object after(); //< next sibling wb_object after(); //< next sibling
wb_object before(); //< previous sibling wb_object before(); //< previous sibling
wb_object first(); //< first child wb_object first(); //< first child
wb_object child(const char *name); wb_object child(wb_name &name);
wb_object last(); //< last child wb_object last(); //< last child
wb_object next(); //< next in list of objects of same class in one volume wb_object next(); //< next in list of objects of same class in one volume
wb_object previous(); //< previous in list of objects of same class in one volume wb_object previous(); //< previous in list of objects of same class in one volume
wb_location location();
wb_destination destination(ldh_eDest dest); wb_destination destination(ldh_eDest dest);
private: private:
......
...@@ -46,20 +46,17 @@ public: ...@@ -46,20 +46,17 @@ public:
// Navigational operations // Navigational operations
virtual wb_orep *ancestor(pwr_tStatus *sts) const = 0; //< get object at top of hierarchy virtual wb_orep *ancestor(pwr_tStatus *sts) = 0; //< get object at top of hierarchy
virtual wb_orep *parent(pwr_tStatus *sts) const = 0; virtual wb_orep *parent(pwr_tStatus *sts) = 0;
virtual wb_orep *after(pwr_tStatus *sts) const = 0; //< get next sibling virtual wb_orep *after(pwr_tStatus *sts) = 0; //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const = 0; //< get previous sibling virtual wb_orep *before(pwr_tStatus *sts) = 0; //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const = 0; //< get first child virtual wb_orep *first(pwr_tStatus *sts) = 0; //< get first child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const = 0; //< get named child virtual wb_orep *child(pwr_tStatus *sts, wb_name &name) = 0; //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const = 0; //< get last child virtual wb_orep *last(pwr_tStatus *sts) = 0; //< get last child
virtual wb_orep *next(pwr_tStatus *sts) const = 0; //< get next in list of objects of same class in one volume virtual wb_orep *next(pwr_tStatus *sts) = 0; //< get next in list of objects of same class in one volume
virtual wb_orep *previous(pwr_tStatus *sts) const = 0; //< get previous in list of objects of same class in one volume virtual wb_orep *previous(pwr_tStatus *sts) = 0; //< get previous in list of objects of same class in one volume
virtual wb_position position() = 0; virtual wb_adrep *attribute(pwr_tStatus*, const char *name) = 0;
virtual wb_position position(ldh_eDest dest) = 0;
virtual wb_adrep *attribute(pwr_tStatus*, const char *aname) = 0;
virtual wb_adrep *attribute(pwr_tStatus*) = 0; virtual wb_adrep *attribute(pwr_tStatus*) = 0;
virtual wb_erep *erep() const = 0; virtual wb_erep *erep() const = 0;
......
#include "wb_orepdb.h" #include "wb_orepdb.h"
#include "wb_vrepdb.h" #include "wb_vrepdb.h"
wb_orepdb::wb_orepdb() :
m_o(0), m_oid(pwr_cNOid)
{
}
wb_orepdb::wb_orepdb(pwr_tOid oid) :
m_o(0), m_oid(oid)
{
}
wb_orepdb::wb_orepdb(db_sObject *o) :
m_o(o), m_oid(o->oid)
{
}
wb_orepdb::~wb_orepdb() wb_orepdb::~wb_orepdb()
{ {
} }
...@@ -77,64 +93,52 @@ bool wb_orepdb::isOffspringOf(const wb_orep *o) const ...@@ -77,64 +93,52 @@ bool wb_orepdb::isOffspringOf(const wb_orep *o) const
return m_vrep->isOffspringOf(&sts, (wb_orep*)this, o); return m_vrep->isOffspringOf(&sts, (wb_orep*)this, o);
} }
wb_orep *wb_orepdb::ancestor(pwr_tStatus *sts) const wb_orep *wb_orepdb::ancestor(pwr_tStatus *sts)
{ {
return m_vrep->ancestor(sts, (wb_orep*)this); return m_vrep->ancestor(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdb::parent(pwr_tStatus *sts) const wb_orep *wb_orepdb::parent(pwr_tStatus *sts)
{ {
return m_vrep->parent(sts, (wb_orep*)this); return m_vrep->parent(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdb::after(pwr_tStatus *sts) const wb_orep *wb_orepdb::after(pwr_tStatus *sts)
{ {
return m_vrep->after(sts, (wb_orep*)this); return m_vrep->after(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdb::before(pwr_tStatus *sts) const wb_orep *wb_orepdb::before(pwr_tStatus *sts)
{ {
return m_vrep->before(sts, (wb_orep*)this); return m_vrep->before(sts, (wb_orep*)this);
} }
wb_orep* wb_orepdb::first(pwr_tStatus *sts) const wb_orep* wb_orepdb::first(pwr_tStatus *sts)
{ {
return m_vrep->first(sts, (wb_orep*)this); return m_vrep->first(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdb::child(pwr_tStatus *sts, const char *name) const wb_orep *wb_orepdb::child(pwr_tStatus *sts, wb_name &name)
{ {
return m_vrep->child(sts, (wb_orep*)this, name); return m_vrep->child(sts, (wb_orep*)this, name);
} }
wb_orep *wb_orepdb::last(pwr_tStatus *sts) const wb_orep *wb_orepdb::last(pwr_tStatus *sts)
{ {
return m_vrep->last(sts, (wb_orep*)this); return m_vrep->last(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdb::next(pwr_tStatus *sts) const wb_orep *wb_orepdb::next(pwr_tStatus *sts)
{ {
return m_vrep->next(sts, (wb_orep*)this); return m_vrep->next(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdb::previous(pwr_tStatus *sts) const wb_orep *wb_orepdb::previous(pwr_tStatus *sts)
{ {
return m_vrep->previous(sts, (wb_orep*)this); return m_vrep->previous(sts, (wb_orep*)this);
} }
wb_position wb_orepdb::position()
{
wb_position pos;
return pos;
}
wb_position wb_orepdb::position(ldh_eDest dest)
{
wb_position pos;
return pos;
}
wb_adrep *wb_orepdb::attribute(pwr_tStatus*, const char *aname) wb_adrep *wb_orepdb::attribute(pwr_tStatus*, const char *aname)
{ {
return 0; return 0;
......
...@@ -38,20 +38,17 @@ public: ...@@ -38,20 +38,17 @@ public:
// Navigational operations // Navigational operations
virtual wb_orep *ancestor(pwr_tStatus *sts) const; //< get object at top of hierarchy virtual wb_orep *ancestor(pwr_tStatus *sts); //< get object at top of hierarchy
virtual wb_orep *parent(pwr_tStatus *sts) const; virtual wb_orep *parent(pwr_tStatus *sts);
virtual wb_orep *after(pwr_tStatus *sts) const; //< get next sibling virtual wb_orep *after(pwr_tStatus *sts); //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const; //< get previous sibling virtual wb_orep *before(pwr_tStatus *sts); //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const; //< get first child virtual wb_orep *first(pwr_tStatus *sts); //< get first child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const; //< get named child virtual wb_orep *child(pwr_tStatus *sts, wb_name &name); //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const; //< get last child virtual wb_orep *last(pwr_tStatus *sts); //< get last child
virtual wb_orep *next(pwr_tStatus *sts) const; //< get next in list of objects of same class in one volume virtual wb_orep *next(pwr_tStatus *sts); //< get next in list of objects of same class in one volume
virtual wb_orep *previous(pwr_tStatus *sts) const; //< get previous in list of objects of same class in one volume virtual wb_orep *previous(pwr_tStatus *sts); //< get previous in list of objects of same class in one volume
virtual wb_position position(); virtual wb_adrep *attribute(pwr_tStatus*, const char *name);
virtual wb_position position(ldh_eDest dest);
virtual wb_adrep *attribute(pwr_tStatus*, const char *aname);
virtual wb_adrep *attribute(pwr_tStatus*); virtual wb_adrep *attribute(pwr_tStatus*);
wb_erep *erep() const { return m_vrep->erep();} wb_erep *erep() const { return m_vrep->erep();}
......
...@@ -143,47 +143,47 @@ bool wb_orepdbs::isOffspringOf(const wb_orep *o) const ...@@ -143,47 +143,47 @@ bool wb_orepdbs::isOffspringOf(const wb_orep *o) const
} }
wb_orep *wb_orepdbs::after(pwr_tStatus *sts) const wb_orep *wb_orepdbs::after(pwr_tStatus *sts)
{ {
return m_vrep->after(sts, (wb_orep*)this); return m_vrep->after(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdbs::before(pwr_tStatus *sts) const wb_orep *wb_orepdbs::before(pwr_tStatus *sts)
{ {
return m_vrep->before(sts, (wb_orep*)this); return m_vrep->before(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdbs::ancestor(pwr_tStatus *sts) const wb_orep *wb_orepdbs::ancestor(pwr_tStatus *sts)
{ {
return m_vrep->ancestor(sts, (wb_orep*)this); return m_vrep->ancestor(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdbs::parent(pwr_tStatus *sts) const wb_orep *wb_orepdbs::parent(pwr_tStatus *sts)
{ {
return m_vrep->parent(sts, (wb_orep*)this); return m_vrep->parent(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdbs::first(pwr_tStatus *sts) const wb_orep *wb_orepdbs::first(pwr_tStatus *sts)
{ {
return m_vrep->first(sts, (wb_orep*)this); return m_vrep->first(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdbs::child(pwr_tStatus *sts, const char *name) const wb_orep *wb_orepdbs::child(pwr_tStatus *sts, wb_name &name)
{ {
return m_vrep->child(sts, (wb_orep*)this, name); return m_vrep->child(sts, (wb_orep*)this, name);
} }
wb_orep *wb_orepdbs::last(pwr_tStatus *sts) const wb_orep *wb_orepdbs::last(pwr_tStatus *sts)
{ {
return m_vrep->last(sts, (wb_orep*)this); return m_vrep->last(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdbs::next(pwr_tStatus *sts) const wb_orep *wb_orepdbs::next(pwr_tStatus *sts)
{ {
return m_vrep->next(sts, (wb_orep*)this); return m_vrep->next(sts, (wb_orep*)this);
} }
wb_orep *wb_orepdbs::previous(pwr_tStatus *sts) const wb_orep *wb_orepdbs::previous(pwr_tStatus *sts)
{ {
return m_vrep->previous(sts, (wb_orep*)this); return m_vrep->previous(sts, (wb_orep*)this);
} }
...@@ -197,17 +197,3 @@ wb_adrep *wb_orepdbs::attribute(pwr_tStatus *sts, const char *name) ...@@ -197,17 +197,3 @@ wb_adrep *wb_orepdbs::attribute(pwr_tStatus *sts, const char *name)
{ {
return 0;//m_vrep->attribute(sts, cid(), name); return 0;//m_vrep->attribute(sts, cid(), name);
} }
wb_position wb_orepdbs::position()
{
wb_position pos;
return pos;
}
wb_position wb_orepdbs::position(ldh_eDest dest)
{
wb_position pos;
return pos;
}
...@@ -44,20 +44,17 @@ public: ...@@ -44,20 +44,17 @@ public:
// Navigational operations // Navigational operations
virtual wb_orep *ancestor(pwr_tStatus *sts) const; //< get object at top of hierarchy virtual wb_orep *ancestor(pwr_tStatus *sts); //< get object at top of hierarchy
virtual wb_orep *parent(pwr_tStatus *sts) const; virtual wb_orep *parent(pwr_tStatus *sts);
virtual wb_orep *after(pwr_tStatus *sts) const; //< get next sibling virtual wb_orep *after(pwr_tStatus *sts); //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const; //< get previous sibling virtual wb_orep *before(pwr_tStatus *sts); //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const; //< get first child virtual wb_orep *first(pwr_tStatus *sts); //< get first child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const; //< get named child virtual wb_orep *child(pwr_tStatus *sts, wb_name &name); //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const; //< get last child virtual wb_orep *last(pwr_tStatus *sts); //< get last child
virtual wb_orep *next(pwr_tStatus *sts) const; //< get next in list of objects of same class in one volume virtual wb_orep *next(pwr_tStatus *sts); //< get next in list of objects of same class in one volume
virtual wb_orep *previous(pwr_tStatus *sts) const; //< get previous in list of objects of same class in one volume virtual wb_orep *previous(pwr_tStatus *sts); //< get previous in list of objects of same class in one volume
virtual wb_position position(); virtual wb_adrep *attribute(pwr_tStatus*, const char *name);
virtual wb_position position(ldh_eDest dest);
virtual wb_adrep *attribute(pwr_tStatus*, const char *aname);
virtual wb_adrep *attribute(pwr_tStatus*); virtual wb_adrep *attribute(pwr_tStatus*);
wb_erep *erep() const { return m_vrep->erep();} wb_erep *erep() const { return m_vrep->erep();}
......
...@@ -93,68 +93,52 @@ bool wb_orepwbl::isOffspringOf(const wb_orep *o) const ...@@ -93,68 +93,52 @@ bool wb_orepwbl::isOffspringOf(const wb_orep *o) const
return true; return true;
} }
wb_orep *wb_orepwbl::ancestor(pwr_tStatus *sts) const wb_orep *wb_orepwbl::ancestor(pwr_tStatus *sts)
{ {
return m_vrep->ancestor(sts, (wb_orep *)this); return m_vrep->ancestor(sts, (wb_orep *)this);
} }
wb_orep *wb_orepwbl::parent(pwr_tStatus *sts) const wb_orep *wb_orepwbl::parent(pwr_tStatus *sts)
{ {
return m_vrep->parent(sts, (wb_orep *)this); return m_vrep->parent(sts, (wb_orep *)this);
} }
wb_orep *wb_orepwbl::after(pwr_tStatus *sts) const wb_orep *wb_orepwbl::after(pwr_tStatus *sts)
{ {
return m_vrep->after(sts, (wb_orep *)this); return m_vrep->after(sts, (wb_orep *)this);
} }
wb_orep *wb_orepwbl::before(pwr_tStatus *sts) const wb_orep *wb_orepwbl::before(pwr_tStatus *sts)
{ {
return m_vrep->before(sts, (wb_orep *)this); return m_vrep->before(sts, (wb_orep *)this);
} }
wb_orep *wb_orepwbl::first(pwr_tStatus *sts) const wb_orep *wb_orepwbl::first(pwr_tStatus *sts)
{ {
return m_vrep->first(sts, (wb_orep *)this); return m_vrep->first(sts, (wb_orep *)this);
} }
wb_orep *wb_orepwbl::child(pwr_tStatus *sts, const char *name) const wb_orep *wb_orepwbl::child(pwr_tStatus *sts, wb_name &name)
{ {
return m_vrep->child(sts, (wb_orep *)this, name); return m_vrep->child(sts, (wb_orep *)this, name);
} }
wb_orep *wb_orepwbl::last(pwr_tStatus *sts) const wb_orep *wb_orepwbl::last(pwr_tStatus *sts)
{ {
return m_vrep->last(sts, (wb_orep *)this); return m_vrep->last(sts, (wb_orep *)this);
} }
wb_orep *wb_orepwbl::next(pwr_tStatus *sts) const wb_orep *wb_orepwbl::next(pwr_tStatus *sts)
{ {
return m_vrep->next(sts, (wb_orep *)this); return m_vrep->next(sts, (wb_orep *)this);
} }
wb_orep *wb_orepwbl::previous(pwr_tStatus *sts) const wb_orep *wb_orepwbl::previous(pwr_tStatus *sts)
{ {
return m_vrep->previous(sts, (wb_orep *)this); // return m_vrep->previous(sts, (wb_orep *)this);
} }
wb_position wb_orepwbl::position()
{
wb_position pos;
return pos;
}
wb_position wb_orepwbl::position(ldh_eDest dest)
{
wb_position pos;
return pos;
}
wb_adrep *wb_orepwbl::attribute(pwr_tStatus*, const char *aname) wb_adrep *wb_orepwbl::attribute(pwr_tStatus*, const char *aname)
{ {
return 0; return 0;
......
...@@ -40,20 +40,18 @@ public: ...@@ -40,20 +40,18 @@ public:
// Navigational operations // Navigational operations
wb_orep *ancestor(pwr_tStatus *sts) const; //< get object at top of hierarchy wb_orep *ancestor(pwr_tStatus *sts); //< get object at top of hierarchy
wb_orep *parent(pwr_tStatus *sts) const; wb_orep *parent(pwr_tStatus *sts);
wb_orep *after(pwr_tStatus *sts) const; //< get next sibling wb_orep *after(pwr_tStatus *sts); //< get next sibling
wb_orep *before(pwr_tStatus *sts) const; //< get previous sibling wb_orep *before(pwr_tStatus *sts); //< get previous sibling
wb_orep *first(pwr_tStatus *sts) const; //< get first child wb_orep *first(pwr_tStatus *sts); //< get first child
wb_orep *child(pwr_tStatus *sts, const char *name) const; //< get named child wb_orep *child(pwr_tStatus *sts, wb_name &name); //< get named child
wb_orep *last(pwr_tStatus *sts) const; //< get last child wb_orep *last(pwr_tStatus *sts); //< get last child
wb_orep *next(pwr_tStatus *sts) const; //< get next in list of objects of same class in one volume wb_orep *next(pwr_tStatus *sts); //< get next in list of objects of same class in one volume
wb_orep *previous(pwr_tStatus *sts) const; //< get previous in list of objects of same class in one volume wb_orep *previous(pwr_tStatus *sts); //< get previous in list of objects of same class in one volume
virtual wb_position position(); virtual wb_adrep *attribute(pwr_tStatus*, const char *name);
virtual wb_position position(ldh_eDest dest);
virtual wb_adrep *attribute(pwr_tStatus*, const char *aname);
virtual wb_adrep *attribute(pwr_tStatus*); virtual wb_adrep *attribute(pwr_tStatus*);
wb_wblnode *wblNode() { return m_wblnode;} wb_wblnode *wblNode() { return m_wblnode;}
......
...@@ -143,7 +143,9 @@ void wb_print_wbl::printClass(wb_volume& v, ...@@ -143,7 +143,9 @@ void wb_print_wbl::printClass(wb_volume& v,
return; return;
} }
templ = co.child("Template"); wb_name t("Template");
templ = co.child(t);
if (!templ) { if (!templ) {
m_errCnt++; m_errCnt++;
m_os << "! %WBDUMP-E-Error Template not found for class " << cdef.longName() << endl; m_os << "! %WBDUMP-E-Error Template not found for class " << cdef.longName() << endl;
...@@ -245,7 +247,9 @@ void wb_print_wbl::printObject(wb_volume& v, wb_object& o, bool recursive) ...@@ -245,7 +247,9 @@ void wb_print_wbl::printObject(wb_volume& v, wb_object& o, bool recursive)
m_os << endl; m_os << endl;
wb_object co = v.object(cdh_ClassIdToObjid(cdef.cid())); wb_object co = v.object(cdh_ClassIdToObjid(cdef.cid()));
templ = co.child("Template"); wb_name t("Template");
templ = co.child(t);
if (!templ) { if (!templ) {
m_errCnt++; m_errCnt++;
m_os << "Template not found for class " << cdef.name() << endl; m_os << "Template not found for class " << cdef.name() << endl;
......
...@@ -129,10 +129,10 @@ wb_object wb_volume::object(const char *name) const ...@@ -129,10 +129,10 @@ wb_object wb_volume::object(const char *name) const
wb_name n = wb_name( name); wb_name n = wb_name( name);
if ( !n.hasVolume() || n.volumeIsEqual( m_vrep->name())) if ( !n.hasVolume() || n.volumeIsEqual( m_vrep->name()))
// This volume // This volume
orep = m_vrep->object( &sts, name); orep = m_vrep->object( &sts, n);
else else
// Other volume // Other volume
orep = m_vrep->erep()->object(&sts, name); orep = m_vrep->erep()->object(&sts, n);
o = wb_object(sts, orep); o = wb_object(sts, orep);
......
...@@ -23,94 +23,103 @@ class wb_vrep : public wb_export ...@@ -23,94 +23,103 @@ class wb_vrep : public wb_export
{ {
protected: protected:
char m_name[80]; char m_name[80];
public: pwr_tVid m_vid;
pwr_tCid m_cid;
public:
virtual ~wb_vrep() {}; virtual ~wb_vrep() {};
wb_vrep() : m_vid(pwr_cNVid), m_cid(pwr_cNCid) {}
wb_vrep(pwr_tVid vid) : m_vid(vid), m_cid(pwr_cNCid) {}
wb_vrep(pwr_tVid vid, pwr_tCid cid) : m_vid(vid), m_cid(cid) {}
virtual void unref() = 0; virtual void unref() = 0;
virtual wb_vrep *ref() = 0; virtual wb_vrep *ref() = 0;
virtual wb_erep *erep() const = 0; virtual wb_erep *erep() = 0;
virtual wb_vrep *next() const = 0; virtual wb_vrep *next() = 0;
virtual pwr_tOid oid(pwr_tStatus *sts, wb_orep *o) const = 0; virtual pwr_tOid oid(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tVid vid(pwr_tStatus *sts, wb_orep *o) const = 0; virtual pwr_tVid vid(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tOix oix(pwr_tStatus *sts, wb_orep *o) const = 0; virtual pwr_tOix oix(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tCid cid(pwr_tStatus *sts, wb_orep *o) const = 0; virtual pwr_tCid cid(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tOid poid(pwr_tStatus *sts, wb_orep *o) const = 0; virtual pwr_tOid poid(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tOid foid(pwr_tStatus *sts, wb_orep *o) const = 0; virtual pwr_tOid foid(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tOid loid(pwr_tStatus *sts, wb_orep *o) const = 0; virtual pwr_tOid loid(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tOid boid(pwr_tStatus *sts, wb_orep *o) const = 0; virtual pwr_tOid boid(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tOid aoid(pwr_tStatus *sts, wb_orep *o) const = 0; virtual pwr_tOid aoid(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual const char * objectName(pwr_tStatus *sts, wb_orep *o) const = 0; virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual wb_name longName(pwr_tStatus *sts, wb_orep *o) = 0; virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tTime ohTime(pwr_tStatus *sts, wb_orep *o) const = 0; virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) const = 0; virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) = 0;
virtual wb_orep *object(pwr_tStatus *sts) = 0; virtual wb_orep *object(pwr_tStatus *sts) = 0;
virtual wb_orep *object(pwr_tStatus *sts, pwr_tOid oid) = 0; virtual wb_orep *object(pwr_tStatus *sts, pwr_tOid oid) = 0;
virtual wb_orep *object(pwr_tStatus *sts, wb_name name) = 0; virtual wb_orep *object(pwr_tStatus *sts, wb_name &name) = 0;
virtual wb_orep *object(pwr_tStatus *sts, wb_orep *parent, wb_name name) = 0; virtual wb_orep *object(pwr_tStatus *sts, const wb_orep *parent, wb_name &name) = 0;
virtual wb_orep *createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination d, wb_name name) = 0; virtual wb_orep *createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination &d, wb_name &name) = 0;
virtual wb_orep *copyObject(pwr_tStatus *sts, wb_orep *orep, wb_destination d, wb_name name) = 0; virtual wb_orep *copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destination &d, wb_name &name) = 0;
virtual bool copyOset(pwr_tStatus *sts, wb_oset *oset, wb_destination d) = 0; virtual bool copyOset(pwr_tStatus *sts, wb_oset *oset, wb_destination &d) = 0;
virtual bool moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination d) = 0; virtual bool moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d) = 0;
virtual bool deleteObject(pwr_tStatus *sts, wb_orep *orep) = 0; virtual bool deleteObject(pwr_tStatus *sts, wb_orep *orep) = 0;
virtual bool deleteFamily(pwr_tStatus *sts, wb_orep *orep) = 0; virtual bool deleteFamily(pwr_tStatus *sts, wb_orep *orep) = 0;
virtual bool deleteOset(pwr_tStatus *sts, wb_oset *oset) = 0; virtual bool deleteOset(pwr_tStatus *sts, wb_oset *oset) = 0;
virtual bool renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name name) = 0; virtual bool renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name) = 0;
virtual bool commit(pwr_tStatus *sts) = 0; virtual bool commit(pwr_tStatus *sts) = 0;
virtual bool abort(pwr_tStatus *sts) = 0; virtual bool abort(pwr_tStatus *sts) = 0;
virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsigned int offset, unsigned int size, void *p) = 0; virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p) = 0;
virtual void *readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsigned int offset, unsigned int size, void *p) = 0; virtual void *readAttribute(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p) = 0;
virtual void *readBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p) = 0; virtual void *readBody(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, void *p) = 0;
virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p) = 0; virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p) = 0;
virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o) = 0; virtual wb_orep *ancestor(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual wb_orep *parent(pwr_tStatus *sts, wb_orep *o) = 0; virtual wb_orep *parent(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual wb_orep *after(pwr_tStatus *sts, wb_orep *o) = 0; virtual wb_orep *after(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual wb_orep *before(pwr_tStatus *sts, wb_orep *o) = 0; virtual wb_orep *before(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual wb_orep *first(pwr_tStatus *sts, wb_orep *o) = 0; virtual wb_orep *first(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual wb_orep *child(pwr_tStatus *sts, wb_orep *o, wb_name name) = 0; virtual wb_orep *child(pwr_tStatus *sts, const wb_orep *o, wb_name &name) = 0;
virtual wb_orep *last(pwr_tStatus *sts, wb_orep *o) = 0; virtual wb_orep *last(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual wb_orep *next(pwr_tStatus *sts, wb_orep *o) = 0; virtual wb_orep *next(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual wb_orep *previous(pwr_tStatus *sts, wb_orep *o) = 0; virtual wb_orep *previous(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual wb_srep *newSession() = 0; virtual wb_srep *newSession() = 0;
virtual bool isLocal(wb_orep *o) const = 0; virtual bool isLocal(const wb_orep *o) = 0;
virtual pwr_tVid vid() const = 0; pwr_tVid vid() const { return m_vid;}
virtual pwr_tCid cid() const = 0; pwr_tCid cid() const { return m_cid;}
pwr_tVid vid(pwr_tVid vid) { m_vid = vid;}
pwr_tCid cid(pwr_tCid cid) { m_cid = cid;}
virtual void name( const char *n) { strcpy( m_name, n);} virtual void name( const char *n) { strcpy( m_name, n);}
virtual const char *name() { return m_name;} virtual const char *name() { return m_name;}
virtual wb_merep *merep() const = 0; virtual wb_merep *merep() const = 0;
virtual bool createSnapshot(const char *fileName) = 0; virtual bool createSnapshot(const char *fileName) = 0;
virtual void objectName(wb_orep *o, char *str) = 0; virtual void objectName(const wb_orep *o, char *str) = 0;
virtual bool isCommonMeta() const { return false;} virtual bool isCommonMeta() const { return false;}
virtual bool isMeta() const { return false;} virtual bool isMeta() const { return false;}
}; };
......
...@@ -20,7 +20,7 @@ wb_vrep *wb_vrepdb::ref() ...@@ -20,7 +20,7 @@ wb_vrep *wb_vrepdb::ref()
wb_vrepdb::wb_vrepdb(wb_erep *erep, const char *fileName) : wb_vrepdb::wb_vrepdb(wb_erep *erep, const char *fileName) :
m_erep(erep) m_erep(erep), m_ohead()
{ {
strcpy(m_fileName, fileName); strcpy(m_fileName, fileName);
...@@ -94,7 +94,7 @@ wb_orep* wb_vrepdb::object(pwr_tStatus *sts, pwr_tOid oid) ...@@ -94,7 +94,7 @@ wb_orep* wb_vrepdb::object(pwr_tStatus *sts, pwr_tOid oid)
} }
} }
wb_orep* wb_vrepdb::object(pwr_tStatus *sts, wb_orep *parent, wb_name name) wb_orep* wb_vrepdb::object(pwr_tStatus *sts, const wb_orep *parent, wb_name &name)
{ {
try { try {
wb_db_name n(m_db, m_txn, parent->oid(), name); wb_db_name n(m_db, m_txn, parent->oid(), name);
...@@ -108,7 +108,7 @@ wb_orep* wb_vrepdb::object(pwr_tStatus *sts, wb_orep *parent, wb_name name) ...@@ -108,7 +108,7 @@ wb_orep* wb_vrepdb::object(pwr_tStatus *sts, wb_orep *parent, wb_name name)
} }
} }
wb_orep* wb_vrepdb::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination d, wb_name name) wb_orep* wb_vrepdb::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination &d, wb_name &name)
{ {
wb_db_txn *txn = m_db->begin(0); wb_db_txn *txn = m_db->begin(0);
...@@ -179,7 +179,7 @@ bool wb_vrepdb::deleteObject(pwr_tStatus *sts, wb_orep *orp) ...@@ -179,7 +179,7 @@ bool wb_vrepdb::deleteObject(pwr_tStatus *sts, wb_orep *orp)
return true; return true;
} }
bool wb_vrepdb::moveObject(pwr_tStatus *sts, wb_orep *orp, wb_destination d) bool wb_vrepdb::moveObject(pwr_tStatus *sts, wb_orep *orp, wb_destination &d)
{ {
#if 0 #if 0
if (!isLocal(o)) if (!isLocal(o))
...@@ -208,7 +208,7 @@ bool wb_vrepdb::moveObject(pwr_tStatus *sts, wb_orep *orp, wb_destination d) ...@@ -208,7 +208,7 @@ bool wb_vrepdb::moveObject(pwr_tStatus *sts, wb_orep *orp, wb_destination d)
return true; return true;
} }
bool wb_vrepdb::renameObject(pwr_tStatus *sts, wb_orep *orp, wb_name name) bool wb_vrepdb::renameObject(pwr_tStatus *sts, wb_orep *orp, wb_name &name)
{ {
wb_db_txn *txn = m_db->begin(0); wb_db_txn *txn = m_db->begin(0);
...@@ -251,7 +251,7 @@ bool wb_vrepdb::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_ ...@@ -251,7 +251,7 @@ bool wb_vrepdb::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_
return true; return true;
} }
void *wb_vrepdb::readAttribute(pwr_tStatus *sts, wb_orep *orp, pwr_eBix bix, size_t offset, size_t size, void *p) void *wb_vrepdb::readAttribute(pwr_tStatus *sts, const wb_orep *orp, pwr_eBix bix, size_t offset, size_t size, void *p)
{ {
try { try {
m_ohead.get(m_txn, orp->oid()); m_ohead.get(m_txn, orp->oid());
...@@ -285,7 +285,7 @@ void *wb_vrepdb::readAttribute(pwr_tStatus *sts, wb_orep *orp, pwr_eBix bix, siz ...@@ -285,7 +285,7 @@ void *wb_vrepdb::readAttribute(pwr_tStatus *sts, wb_orep *orp, pwr_eBix bix, siz
} }
} }
void *wb_vrepdb::readBody(pwr_tStatus *sts, wb_orep *orp, pwr_eBix bix, void *p) void *wb_vrepdb::readBody(pwr_tStatus *sts, const wb_orep *orp, pwr_eBix bix, void *p)
{ {
try { try {
m_ohead.get(m_txn, orp->oid()); m_ohead.get(m_txn, orp->oid());
...@@ -322,12 +322,12 @@ bool wb_vrepdb::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p) ...@@ -322,12 +322,12 @@ bool wb_vrepdb::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p)
return true; return true;
} }
wb_orep *wb_vrepdb::ancestor(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepdb::ancestor(pwr_tStatus *sts, const wb_orep *o)
{ {
return 0; return 0;
} }
pwr_tCid wb_vrepdb::cid(pwr_tStatus *sts, const wb_orep * const orp) pwr_tCid wb_vrepdb::cid(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
return m_ohead.get(m_txn, orp->oid()).cid(); return m_ohead.get(m_txn, orp->oid()).cid();
...@@ -339,7 +339,57 @@ pwr_tCid wb_vrepdb::cid(pwr_tStatus *sts, const wb_orep * const orp) ...@@ -339,7 +339,57 @@ pwr_tCid wb_vrepdb::cid(pwr_tStatus *sts, const wb_orep * const orp)
} }
} }
pwr_tOid wb_vrepdb::poid(pwr_tStatus *sts, const wb_orep * const orp) pwr_tTime wb_vrepdb::ohTime(pwr_tStatus *sts, const wb_orep *orp)
{
try {
return m_ohead.get(m_txn, orp->oid()).ohTime();
}
catch (DbException &e) {
*sts = LDH__NOSUCHOBJ;
pwr_tTime t = {0, 0};
printf("vrepdb: %s\n", e.what());
return t;
}
}
pwr_tVid wb_vrepdb::vid(pwr_tStatus *sts, const wb_orep *orp)
{
try {
return m_ohead.get(m_txn, orp->oid()).vid();
}
catch (DbException &e) {
*sts = LDH__NOSUCHOBJ;
printf("vrepdb: %s\n", e.what());
return pwr_cNVid;
}
}
pwr_tOid wb_vrepdb::oid(pwr_tStatus *sts, const wb_orep *orp)
{
try {
return m_ohead.get(m_txn, orp->oid()).oid();
}
catch (DbException &e) {
*sts = LDH__NOSUCHOBJ;
printf("vrepdb: %s\n", e.what());
return pwr_cNOid;
}
}
pwr_tOix wb_vrepdb::oix(pwr_tStatus *sts, const wb_orep *orp)
{
try {
return m_ohead.get(m_txn, orp->oid()).oix();
}
catch (DbException &e) {
*sts = LDH__NOSUCHOBJ;
printf("vrepdb: %s\n", e.what());
return pwr_cNOix;
}
}
pwr_tOid wb_vrepdb::poid(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
return m_ohead.get(m_txn, orp->oid()).poid(); return m_ohead.get(m_txn, orp->oid()).poid();
...@@ -351,7 +401,7 @@ pwr_tOid wb_vrepdb::poid(pwr_tStatus *sts, const wb_orep * const orp) ...@@ -351,7 +401,7 @@ pwr_tOid wb_vrepdb::poid(pwr_tStatus *sts, const wb_orep * const orp)
} }
} }
pwr_tOid wb_vrepdb::foid(pwr_tStatus *sts, const wb_orep * const orp) pwr_tOid wb_vrepdb::foid(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
return m_ohead.get(m_txn, orp->oid()).foid(); return m_ohead.get(m_txn, orp->oid()).foid();
...@@ -363,7 +413,7 @@ pwr_tOid wb_vrepdb::foid(pwr_tStatus *sts, const wb_orep * const orp) ...@@ -363,7 +413,7 @@ pwr_tOid wb_vrepdb::foid(pwr_tStatus *sts, const wb_orep * const orp)
} }
} }
pwr_tOid wb_vrepdb::loid(pwr_tStatus *sts, const wb_orep * const orp) pwr_tOid wb_vrepdb::loid(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
return m_ohead.get(m_txn, orp->oid()).loid(); return m_ohead.get(m_txn, orp->oid()).loid();
...@@ -375,7 +425,7 @@ pwr_tOid wb_vrepdb::loid(pwr_tStatus *sts, const wb_orep * const orp) ...@@ -375,7 +425,7 @@ pwr_tOid wb_vrepdb::loid(pwr_tStatus *sts, const wb_orep * const orp)
} }
} }
pwr_tOid wb_vrepdb::aoid(pwr_tStatus *sts, const wb_orep * const orp) pwr_tOid wb_vrepdb::aoid(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
return m_ohead.get(m_txn, orp->oid()).aoid(); return m_ohead.get(m_txn, orp->oid()).aoid();
...@@ -387,7 +437,7 @@ pwr_tOid wb_vrepdb::aoid(pwr_tStatus *sts, const wb_orep * const orp) ...@@ -387,7 +437,7 @@ pwr_tOid wb_vrepdb::aoid(pwr_tStatus *sts, const wb_orep * const orp)
} }
} }
pwr_tOid wb_vrepdb::boid(pwr_tStatus *sts, const wb_orep * const orp) pwr_tOid wb_vrepdb::boid(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
return m_ohead.get(m_txn, orp->oid()).boid(); return m_ohead.get(m_txn, orp->oid()).boid();
...@@ -399,7 +449,7 @@ pwr_tOid wb_vrepdb::boid(pwr_tStatus *sts, const wb_orep * const orp) ...@@ -399,7 +449,7 @@ pwr_tOid wb_vrepdb::boid(pwr_tStatus *sts, const wb_orep * const orp)
} }
} }
wb_orep *wb_vrepdb::parent(pwr_tStatus *sts, wb_orep *orp) wb_orep *wb_vrepdb::parent(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
m_ohead.get(m_txn, m_ohead.get(m_txn, orp->oid()).poid()); m_ohead.get(m_txn, m_ohead.get(m_txn, orp->oid()).poid());
...@@ -412,7 +462,7 @@ wb_orep *wb_vrepdb::parent(pwr_tStatus *sts, wb_orep *orp) ...@@ -412,7 +462,7 @@ wb_orep *wb_vrepdb::parent(pwr_tStatus *sts, wb_orep *orp)
} }
} }
wb_orep *wb_vrepdb::after(pwr_tStatus *sts, wb_orep *orp) wb_orep *wb_vrepdb::after(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
m_ohead.get(m_txn, m_ohead.get(m_txn, orp->oid()).aoid()); m_ohead.get(m_txn, m_ohead.get(m_txn, orp->oid()).aoid());
...@@ -425,7 +475,7 @@ wb_orep *wb_vrepdb::after(pwr_tStatus *sts, wb_orep *orp) ...@@ -425,7 +475,7 @@ wb_orep *wb_vrepdb::after(pwr_tStatus *sts, wb_orep *orp)
} }
} }
wb_orep *wb_vrepdb::before(pwr_tStatus *sts, wb_orep *orp) wb_orep *wb_vrepdb::before(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
m_ohead.get(m_txn, m_ohead.get(m_txn, orp->oid()).boid()); m_ohead.get(m_txn, m_ohead.get(m_txn, orp->oid()).boid());
...@@ -438,7 +488,7 @@ wb_orep *wb_vrepdb::before(pwr_tStatus *sts, wb_orep *orp) ...@@ -438,7 +488,7 @@ wb_orep *wb_vrepdb::before(pwr_tStatus *sts, wb_orep *orp)
} }
} }
wb_orep *wb_vrepdb::first(pwr_tStatus *sts, wb_orep *orp) wb_orep *wb_vrepdb::first(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
m_ohead.get(m_txn, m_ohead.get(m_txn, orp->oid()).foid()); m_ohead.get(m_txn, m_ohead.get(m_txn, orp->oid()).foid());
...@@ -451,7 +501,7 @@ wb_orep *wb_vrepdb::first(pwr_tStatus *sts, wb_orep *orp) ...@@ -451,7 +501,7 @@ wb_orep *wb_vrepdb::first(pwr_tStatus *sts, wb_orep *orp)
} }
} }
wb_orep *wb_vrepdb::child(pwr_tStatus *sts, wb_orep *orp, const char *name) wb_orep *wb_vrepdb::child(pwr_tStatus *sts, const wb_orep *orp, wb_name &name)
{ {
try { try {
wb_db_name n(m_db, m_txn, orp->oid(), name); wb_db_name n(m_db, m_txn, orp->oid(), name);
...@@ -465,7 +515,7 @@ wb_orep *wb_vrepdb::child(pwr_tStatus *sts, wb_orep *orp, const char *name) ...@@ -465,7 +515,7 @@ wb_orep *wb_vrepdb::child(pwr_tStatus *sts, wb_orep *orp, const char *name)
} }
} }
wb_orep *wb_vrepdb::last(pwr_tStatus *sts, wb_orep *orp) wb_orep *wb_vrepdb::last(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
m_ohead.get(m_txn, m_ohead.get(m_txn, orp->oid()).loid()); m_ohead.get(m_txn, m_ohead.get(m_txn, orp->oid()).loid());
...@@ -478,11 +528,11 @@ wb_orep *wb_vrepdb::last(pwr_tStatus *sts, wb_orep *orp) ...@@ -478,11 +528,11 @@ wb_orep *wb_vrepdb::last(pwr_tStatus *sts, wb_orep *orp)
} }
} }
wb_orep *wb_vrepdb::next(pwr_tStatus *sts, wb_orep *orp) wb_orep *wb_vrepdb::next(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
m_ohead.get(m_txn, orp->oid()); m_ohead.get(m_txn, orp->oid());
wb_db_class c(m_db, m_ohead.cid()); wb_db_class c(m_db, m_txn, m_ohead.cid());
if (c.succ(m_ohead.oid())) { if (c.succ(m_ohead.oid())) {
m_ohead.get(m_txn, c.oid()); m_ohead.get(m_txn, c.oid());
return new (this) wb_orepdb(&m_ohead.m_o); return new (this) wb_orepdb(&m_ohead.m_o);
...@@ -498,7 +548,7 @@ wb_orep *wb_vrepdb::next(pwr_tStatus *sts, wb_orep *orp) ...@@ -498,7 +548,7 @@ wb_orep *wb_vrepdb::next(pwr_tStatus *sts, wb_orep *orp)
} }
} }
wb_orep *wb_vrepdb::previous(pwr_tStatus *sts, wb_orep *orp) wb_orep *wb_vrepdb::previous(pwr_tStatus *sts, const wb_orep *orp)
{ {
try { try {
m_ohead.get(m_txn, orp->oid()); m_ohead.get(m_txn, orp->oid());
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
class wb_vrepdb : public wb_vrep class wb_vrepdb : public wb_vrep
{ {
protected: protected:
pwr_tVid m_vid;
map<int, wb_srep*> m_srep; map<int, wb_srep*> m_srep;
//wb_session m_wsession; //wb_session m_wsession;
...@@ -26,84 +25,88 @@ public: ...@@ -26,84 +25,88 @@ public:
wb_db_ohead m_ohead; wb_db_ohead m_ohead;
wb_vrepdb(wb_erep *erep, const char *fileName); wb_vrepdb(wb_erep *erep, const char *fileName);
~wb_vrepdb();
virtual void unref(); virtual void unref();
virtual wb_vrep *ref(); virtual wb_vrep *ref();
virtual wb_erep *erep(); virtual wb_erep *erep();
virtual wb_merep *merep() const;
pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep * const o); virtual wb_vrep *next();
pwr_tOid oid(pwr_tStatus *sts, const wb_orep * const o);
pwr_tVid vid(pwr_tStatus *sts, const wb_orep * const o); virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o);
pwr_tOix oix(pwr_tStatus *sts, const wb_orep * const o); virtual pwr_tOid oid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tVid vid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOix oix(pwr_tStatus *sts, const wb_orep *o);
pwr_tCid cid(pwr_tStatus *sts, const wb_orep * const o); virtual pwr_tCid cid(pwr_tStatus *sts, const wb_orep *o);
pwr_tOid poid(pwr_tStatus *sts, const wb_orep * const o); virtual pwr_tOid poid(pwr_tStatus *sts, const wb_orep *o);
pwr_tOid foid(pwr_tStatus *sts, const wb_orep * const o); virtual pwr_tOid foid(pwr_tStatus *sts, const wb_orep *o);
pwr_tOid loid(pwr_tStatus *sts, const wb_orep * const o); virtual pwr_tOid loid(pwr_tStatus *sts, const wb_orep *o);
pwr_tOid boid(pwr_tStatus *sts, const wb_orep * const o); virtual pwr_tOid boid(pwr_tStatus *sts, const wb_orep *o);
pwr_tOid aoid(pwr_tStatus *sts, const wb_orep * const o); virtual pwr_tOid aoid(pwr_tStatus *sts, const wb_orep *o);
virtual const char * objectName(pwr_tStatus *sts, wb_orep *o) const; virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o);
virtual wb_name longName(pwr_tStatus *sts, wb_orep *o); virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime ohTime(pwr_tStatus *sts, wb_orep *o) const;
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) const; virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent);
virtual wb_orep *object(pwr_tStatus *sts); virtual wb_orep *object(pwr_tStatus *sts);
virtual wb_orep *object(pwr_tStatus *sts, pwr_tOid oid); virtual wb_orep *object(pwr_tStatus *sts, pwr_tOid oid);
virtual wb_orep *object(pwr_tStatus *sts, const char *name); virtual wb_orep *object(pwr_tStatus *sts, wb_name &name);
virtual wb_orep *object(pwr_tStatus *sts, wb_orep *parent, wb_name name); virtual wb_orep *object(pwr_tStatus *sts, const wb_orep *parent, wb_name &name);
virtual wb_orep *createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination d, wb_name name); virtual wb_orep *createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination &d, wb_name &name);
virtual wb_orep *copyObject(pwr_tStatus *sts, wb_orep *orep, wb_destination d, wb_name name); virtual wb_orep *copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destination &d, wb_name &name);
virtual bool copyOset(pwr_tStatus *sts, wb_oset *oset, wb_destination d); virtual bool copyOset(pwr_tStatus *sts, wb_oset *oset, wb_destination &d);
virtual bool moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination d); virtual bool moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d);
virtual bool deleteObject(pwr_tStatus *sts, wb_orep *orep); virtual bool deleteObject(pwr_tStatus *sts, wb_orep *orep);
virtual bool deleteFamily(pwr_tStatus *sts, wb_orep *orep); virtual bool deleteFamily(pwr_tStatus *sts, wb_orep *orep);
virtual bool deleteOset(pwr_tStatus *sts, wb_oset *oset); virtual bool deleteOset(pwr_tStatus *sts, wb_oset *oset);
virtual bool renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name name); virtual bool renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name);
virtual bool commit(pwr_tStatus *sts); virtual bool commit(pwr_tStatus *sts);
virtual bool abort(pwr_tStatus *sts); virtual bool abort(pwr_tStatus *sts);
virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsigned int offset, unsigned int size, void *p); virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p);
virtual void *readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsigned int offset, unsigned int size, void *p); virtual void *readAttribute(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p);
virtual void *readBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p); virtual void *readBody(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, void *p);
virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p); virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p);
virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *ancestor(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *parent(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *parent(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *after(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *after(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *before(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *before(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *first(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *first(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *child(pwr_tStatus *sts, wb_orep *o, const char *name); virtual wb_orep *child(pwr_tStatus *sts, const wb_orep *o, wb_name &name);
virtual wb_orep *last(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *last(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *next(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *next(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *previous(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *previous(pwr_tStatus *sts, const wb_orep *o);
virtual wb_srep *newSession(); virtual wb_srep *newSession();
virtual bool isLocal(wb_orep *o) const; virtual bool isLocal(const wb_orep *o);
virtual pwr_tVid vid() const;
virtual void objectName(wb_orep *o, const char *str); virtual bool createSnapshot(const char *fileName);
virtual void objectName(const wb_orep *o, char *str);
void load(); void load();
......
...@@ -70,7 +70,7 @@ wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, pwr_tOid oid) ...@@ -70,7 +70,7 @@ wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, pwr_tOid oid)
return new (this) wb_orepdbs(op); return new (this) wb_orepdbs(op);
} }
wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, wb_name name) wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, wb_name &name)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -88,7 +88,7 @@ wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, wb_name name) ...@@ -88,7 +88,7 @@ wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, wb_name name)
return new (this) wb_orepdbs(op); return new (this) wb_orepdbs(op);
} }
wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, wb_orep *parent, wb_name name) wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, const wb_orep *parent, wb_name &name)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -102,27 +102,27 @@ wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, wb_orep *parent, wb_name name) ...@@ -102,27 +102,27 @@ wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, wb_orep *parent, wb_name name)
} }
wb_orep *wb_vrepdbs::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination d, wb_name name) wb_orep *wb_vrepdbs::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination &d, wb_name &name)
{ {
*sts = LDH__NYI; *sts = LDH__NYI;
return 0; return 0;
} }
wb_orep *wb_vrepdbs::copyObject(pwr_tStatus *sts, wb_orep *orep, wb_destination d, wb_name name) wb_orep *wb_vrepdbs::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destination &d, wb_name &name)
{ {
*sts = LDH__NYI; *sts = LDH__NYI;
return 0; return 0;
} }
bool wb_vrepdbs::copyOset(pwr_tStatus *sts, wb_oset *oset, wb_destination d) bool wb_vrepdbs::copyOset(pwr_tStatus *sts, wb_oset *oset, wb_destination &d)
{ {
*sts = LDH__NYI; *sts = LDH__NYI;
return false; return false;
} }
bool wb_vrepdbs::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination d) bool wb_vrepdbs::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
{ {
*sts = LDH__NYI; *sts = LDH__NYI;
return false; return false;
...@@ -147,7 +147,7 @@ bool wb_vrepdbs::deleteOset(pwr_tStatus *sts, wb_oset *oset) ...@@ -147,7 +147,7 @@ bool wb_vrepdbs::deleteOset(pwr_tStatus *sts, wb_oset *oset)
return false; return false;
} }
bool wb_vrepdbs::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name name) bool wb_vrepdbs::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name)
{ {
*sts = LDH__NYI; *sts = LDH__NYI;
return false; return false;
...@@ -165,13 +165,13 @@ bool wb_vrepdbs::abort(pwr_tStatus *sts) ...@@ -165,13 +165,13 @@ bool wb_vrepdbs::abort(pwr_tStatus *sts)
return true; return true;
} }
bool wb_vrepdbs::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsigned int offset, unsigned int size, void *p) bool wb_vrepdbs::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p)
{ {
*sts = LDH__NYI; *sts = LDH__NYI;
return false; return false;
} }
void *wb_vrepdbs::readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsigned int offset, unsigned int size, void *p) void *wb_vrepdbs::readAttribute(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p)
{// note! must be compensated for offset ! {// note! must be compensated for offset !
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -201,7 +201,7 @@ void *wb_vrepdbs::readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsi ...@@ -201,7 +201,7 @@ void *wb_vrepdbs::readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsi
return (void *)((char *)bp + offset); return (void *)((char *)bp + offset);
} }
void *wb_vrepdbs::readBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p) void *wb_vrepdbs::readBody(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, void *p)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -237,7 +237,7 @@ bool wb_vrepdbs::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p) ...@@ -237,7 +237,7 @@ bool wb_vrepdbs::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p)
return false; return false;
} }
wb_orep *wb_vrepdbs::ancestor(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepdbs::ancestor(pwr_tStatus *sts, const wb_orep *o)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -250,7 +250,7 @@ wb_orep *wb_vrepdbs::ancestor(pwr_tStatus *sts, wb_orep *o) ...@@ -250,7 +250,7 @@ wb_orep *wb_vrepdbs::ancestor(pwr_tStatus *sts, wb_orep *o)
return new (this) wb_orepdbs(op); return new (this) wb_orepdbs(op);
} }
wb_orep *wb_vrepdbs::parent(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepdbs::parent(pwr_tStatus *sts, const wb_orep *o)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -263,7 +263,7 @@ wb_orep *wb_vrepdbs::parent(pwr_tStatus *sts, wb_orep *o) ...@@ -263,7 +263,7 @@ wb_orep *wb_vrepdbs::parent(pwr_tStatus *sts, wb_orep *o)
return new (this) wb_orepdbs(op); return new (this) wb_orepdbs(op);
} }
wb_orep *wb_vrepdbs::after(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepdbs::after(pwr_tStatus *sts, const wb_orep *o)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -276,7 +276,7 @@ wb_orep *wb_vrepdbs::after(pwr_tStatus *sts, wb_orep *o) ...@@ -276,7 +276,7 @@ wb_orep *wb_vrepdbs::after(pwr_tStatus *sts, wb_orep *o)
return new (this) wb_orepdbs(op); return new (this) wb_orepdbs(op);
} }
wb_orep *wb_vrepdbs::before(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepdbs::before(pwr_tStatus *sts, const wb_orep *o)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -289,7 +289,7 @@ wb_orep *wb_vrepdbs::before(pwr_tStatus *sts, wb_orep *o) ...@@ -289,7 +289,7 @@ wb_orep *wb_vrepdbs::before(pwr_tStatus *sts, wb_orep *o)
return new (this) wb_orepdbs(op); return new (this) wb_orepdbs(op);
} }
wb_orep *wb_vrepdbs::first(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepdbs::first(pwr_tStatus *sts, const wb_orep *o)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -302,7 +302,7 @@ wb_orep *wb_vrepdbs::first(pwr_tStatus *sts, wb_orep *o) ...@@ -302,7 +302,7 @@ wb_orep *wb_vrepdbs::first(pwr_tStatus *sts, wb_orep *o)
return new (this) wb_orepdbs(op); return new (this) wb_orepdbs(op);
} }
wb_orep *wb_vrepdbs::child(pwr_tStatus *sts, wb_orep *o, wb_name name) wb_orep *wb_vrepdbs::child(pwr_tStatus *sts, const wb_orep *o, wb_name &name)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -315,7 +315,7 @@ wb_orep *wb_vrepdbs::child(pwr_tStatus *sts, wb_orep *o, wb_name name) ...@@ -315,7 +315,7 @@ wb_orep *wb_vrepdbs::child(pwr_tStatus *sts, wb_orep *o, wb_name name)
return new (this) wb_orepdbs(op); return new (this) wb_orepdbs(op);
} }
wb_orep *wb_vrepdbs::last(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepdbs::last(pwr_tStatus *sts, const wb_orep *o)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -329,7 +329,7 @@ wb_orep *wb_vrepdbs::last(pwr_tStatus *sts, wb_orep *o) ...@@ -329,7 +329,7 @@ wb_orep *wb_vrepdbs::last(pwr_tStatus *sts, wb_orep *o)
} }
wb_orep *wb_vrepdbs::next(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepdbs::next(pwr_tStatus *sts, const wb_orep *o)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -342,7 +342,7 @@ wb_orep *wb_vrepdbs::next(pwr_tStatus *sts, wb_orep *o) ...@@ -342,7 +342,7 @@ wb_orep *wb_vrepdbs::next(pwr_tStatus *sts, wb_orep *o)
return new (this) wb_orepdbs(op); return new (this) wb_orepdbs(op);
} }
wb_orep *wb_vrepdbs::previous(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepdbs::previous(pwr_tStatus *sts, const wb_orep *o)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -375,7 +375,7 @@ wb_orep *wb_vrepdbs::object(pwr_tStatus *sts) ...@@ -375,7 +375,7 @@ wb_orep *wb_vrepdbs::object(pwr_tStatus *sts)
return new (this) wb_orepdbs(op); return new (this) wb_orepdbs(op);
} }
bool wb_vrepdbs::isLocal(wb_orep *) const bool wb_vrepdbs::isLocal(const wb_orep *)
{ {
//*sts = LDH__NYI; //*sts = LDH__NYI;
return false; return false;
...@@ -391,12 +391,12 @@ pwr_tVid wb_vrepdbs::vid() const ...@@ -391,12 +391,12 @@ pwr_tVid wb_vrepdbs::vid() const
return m_vid; return m_vid;
} }
wb_erep *wb_vrepdbs::erep() const wb_erep *wb_vrepdbs::erep()
{ {
return m_erep; return m_erep;
} }
wb_vrep *wb_vrepdbs::next () const wb_vrep *wb_vrepdbs::next ()
{ {
pwr_tStatus sts; pwr_tStatus sts;
...@@ -425,7 +425,7 @@ void wb_vrepdbs::delete_wb_orepdbs(void *p) ...@@ -425,7 +425,7 @@ void wb_vrepdbs::delete_wb_orepdbs(void *p)
free(p); free(p);
} }
void wb_vrepdbs::objectName(wb_orep *o, char *str) void wb_vrepdbs::objectName(const wb_orep *o, char *str)
{ {
pwr_tStatus sts; pwr_tStatus sts;
......
...@@ -10,7 +10,6 @@ class wb_merep; ...@@ -10,7 +10,6 @@ class wb_merep;
class wb_vrepdbs : public wb_vrep class wb_vrepdbs : public wb_vrep
{ {
public: public:
pwr_tVid m_vid;
map<int, wb_srep*> m_srep; map<int, wb_srep*> m_srep;
//wb_session m_wsession; //wb_session m_wsession;
...@@ -28,85 +27,85 @@ public: ...@@ -28,85 +27,85 @@ public:
dbs_sEnv *dbsenv(); dbs_sEnv *dbsenv();
bool load(); bool load();
void objectName(wb_orep *o, char *str); void objectName(const wb_orep *o, char *str);
virtual void unref(); virtual void unref();
virtual wb_vrep *ref(); virtual wb_vrep *ref();
virtual wb_erep *erep() const; virtual wb_erep *erep() ;
virtual pwr_tOid oid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid oid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tVid vid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNVid;} virtual pwr_tVid vid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNVid;}
virtual pwr_tOix oix(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOix;} virtual pwr_tOix oix(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOix;}
virtual pwr_tCid cid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNCid;} virtual pwr_tCid cid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNCid;}
virtual pwr_tOid poid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid poid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid foid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid foid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid loid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid loid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid boid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid boid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid aoid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid aoid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual const char * objectName(pwr_tStatus *sts, wb_orep *o) const { return "";} virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o) { return "";}
virtual wb_name longName(pwr_tStatus *sts, wb_orep *o) { return wb_name();} virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();}
virtual pwr_tTime ohTime(pwr_tStatus *sts, wb_orep *o) const { pwr_tTime t = {0, 0}; return t;} virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { pwr_tTime t = {0, 0}; return t;}
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) const { return false;} virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;}
virtual wb_orep *object(pwr_tStatus *sts, pwr_tOid oid); virtual wb_orep *object(pwr_tStatus *sts, pwr_tOid oid);
virtual wb_orep *object(pwr_tStatus *sts, wb_name name); virtual wb_orep *object(pwr_tStatus *sts, wb_name &name);
virtual wb_orep *object(pwr_tStatus *sts, wb_orep *parent, wb_name name); virtual wb_orep *object(pwr_tStatus *sts, const wb_orep *parent, wb_name &name);
virtual wb_orep *createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination d, wb_name name); virtual wb_orep *createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination &d, wb_name &name);
virtual wb_orep *copyObject(pwr_tStatus *sts, wb_orep *orep, wb_destination d, wb_name name); virtual wb_orep *copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destination &d, wb_name &name);
virtual bool copyOset(pwr_tStatus *sts, wb_oset *oset, wb_destination d); virtual bool copyOset(pwr_tStatus *sts, wb_oset *oset, wb_destination &d);
virtual bool moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination d); virtual bool moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d);
virtual bool deleteObject(pwr_tStatus *sts, wb_orep *orep); virtual bool deleteObject(pwr_tStatus *sts, wb_orep *orep);
virtual bool deleteFamily(pwr_tStatus *sts, wb_orep *orep); virtual bool deleteFamily(pwr_tStatus *sts, wb_orep *orep);
virtual bool deleteOset(pwr_tStatus *sts, wb_oset *oset); virtual bool deleteOset(pwr_tStatus *sts, wb_oset *oset);
virtual bool renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name name); virtual bool renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name);
virtual bool commit(pwr_tStatus *sts); virtual bool commit(pwr_tStatus *sts);
virtual bool abort(pwr_tStatus *sts); virtual bool abort(pwr_tStatus *sts);
virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsigned int offset, unsigned int size, void *p); virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p);
virtual void *readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsigned int offset, unsigned int size, void *p); virtual void *readAttribute(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p);
virtual void *readBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p); virtual void *readBody(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, void *p);
virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p); virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p);
virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *ancestor(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *parent(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *parent(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *after(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *after(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *before(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *before(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *first(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *first(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *child(pwr_tStatus *sts, wb_orep *o, wb_name name); virtual wb_orep *child(pwr_tStatus *sts, const wb_orep *o, wb_name &name);
virtual wb_orep *last(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *last(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *next(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *next(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *previous(pwr_tStatus *sts, wb_orep *o); virtual wb_orep *previous(pwr_tStatus *sts, const wb_orep *o);
virtual wb_srep *newSession(); virtual wb_srep *newSession();
...@@ -117,9 +116,9 @@ public: ...@@ -117,9 +116,9 @@ public:
virtual wb_vrep *next () const; virtual wb_vrep *next ();
virtual wb_orep *object (pwr_tStatus *); virtual wb_orep *object (pwr_tStatus *);
virtual bool isLocal (wb_orep *) const; virtual bool isLocal (const wb_orep *);
virtual pwr_tCid cid () const; virtual pwr_tCid cid () const;
virtual wb_merep *merep () const; virtual wb_merep *merep () const;
virtual bool createSnapshot (const char *); virtual bool createSnapshot (const char *);
......
...@@ -47,7 +47,7 @@ wb_orep *wb_vrepwbl::object(pwr_tStatus *sts, pwr_tOid oid) ...@@ -47,7 +47,7 @@ wb_orep *wb_vrepwbl::object(pwr_tStatus *sts, pwr_tOid oid)
return new wb_orepwbl( this, n); return new wb_orepwbl( this, n);
} }
wb_orep *wb_vrepwbl::object(pwr_tStatus *sts, wb_name name) wb_orep *wb_vrepwbl::object(pwr_tStatus *sts, wb_name &name)
{ {
ref_wblnode n = find( name.name()); ref_wblnode n = find( name.name());
if ( !n) { if ( !n) {
...@@ -58,7 +58,7 @@ wb_orep *wb_vrepwbl::object(pwr_tStatus *sts, wb_name name) ...@@ -58,7 +58,7 @@ wb_orep *wb_vrepwbl::object(pwr_tStatus *sts, wb_name name)
return new wb_orepwbl( this, n); return new wb_orepwbl( this, n);
} }
wb_vrep *wb_vrepwbl::next() const wb_vrep *wb_vrepwbl::next()
{ {
pwr_tStatus sts; pwr_tStatus sts;
...@@ -858,7 +858,9 @@ int wb_vrepwbl::nameToOid( const char *name, pwr_tOid *oid) ...@@ -858,7 +858,9 @@ int wb_vrepwbl::nameToOid( const char *name, pwr_tOid *oid)
// Search in other volume // Search in other volume
pwr_tStatus sts; pwr_tStatus sts;
wb_orep *orep = m_erep->object( &sts, name); wb_name na(name);
wb_orep *orep = m_erep->object( &sts, na);
if ( EVEN(sts)) if ( EVEN(sts))
return 0; return 0;
else { else {
...@@ -1199,7 +1201,7 @@ wb_orep *wb_vrepwbl::object(pwr_tStatus *sts) ...@@ -1199,7 +1201,7 @@ wb_orep *wb_vrepwbl::object(pwr_tStatus *sts)
return orep; return orep;
} }
wb_orep *wb_vrepwbl::ancestor(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepwbl::ancestor(pwr_tStatus *sts, const wb_orep *o)
{ {
wb_orepwbl *orep = 0; wb_orepwbl *orep = 0;
...@@ -1213,7 +1215,7 @@ wb_orep *wb_vrepwbl::ancestor(pwr_tStatus *sts, wb_orep *o) ...@@ -1213,7 +1215,7 @@ wb_orep *wb_vrepwbl::ancestor(pwr_tStatus *sts, wb_orep *o)
return orep; return orep;
} }
wb_orep *wb_vrepwbl::parent(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepwbl::parent(pwr_tStatus *sts, const wb_orep *o)
{ {
wb_orepwbl *orep = 0; wb_orepwbl *orep = 0;
...@@ -1227,7 +1229,7 @@ wb_orep *wb_vrepwbl::parent(pwr_tStatus *sts, wb_orep *o) ...@@ -1227,7 +1229,7 @@ wb_orep *wb_vrepwbl::parent(pwr_tStatus *sts, wb_orep *o)
return orep; return orep;
} }
wb_orep *wb_vrepwbl::after(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepwbl::after(pwr_tStatus *sts, const wb_orep *o)
{ {
wb_orepwbl *orep = 0; wb_orepwbl *orep = 0;
...@@ -1240,7 +1242,7 @@ wb_orep *wb_vrepwbl::after(pwr_tStatus *sts, wb_orep *o) ...@@ -1240,7 +1242,7 @@ wb_orep *wb_vrepwbl::after(pwr_tStatus *sts, wb_orep *o)
return orep; return orep;
} }
wb_orep *wb_vrepwbl::before(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepwbl::before(pwr_tStatus *sts, const wb_orep *o)
{ {
wb_orepwbl *orep = 0; wb_orepwbl *orep = 0;
...@@ -1254,7 +1256,7 @@ wb_orep *wb_vrepwbl::before(pwr_tStatus *sts, wb_orep *o) ...@@ -1254,7 +1256,7 @@ wb_orep *wb_vrepwbl::before(pwr_tStatus *sts, wb_orep *o)
return orep; return orep;
} }
wb_orep *wb_vrepwbl::first(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepwbl::first(pwr_tStatus *sts, const wb_orep *o)
{ {
wb_orepwbl *orep = 0; wb_orepwbl *orep = 0;
...@@ -1268,12 +1270,12 @@ wb_orep *wb_vrepwbl::first(pwr_tStatus *sts, wb_orep *o) ...@@ -1268,12 +1270,12 @@ wb_orep *wb_vrepwbl::first(pwr_tStatus *sts, wb_orep *o)
return orep; return orep;
} }
wb_orep *wb_vrepwbl::child(pwr_tStatus *sts, wb_orep *o, wb_name name) wb_orep *wb_vrepwbl::child(pwr_tStatus *sts, const wb_orep *o, wb_name &name)
{ {
return 0; return 0;
} }
wb_orep *wb_vrepwbl::last(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepwbl::last(pwr_tStatus *sts, const wb_orep *o)
{ {
wb_orepwbl *orep = 0; wb_orepwbl *orep = 0;
...@@ -1289,17 +1291,17 @@ wb_orep *wb_vrepwbl::last(pwr_tStatus *sts, wb_orep *o) ...@@ -1289,17 +1291,17 @@ wb_orep *wb_vrepwbl::last(pwr_tStatus *sts, wb_orep *o)
return orep; return orep;
} }
wb_orep *wb_vrepwbl::next(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepwbl::next(pwr_tStatus *sts, const wb_orep *o)
{ {
return 0; return 0;
} }
wb_orep *wb_vrepwbl::previous(pwr_tStatus *sts, wb_orep *o) wb_orep *wb_vrepwbl::previous(pwr_tStatus *sts, const wb_orep *o)
{ {
return 0; return 0;
} }
void wb_vrepwbl::objectName(wb_orep *o, char *str) void wb_vrepwbl::objectName(const wb_orep *o, char *str)
{ {
*str = 0; *str = 0;
...@@ -1329,8 +1331,7 @@ void wb_vrepwbl::objectName(wb_orep *o, char *str) ...@@ -1329,8 +1331,7 @@ void wb_vrepwbl::objectName(wb_orep *o, char *str)
free( vect); free( vect);
} }
void *wb_vrepwbl::readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *wb_vrepwbl::readAttribute(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p)
unsigned int offset, unsigned int size, void *p)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
...@@ -1363,7 +1364,7 @@ void *wb_vrepwbl::readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, ...@@ -1363,7 +1364,7 @@ void *wb_vrepwbl::readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix,
} }
} }
void *wb_vrepwbl::readBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p) void *wb_vrepwbl::readBody(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, void *p)
{ {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
......
...@@ -18,8 +18,6 @@ class wb_orepwbl; ...@@ -18,8 +18,6 @@ class wb_orepwbl;
class wb_vrepwbl : public wb_vrep class wb_vrepwbl : public wb_vrep
{ {
pwr_tVid m_vid;
pwr_tCid m_cid;
map<int, wb_srep*> m_srep; map<int, wb_srep*> m_srep;
//wb_session m_wsession; //wb_session m_wsession;
...@@ -45,13 +43,13 @@ public: ...@@ -45,13 +43,13 @@ public:
m_erep(erep), m_merep(erep->merep()), root_object(0), error_cnt(0), file_cnt(0), next_oix(0), volume_node(0) {} m_erep(erep), m_merep(erep->merep()), root_object(0), error_cnt(0), file_cnt(0), next_oix(0), volume_node(0) {}
wb_vrepwbl( wb_erep *erep, pwr_tVid vid) : wb_vrepwbl( wb_erep *erep, pwr_tVid vid) :
m_vid(vid), m_erep(erep), m_merep(erep->merep()), root_object(0),error_cnt(0), file_cnt(0), next_oix(0), volume_node(0) {} wb_vrep(vid), m_erep(erep), m_merep(erep->merep()), root_object(0),error_cnt(0), file_cnt(0), next_oix(0), volume_node(0) {}
~wb_vrepwbl(); ~wb_vrepwbl();
pwr_tVid vid() const { return m_vid;} pwr_tVid vid() const { return m_vid;}
pwr_tCid cid() const { return m_cid;} pwr_tCid cid() const { return m_cid;}
wb_vrep *next() const; wb_vrep *next();
virtual bool createSnapshot(const char *fileName); virtual bool createSnapshot(const char *fileName);
...@@ -101,51 +99,51 @@ public: ...@@ -101,51 +99,51 @@ public:
virtual void unref(); virtual void unref();
virtual wb_vrep *ref(); virtual wb_vrep *ref();
wb_erep *erep() const {return m_erep;} wb_erep *erep() {return m_erep;}
wb_merep *merep() const { return m_merep;} wb_merep *merep() const { return m_merep;}
virtual pwr_tOid oid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid oid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tVid vid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNVid;} virtual pwr_tVid vid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNVid;}
virtual pwr_tOix oix(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOix;} virtual pwr_tOix oix(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOix;}
virtual pwr_tCid cid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNCid;} virtual pwr_tCid cid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNCid;}
virtual pwr_tOid poid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid poid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid foid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid foid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid loid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid loid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid boid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid boid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual pwr_tOid aoid(pwr_tStatus *sts, wb_orep *o) const { return pwr_cNOid;} virtual pwr_tOid aoid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual const char * objectName(pwr_tStatus *sts, wb_orep *o) const { return "";} virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o) { return "";}
virtual wb_name longName(pwr_tStatus *sts, wb_orep *o) { return wb_name();} virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();}
virtual pwr_tTime ohTime(pwr_tStatus *sts, wb_orep *o) const { pwr_tTime t = {0, 0}; return t;} virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { pwr_tTime t = {0, 0}; return t;}
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) const { return false;} virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;}
wb_orep *object(pwr_tStatus *sts); wb_orep *object(pwr_tStatus *sts);
wb_orep *object(pwr_tStatus *sts, pwr_tOid oid); wb_orep *object(pwr_tStatus *sts, pwr_tOid oid);
wb_orep *object(pwr_tStatus *sts, wb_name name); wb_orep *object(pwr_tStatus *sts, wb_name &name);
wb_orep *object(pwr_tStatus *sts, wb_orep *parent, wb_name name) {return 0;} wb_orep *object(pwr_tStatus *sts, const wb_orep *parent, wb_name &name) {return 0;}
wb_orep *createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination d, wb_name name) {return 0;} wb_orep *createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination &d, wb_name &name) {return 0;}
wb_orep *copyObject(pwr_tStatus *sts, wb_orep *orep, wb_destination d, wb_name name) {return 0;} wb_orep *copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destination &d, wb_name &name) {return 0;}
bool copyOset(pwr_tStatus *sts, wb_oset *oset, wb_destination d) {return false;} bool copyOset(pwr_tStatus *sts, wb_oset *oset, wb_destination &d) {return false;}
bool moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination d) {return false;} bool moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d) {return false;}
bool deleteObject(pwr_tStatus *sts, wb_orep *orep) {return false;} bool deleteObject(pwr_tStatus *sts, wb_orep *orep) {return false;}
bool deleteFamily(pwr_tStatus *sts, wb_orep *orep) {return false;} bool deleteFamily(pwr_tStatus *sts, wb_orep *orep) {return false;}
bool deleteOset(pwr_tStatus *sts, wb_oset *oset) {return false;} bool deleteOset(pwr_tStatus *sts, wb_oset *oset) {return false;}
bool renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name name) { return false;} bool renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name) { return false;}
bool commit(pwr_tStatus *sts) {return false;} bool commit(pwr_tStatus *sts) {return false;}
...@@ -153,36 +151,36 @@ public: ...@@ -153,36 +151,36 @@ public:
virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p) {return false;} virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p) {return false;}
virtual void *readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p); virtual void *readAttribute(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p);
virtual void *readBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p); virtual void *readBody(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, void *p);
virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p) {return false;}; virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p) {return false;};
wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o); wb_orep *ancestor(pwr_tStatus *sts, const wb_orep *o);
wb_orep *parent(pwr_tStatus *sts, wb_orep *o); wb_orep *parent(pwr_tStatus *sts, const wb_orep *o);
wb_orep *after(pwr_tStatus *sts, wb_orep *o); wb_orep *after(pwr_tStatus *sts, const wb_orep *o);
wb_orep *before(pwr_tStatus *sts, wb_orep *o); wb_orep *before(pwr_tStatus *sts, const wb_orep *o);
wb_orep *first(pwr_tStatus *sts, wb_orep *o); wb_orep *first(pwr_tStatus *sts, const wb_orep *o);
wb_orep *child(pwr_tStatus *sts, wb_orep *o, wb_name name); wb_orep *child(pwr_tStatus *sts, const wb_orep *o, wb_name &name);
wb_orep *last(pwr_tStatus *sts, wb_orep *o); wb_orep *last(pwr_tStatus *sts, const wb_orep *o);
wb_orep *next(pwr_tStatus *sts, wb_orep *o); wb_orep *next(pwr_tStatus *sts, const wb_orep *o);
wb_orep *previous(pwr_tStatus *sts, wb_orep *o); wb_orep *previous(pwr_tStatus *sts, const wb_orep *o);
wb_srep *newSession() {return 0;} wb_srep *newSession() {return 0;}
bool isLocal(wb_orep *o) const {return false;} bool isLocal(const wb_orep *o) {return false;}
void objectName(wb_orep *o, char *str); void objectName(const wb_orep *o, char *str);
virtual bool exportVolume(wb_import &i); virtual bool exportVolume(wb_import &i);
virtual bool exportHead(wb_import &i); virtual bool exportHead(wb_import &i);
......
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