Commit 7fe4ec0a authored by lw's avatar lw

*** empty log message ***

parent f8e7fa87
......@@ -398,7 +398,7 @@ dbs_Map(pwr_tStatus *sts, dbs_sEnv *ep, const char *filename)
struct stat sb;
int ret;
int fd;
//#define DBS_DEBUG 1
#define DBS_DEBUG 1
#if DBS_DEBUG
int i;
dbs_sFile *fp;
......
#include "wb_ldh_msg.h"
#include "wb_adef.h"
#include "wb_adrep.h"
#include "wb_name.h"
wb_adef::wb_adef() : wb_status(LDH__NOSUCHATTR), m_adrep(0)
{
......
#ifndef wb_adef_h
#define wb_adef_h
#include "wb_adrep.h"
#include "pwr.h"
#include "wb_orep.h"
#include "wb_name.h"
#include "wb_status.h"
#include "wb_ldh.h"
#include "wb_cdef.h"
#include "wb_bdef.h"
class wb_orep;
class wb_adrep;
class wb_bdef;
class wb_cdef;
class wb_name;
class wb_adef : public wb_status
{
wb_adrep *m_adrep;
wb_adrep *m_adrep;
public:
wb_adef();
wb_adef(const wb_adef&); // x = other_object
wb_adef(wb_adrep*);
wb_adef(const wb_orep&); // x = other orep
wb_adef& operator=(const wb_adef&);
wb_adef();
wb_adef(const wb_adef&); // x = other_object
wb_adef(wb_adrep*);
wb_adef(const wb_orep&); // x = other orep
wb_adef& operator=(const wb_adef&);
~wb_adef();
~wb_adef();
operator bool() const { return (m_adrep != 0);}
operator wb_adrep*() const { return m_adrep;}
bool operator==(wb_adef&);
operator bool() const { return (m_adrep != 0);}
operator wb_adrep*() const { return m_adrep;}
bool operator==(wb_adef&);
wb_bdef bdef();
wb_cdef cdef();
pwr_sAttrRef aref();
size_t size(); // get objects runtime body size
int offset();
pwr_eType type();
int nElement();
int index();
int flags();
pwr_tOid aoid();
pwr_tAix aix();
pwr_tCid cid();
pwr_eBix bix();
pwr_tOid boid();
wb_bdef bdef();
wb_cdef cdef();
pwr_sAttrRef aref();
size_t size(); // get objects runtime body size
int offset();
pwr_eType type();
int nElement();
int index();
int flags();
pwr_tOid aoid();
pwr_tAix aix();
pwr_tCid cid();
pwr_eBix bix();
pwr_tOid boid();
wb_adef next();
wb_adef prev();
wb_adef next();
wb_adef prev();
const char *name();
wb_name longName();
void *body( void *p = 0);
const char *name();
wb_name longName();
void *body( void *p = 0);
private:
void check();
private:
void check();
};
#endif
......
#include "wb_adrep.h"
#include "wb_bdrep.h"
#include "wb_vrep.h"
#include "wb_cdef.h"
#include "wb_cdrep.h"
#include "wb_orepdbs.h"
void wb_adrep::unref()
......@@ -16,108 +18,108 @@ wb_adrep *wb_adrep::ref()
}
wb_adrep::wb_adrep( wb_orepdbs& o): m_nRef(0), m_orep(&o), m_sts(LDH__SUCCESS),
m_subClass(pwr_eClass__)
m_subClass(pwr_eClass__)
{
m_orep->ref();
pwr_tStatus sts;
switch ( m_orep->cid()) {
case pwr_eClass_Param:
{
pwr_sParam attr;
m_orep->m_vrep->readBody( &sts, m_orep, pwr_eBix_sys, (void *) &attr);
if ( EVEN(sts)) throw wb_error(sts);
strcpy( m_pgmname, attr.Info.PgmName);
m_size = attr.Info.Size;
m_type = attr.Info.Type;
m_offset = attr.Info.Offset;
m_elements = attr.Info.Elements;
m_paramindex = attr.Info.ParamIndex;
m_flags = attr.Info.Flags;
m_tid = attr.TypeRef;
break;
}
case pwr_eClass_Intern:
case pwr_eClass_Input:
case pwr_eClass_Output:
{
pwr_sIntern attr;
m_orep->m_vrep->readBody( &sts, m_orep, pwr_eBix_sys, (void *) &attr);
if ( EVEN(sts)) throw wb_error(sts);
strcpy( m_pgmname, attr.Info.PgmName);
m_size = attr.Info.Size;
m_type = attr.Info.Type;
m_offset = attr.Info.Offset;
m_elements = attr.Info.Elements;
m_paramindex = attr.Info.ParamIndex;
m_flags = attr.Info.Flags;
m_tid = attr.TypeRef;
break;
}
case pwr_eClass_ObjXRef:
{
pwr_sObjXRef attr;
m_orep->m_vrep->readBody( &sts, m_orep, pwr_eBix_sys, (void *) &attr);
if ( EVEN(sts)) throw wb_error(sts);
strcpy( m_pgmname, attr.Info.PgmName);
m_size = attr.Info.Size;
m_type = attr.Info.Type;
m_offset = attr.Info.Offset;
m_elements = attr.Info.Elements;
m_paramindex = attr.Info.ParamIndex;
m_flags = attr.Info.Flags;
m_tid = 0;
break;
}
case pwr_eClass_AttrXRef:
{
pwr_sAttrXRef attr;
m_orep->m_vrep->readBody( &sts, m_orep, pwr_eBix_sys, (void *) &attr);
if ( EVEN(sts)) throw wb_error(sts);
strcpy( m_pgmname, attr.Info.PgmName);
m_size = attr.Info.Size;
m_type = attr.Info.Type;
m_offset = attr.Info.Offset;
m_elements = attr.Info.Elements;
m_paramindex = attr.Info.ParamIndex;
m_flags = attr.Info.Flags;
m_tid = 0;
break;
}
case pwr_eClass_Buffer:
{
pwr_sBuffer attr;
m_orep->m_vrep->readBody( &sts, m_orep, pwr_eBix_sys, (void *) &attr);
if ( EVEN(sts)) throw wb_error(sts);
strcpy( m_pgmname, attr.Info.PgmName);
m_size = attr.Info.Size;
m_type = attr.Info.Type;
m_offset = attr.Info.Offset;
m_elements = attr.Info.Elements;
m_paramindex = attr.Info.ParamIndex;
m_flags = attr.Info.Flags;
m_flags |= PWR_MASK_BUFFER;
m_tid = 0;
m_subClass = attr.Class;
break;
}
default:
throw wb_error(LDH__NYI);
case pwr_eClass_Param:
{
pwr_sParam attr;
m_orep->m_vrep->readBody( &sts, m_orep, pwr_eBix_sys, (void *) &attr);
if ( EVEN(sts)) throw wb_error(sts);
strcpy( m_pgmname, attr.Info.PgmName);
m_size = attr.Info.Size;
m_type = attr.Info.Type;
m_offset = attr.Info.Offset;
m_elements = attr.Info.Elements;
m_paramindex = attr.Info.ParamIndex;
m_flags = attr.Info.Flags;
m_tid = attr.TypeRef;
break;
}
case pwr_eClass_Intern:
case pwr_eClass_Input:
case pwr_eClass_Output:
{
pwr_sIntern attr;
m_orep->m_vrep->readBody( &sts, m_orep, pwr_eBix_sys, (void *) &attr);
if ( EVEN(sts)) throw wb_error(sts);
strcpy( m_pgmname, attr.Info.PgmName);
m_size = attr.Info.Size;
m_type = attr.Info.Type;
m_offset = attr.Info.Offset;
m_elements = attr.Info.Elements;
m_paramindex = attr.Info.ParamIndex;
m_flags = attr.Info.Flags;
m_tid = attr.TypeRef;
break;
}
case pwr_eClass_ObjXRef:
{
pwr_sObjXRef attr;
m_orep->m_vrep->readBody( &sts, m_orep, pwr_eBix_sys, (void *) &attr);
if ( EVEN(sts)) throw wb_error(sts);
strcpy( m_pgmname, attr.Info.PgmName);
m_size = attr.Info.Size;
m_type = attr.Info.Type;
m_offset = attr.Info.Offset;
m_elements = attr.Info.Elements;
m_paramindex = attr.Info.ParamIndex;
m_flags = attr.Info.Flags;
m_tid = 0;
break;
}
case pwr_eClass_AttrXRef:
{
pwr_sAttrXRef attr;
m_orep->m_vrep->readBody( &sts, m_orep, pwr_eBix_sys, (void *) &attr);
if ( EVEN(sts)) throw wb_error(sts);
strcpy( m_pgmname, attr.Info.PgmName);
m_size = attr.Info.Size;
m_type = attr.Info.Type;
m_offset = attr.Info.Offset;
m_elements = attr.Info.Elements;
m_paramindex = attr.Info.ParamIndex;
m_flags = attr.Info.Flags;
m_tid = 0;
break;
}
case pwr_eClass_Buffer:
{
pwr_sBuffer attr;
m_orep->m_vrep->readBody( &sts, m_orep, pwr_eBix_sys, (void *) &attr);
if ( EVEN(sts)) throw wb_error(sts);
strcpy( m_pgmname, attr.Info.PgmName);
m_size = attr.Info.Size;
m_type = attr.Info.Type;
m_offset = attr.Info.Offset;
m_elements = attr.Info.Elements;
m_paramindex = attr.Info.ParamIndex;
m_flags = attr.Info.Flags;
m_flags |= PWR_MASK_BUFFER;
m_tid = 0;
m_subClass = attr.Class;
break;
}
default:
throw wb_error(LDH__NYI);
}
}
......@@ -173,15 +175,15 @@ pwr_eBix wb_adrep::bix()
pwr_sAttrRef wb_adrep::aref()
{
pwr_sAttrRef aref;
pwr_sAttrRef aref;
//aref.Objid = ;
//aref.Body = bid();
//aref.Offset = ;
//aref.Size = ;
//aref.Flags = ;
//aref.Objid = ;
//aref.Body = bid();
//aref.Offset = ;
//aref.Size = ;
//aref.Flags = ;
return aref;
return aref;
}
//
......@@ -189,12 +191,12 @@ pwr_sAttrRef wb_adrep::aref()
//
pwr_tOid wb_adrep::boid()
{
pwr_tOid oid;
pwr_tOid oid;
//dbs_sBdef *b = (dbs_sBdef *)dbs_Address(sts, m_v->m_env, m_a->bdef);
//dbs_sBdef *b = (dbs_sBdef *)dbs_Address(sts, m_v->m_env, m_a->bdef);
return oid;
return oid;
}
//
......@@ -208,7 +210,7 @@ pwr_tCid wb_adrep::cid()
wb_vrep *wb_adrep::vrep() const
{
if (EVEN(m_sts)) throw wb_error(m_sts);
return m_orep->m_vrep;
return m_orep->m_vrep;
}
const char *wb_adrep::name() const
......@@ -227,25 +229,25 @@ void *wb_adrep::body( void *p)
int size;
switch ( m_orep->cid()) {
case pwr_eClass_Param:
size = sizeof( pwr_sParam);
break;
case pwr_eClass_Intern:
case pwr_eClass_Input:
case pwr_eClass_Output:
size = sizeof( pwr_sIntern);
break;
case pwr_eClass_ObjXRef:
size = sizeof( pwr_sObjXRef);
break;
case pwr_eClass_AttrXRef:
size = sizeof( pwr_sAttrXRef);
break;
case pwr_eClass_Buffer:
size = sizeof( pwr_sBuffer);
break;
default:
throw wb_error(LDH__NYI);
case pwr_eClass_Param:
size = sizeof( pwr_sParam);
break;
case pwr_eClass_Intern:
case pwr_eClass_Input:
case pwr_eClass_Output:
size = sizeof( pwr_sIntern);
break;
case pwr_eClass_ObjXRef:
size = sizeof( pwr_sObjXRef);
break;
case pwr_eClass_AttrXRef:
size = sizeof( pwr_sAttrXRef);
break;
case pwr_eClass_Buffer:
size = sizeof( pwr_sBuffer);
break;
default:
throw wb_error(LDH__NYI);
}
return m_orep->m_vrep->readBody( &sts, m_orep, pwr_eBix_sys, p);
......
#ifndef wb_adrep_h
#define wb_adrep_h
#include "pwr.h"
#include "pwr_class.h"
#include "co_cdh.h"
#include "wb_name.h"
class wb_bdrep;
class wb_cdrep;
class wb_orepdbs;
class wb_vrep;
class wb_bdrep;
class wb_name;
class wb_adrep
{
int m_nRef;
wb_orepdbs *m_orep;
pwr_tStatus m_sts;
int m_nRef;
wb_orepdbs *m_orep;
pwr_tStatus m_sts;
size_t m_size;
pwr_eType m_type;
int m_offset;
int m_elements;
int m_paramindex;
int m_flags;
pwr_tTid m_tid;
pwr_tPgmName m_pgmname;
pwr_tCid m_subClass;
friend class wb_bdrep;
friend class wb_cdrep;
public:
wb_adrep(wb_orepdbs& );
~wb_adrep();
void unref();
wb_adrep *ref();
wb_adrep *next( pwr_tStatus *sts);
wb_adrep *prev( pwr_tStatus *sts);
wb_bdrep *bdrep();
wb_cdrep *cdrep();
pwr_sAttrRef aref();
size_t size() {return m_size;}
int offset() {return m_offset;}
pwr_eType type() const {return m_type;}
pwr_tTid tid() {return m_tid;}
int nElement() {return m_elements;}
int index() {return m_paramindex;}
pwr_tOid aoid();
int aix();
pwr_tCid cid();
pwr_eBix bix();
int flags() {return m_flags;}
pwr_tOid boid();
pwr_tCid subClass() { return m_subClass;}
const char *name() const;
wb_name longName();
void *body( void *p = 0);
wb_vrep *vrep() const;
size_t m_size;
pwr_eType m_type;
int m_offset;
int m_elements;
int m_paramindex;
int m_flags;
pwr_tTid m_tid;
pwr_tPgmName m_pgmname;
pwr_tCid m_subClass;
friend class wb_bdrep;
friend class wb_cdrep;
public:
wb_adrep(wb_orepdbs& );
~wb_adrep();
void unref();
wb_adrep *ref();
wb_adrep *next( pwr_tStatus *sts);
wb_adrep *prev( pwr_tStatus *sts);
wb_bdrep *bdrep();
wb_cdrep *cdrep();
pwr_sAttrRef aref();
size_t size() {return m_size;}
int offset() {return m_offset;}
pwr_eType type() const {return m_type;}
pwr_tTid tid() {return m_tid;}
int nElement() {return m_elements;}
int index() {return m_paramindex;}
pwr_tOid aoid();
int aix();
pwr_tCid cid();
pwr_eBix bix();
int flags() {return m_flags;}
pwr_tOid boid();
pwr_tCid subClass() { return m_subClass;}
const char *name() const;
wb_name longName();
void *body( void *p = 0);
wb_vrep *vrep() const;
};
#endif
......
......@@ -4,11 +4,10 @@
#include "wb_attrname.h"
#include "pwr.h"
wb_attribute::wb_attribute() : 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__)
wb_attribute::wb_attribute() :
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__)
{
}
......@@ -71,7 +70,7 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, const char* bname) :
if ( oddSts()) {
wb_bdrep *bd = cd->bdrep( &m_sts, bname);
if ( oddSts()) {
m_size = bd->size();
m_size = bd->size();
delete bd;
}
delete cd;
......@@ -96,8 +95,8 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, char const* bname, co
if ( oddSts()) {
if ( bname) {
bd = cd->bdrep( &m_sts, bname);
if ( oddSts())
m_adrep = bd->adrep( &m_sts, n.attribute(0));
if ( oddSts())
m_adrep = bd->adrep( &m_sts, n.attribute(0));
}
else {
m_adrep = cd->adrep( &m_sts, n.attribute(0));
......@@ -106,10 +105,10 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, char const* bname, co
m_adrep->ref();
if ( !m_orep->vrep()->merep()->getAttrInfoRec( &n, m_adrep->bix(),
m_orep->cid(), (int *) &m_size,
&m_offset, &m_tid, &m_elements,
&m_type,
&m_flags, 0)) {
m_orep->cid(), (int *) &m_size,
&m_offset, &m_tid, &m_elements,
&m_type,
&m_flags, 0)) {
m_adrep->unref();
m_adrep = 0;
m_sts = LDH__NOSUCHATTR;
......@@ -249,14 +248,14 @@ void wb_attribute::check() const
//
pwr_sAttrRef wb_attribute::aref()
{
pwr_sAttrRef aref;
pwr_sAttrRef aref;
return aref;
return aref;
}
pwr_sAttrRef *wb_attribute::aref(pwr_sAttrRef *arp)
{
return arp;
return arp;
}
size_t wb_attribute::size()
......@@ -368,7 +367,7 @@ void *wb_attribute::value( void *p)
void *wb_attribute::value(void *vp, size_t size, pwr_tStatus *sts)
{
return 0;
return 0;
}
......@@ -419,27 +418,27 @@ wb_attribute wb_attribute::after()
wb_attribute wb_attribute::before()
{
wb_attribute a;
return a;
wb_attribute a;
return a;
}
wb_attribute wb_attribute::first(int idx)
{
if (!isClass())
return wb_attribute();
if (!isClass())
return wb_attribute();
return wb_attribute(*this, idx, NULL);
return wb_attribute(*this, idx, NULL);
}
wb_attribute wb_attribute::child(int idx, const char* name)
{
if (!isClass())
return wb_attribute();
if (!isClass())
return wb_attribute();
return wb_attribute(*this, idx, name);
return wb_attribute(*this, idx, name);
}
......@@ -454,18 +453,18 @@ const char *wb_attribute::name() const
// Fix, no index and no subclass !!!
wb_name wb_attribute::longName()
{
check();
check();
if ( !m_adrep)
return m_orep->longName();
if ( !m_adrep)
return m_orep->longName();
char str[512];
strcpy( str, m_orep->longName().name());
strcat( str, ".");
strcat( str, m_adrep->name());
char str[512];
strcpy( str, m_orep->longName().name());
strcat( str, ".");
strcat( str, m_adrep->name());
wb_name n = wb_name( str);
return n;
wb_name n = wb_name( str);
return n;
}
void wb_attribute::name(const char *name)
......
......@@ -12,14 +12,14 @@ using namespace std;
/*
class wb_attribute {
void *value;
void *value;
...
...
wb_attribute::~wb_attribute() {
if (value != 0)
free value;
if (value != 0)
free value;
*/
class wb_adrep;
......@@ -27,84 +27,84 @@ class wb_orep;
class wb_attribute : public wb_status
{
wb_orep *m_orep;
wb_adrep *m_adrep;
wb_orep *m_orep;
wb_adrep *m_adrep;
size_t m_size;
int m_offset;
pwr_tTid m_tid;
int m_elements;
pwr_eType m_type;
int m_flags;
size_t m_size;
int m_offset;
pwr_tTid m_tid;
int m_elements;
pwr_eType m_type;
int m_flags;
pwr_eBix m_bix; // Used when sub class
pwr_eBix m_bix; // Used when sub class
public:
wb_attribute();
wb_attribute(const wb_attribute&);
wb_attribute(pwr_tStatus, wb_orep*);
wb_attribute(pwr_tStatus, wb_orep*, wb_adrep*);
wb_attribute(pwr_tStatus, wb_orep*, const char* bname);
wb_attribute(pwr_tStatus, wb_orep*, const char* bname, const char* aname);
wb_attribute(wb_attribute& pa, int idx, const char* aname);
wb_attribute();
wb_attribute(const wb_attribute&);
wb_attribute(pwr_tStatus, wb_orep*);
wb_attribute(pwr_tStatus, wb_orep*, wb_adrep*);
wb_attribute(pwr_tStatus, wb_orep*, const char* bname);
wb_attribute(pwr_tStatus, wb_orep*, const char* bname, const char* aname);
wb_attribute(wb_attribute& pa, int idx, const char* aname);
~wb_attribute();
wb_attribute& operator=(const wb_attribute&);
operator bool() const { return oddSts();}
operator wb_orep*() const;
bool operator==(wb_attribute&);
~wb_attribute();
wb_attribute& operator=(const wb_attribute&);
operator bool() const { return oddSts();}
operator wb_orep*() const;
bool operator==(wb_attribute&);
//wb_object& operator=(const wb_orep&);
//wb_object& operator=(const wb_orep&);
bool isClass() const {return (m_flags & PWR_MASK_CLASS || m_flags & PWR_MASK_BUFFER);}
bool isArray() const {return (m_flags & PWR_MASK_ARRAY);}
bool isClass() const {return (m_flags & PWR_MASK_CLASS || m_flags & PWR_MASK_BUFFER);}
bool isArray() const {return (m_flags & PWR_MASK_ARRAY);}
pwr_tOid aoid(); // get objects object id
pwr_sAttrRef aref();
pwr_sAttrRef *aref(pwr_sAttrRef *arp);
size_t size();
int offset();
pwr_eType type();
int nElement();
int index();
int flags();
pwr_tAix aix();
// Class of attribute object
pwr_tCid cid();
pwr_eBix bix();
pwr_tOid boid();
bool checkXref();
pwr_sAttrXRef *xref();
pwr_sObjXRef *oxref();
pwr_tCid subClass();
pwr_tOid aoid(); // get objects object id
pwr_sAttrRef aref();
pwr_sAttrRef *aref(pwr_sAttrRef *arp);
size_t size();
int offset();
pwr_eType type();
int nElement();
int index();
int flags();
pwr_tAix aix();
// Class of attribute object
pwr_tCid cid();
pwr_eBix bix();
pwr_tOid boid();
bool checkXref();
pwr_sAttrXRef *xref();
pwr_sObjXRef *oxref();
pwr_tCid subClass();
void *value( void *p = 0);
void *value(void *vp, size_t size, pwr_tStatus*);
void *value( void *p = 0);
void *value(void *vp, size_t size, pwr_tStatus*);
string toString();
pwr_tStatus fromString(string);
pwr_tStatus fromString(char *);
string toString();
pwr_tStatus fromString(string);
pwr_tStatus fromString(char *);
wb_attribute after();
wb_attribute before();
wb_attribute after();
wb_attribute before();
wb_attribute first(int idx);
wb_attribute child(int idx, const char* name);
wb_attribute first(int idx);
wb_attribute child(int idx, const char* name);
const char *name() const;
wb_name longName();
void name(const char *name);
void name(wb_name *name);
const char *name() const;
wb_name longName();
void name(const char *name);
void name(wb_name *name);
pwr_tStatus sts() { return m_sts;}
pwr_tStatus sts() { return m_sts;}
private:
void check() const;
void init();
private:
void check() const;
void init();
};
#endif
#include <string.h>
#include "wb_attrname.h"
......
#include "wb_bdef.h"
#include "wb_adef.h"
#include "wb_bdrep.h"
wb_bdef::wb_bdef() : wb_status(LDH__NOSUCHBODY), m_bdrep(0)
{
......@@ -41,37 +42,37 @@ wb_bdef::wb_bdef(const wb_orep *o, pwr_eBix bix)
pwr_tOid wb_bdef::boid()
{
return m_bdrep->boid();
return m_bdrep->boid();
}
pwr_eBix wb_bdef::bix()
{
return m_bdrep->bix();
return m_bdrep->bix();
}
size_t wb_bdef::size()
{
return m_bdrep->size();
return m_bdrep->size();
}
int wb_bdef::nAttribute()
{
return m_bdrep->nAttribute();
return m_bdrep->nAttribute();
}
const char* wb_bdef::name() const
{
return m_bdrep->name();
return m_bdrep->name();
}
wb_name wb_bdef::longName() const
{
return m_bdrep->longName();
return m_bdrep->longName();
}
pwr_sAttrRef wb_bdef::aref()
{
return m_bdrep->aref();
return m_bdrep->aref();
}
wb_adef wb_bdef::adef()
......@@ -90,10 +91,4 @@ wb_adef wb_bdef::adef( const char *aname)
wb_adrep *adrep = m_bdrep->adrep( &sts, aname);
wb_adef a = wb_adef( adrep);
return a;
}
]
......@@ -2,47 +2,48 @@
#define wb_bdef_h
#include "pwr.h"
#include "wb_bdrep.h"
#include "wb_name.h"
#include "wb_ldh.h"
#include "wb_status.h"
class wb_orep;
class wb_bdrep;
class wb_adef;
class wb_name;
class wb_bdef : public wb_status
{
int m_nRef;
wb_bdrep *m_bdrep;
int m_nRef;
wb_bdrep *m_bdrep;
public:
wb_bdef();
wb_bdef(wb_bdrep* bdrep);
wb_bdef(const wb_bdef&);
wb_bdef& operator=(const wb_bdef&);
wb_bdef();
wb_bdef(wb_bdrep* bdrep);
wb_bdef(const wb_bdef&);
wb_bdef& operator=(const wb_bdef&);
wb_bdef(const wb_adef *a);
wb_bdef(const wb_orep *o, pwr_eBix bix);
wb_bdef(const wb_adef *a);
wb_bdef(const wb_orep *o, pwr_eBix bix);
~wb_bdef() {}; // Fix
~wb_bdef() {}; // Fix
operator bool() const { return (m_bdrep != 0);}
operator wb_bdrep*() const;
bool operator==(wb_bdef&);
operator bool() const { return (m_bdrep != 0);}
operator wb_bdrep*() const;
bool operator==(wb_bdef&);
pwr_tOid boid();
pwr_eBix bix();
size_t size();
int nAttribute();
pwr_tOid boid();
pwr_eBix bix();
size_t size();
int nAttribute();
const char* name() const; // get body name
wb_name longName() const;
const char* name() const; // get body name
wb_name longName() const;
pwr_sAttrRef aref();
pwr_sAttrRef aref();
wb_adef adef(); // Get first attribute
wb_adef adef(pwr_tAix aix);
wb_adef adef(const char *aname);
wb_adef adef(wb_name aname);
wb_adef adef(); // Get first attribute
wb_adef adef(pwr_tAix aix);
wb_adef adef(const char *aname);
wb_adef adef(wb_name aname);
};
......
......@@ -75,17 +75,17 @@ int wb_bdrep::nAttribute()
wb_orepdbs *orep = (wb_orepdbs *)m_orep->m_vrep->first( &sts, m_orep);
while ( ODD(sts)) {
switch ( orep->cid()) {
case pwr_eClass_Param:
case pwr_eClass_Intern:
case pwr_eClass_Input:
case pwr_eClass_Output:
case pwr_eClass_ObjXRef:
case pwr_eClass_AttrXRef:
case pwr_eClass_Buffer:
attr_count++;
break;
default:
;
case pwr_eClass_Param:
case pwr_eClass_Intern:
case pwr_eClass_Input:
case pwr_eClass_Output:
case pwr_eClass_ObjXRef:
case pwr_eClass_AttrXRef:
case pwr_eClass_Buffer:
attr_count++;
break;
default:
;
}
old = orep;
orep = (wb_orepdbs *)orep->after( &sts);
......
......@@ -10,34 +10,34 @@ class wb_orepdbs;
class wb_bdrep
{
int m_nRef;
wb_orepdbs *m_orep;
pwr_tStatus m_sts;
int m_nRef;
wb_orepdbs *m_orep;
pwr_tStatus m_sts;
public:
wb_bdrep();
wb_bdrep(wb_orepdbs& o); // own orep
wb_bdrep( wb_adrep *adrep);
~wb_bdrep();
void unref();
wb_bdrep *ref();
pwr_sAttrRef aref() { pwr_sAttrRef a; return a;} // Fix
size_t size();
int nAttribute();
pwr_eBix bix();
pwr_tOid boid();
wb_bdrep();
wb_bdrep(wb_orepdbs& o); // own orep
wb_bdrep( wb_adrep *adrep);
~wb_bdrep();
void unref();
wb_bdrep *ref();
pwr_sAttrRef aref() { pwr_sAttrRef a; return a;} // Fix
size_t size();
int nAttribute();
pwr_eBix bix();
pwr_tOid boid();
const char* name() const; // get body name
wb_name longName() const;
const char* name() const; // get body name
wb_name longName() const;
wb_adrep *adrep( pwr_tStatus *sts); // Get first attribute
wb_adrep *adrep( pwr_tStatus *sts, const char *aname);
wb_adrep *adrep( pwr_tStatus *sts); // Get first attribute
wb_adrep *adrep( pwr_tStatus *sts, const char *aname);
pwr_tStatus sts() { return m_sts;}
pwr_tStatus sts() { return m_sts;}
};
......
#include "wb_cdef.h"
#include "wb_adef.h"
#include "wb_bdef.h"
#include "wb_cdef.h"
#include "wb_cdrep.h"
#include "wb_object.h"
wb_cdef::wb_cdef() : wb_status(LDH__NOCLASS), m_cdrep(0)
......@@ -77,7 +79,7 @@ wb_cdef& wb_cdef::operator=(const wb_cdef& x)
void wb_cdef::check() const
{
if ( !m_cdrep)
throw wb_error(m_sts);
throw wb_error(m_sts);
}
size_t wb_cdef::size()
......
......@@ -3,53 +3,50 @@
#include "pwr.h"
#include "pwr_class.h"
#include "wb_bdef.h"
#include "wb_orep.h"
#include "wb_cdrep.h"
#include "wb_name.h"
class wb_bdef;
class wb_adef;
class wb_cdrep;
class wb_mvrep;
class wb_object;
class wb_orep;
class wb_cdef : public wb_status
{
public:
wb_cdrep *m_cdrep;
public:
wb_cdrep *m_cdrep;
wb_cdef();
wb_cdef( wb_cdrep *cdrep);
wb_cdef( wb_adef&); // x = other_object
wb_cdef(const wb_orep&); // x = other orep
wb_cdef(wb_mvrep *, pwr_tCid);
wb_cdef(const wb_cdef&);
~wb_cdef();
wb_cdef();
wb_cdef( wb_cdrep *cdrep);
wb_cdef( wb_adef&); // x = other_object
wb_cdef(const wb_orep&); // x = other orep
wb_cdef(wb_mvrep *, pwr_tCid);
wb_cdef(const wb_cdef&);
~wb_cdef();
wb_cdef& operator=(const wb_cdef&);
operator bool() const { return (m_cdrep != 0);}
operator wb_cdrep*() const;
bool operator==(wb_cdef&);
wb_cdef& operator=(const wb_cdef&);
operator bool() const { return (m_cdrep != 0);}
operator wb_cdrep*() const;
bool operator==(wb_cdef&);
size_t size(); // get objects runtime body size
pwr_tCid cid();
pwr_tOid oid() { pwr_tOid oid = pwr_cNOid; return oid;} // Fix
size_t size(); // get objects runtime body size
pwr_tCid cid();
pwr_tOid oid() { pwr_tOid oid = pwr_cNOid; return oid;} // Fix
const char *name() const;
wb_name longName();
const char *name() const;
wb_name longName();
wb_bdef bdef(pwr_eBix bix);
wb_bdef bdef(const char *bname);
wb_bdef bdef(wb_name bname);
wb_bdef bdef(pwr_eBix bix);
wb_bdef bdef(const char *bname);
wb_bdef bdef(wb_name bname);
wb_object classBody( const char *bname);
wb_object classBody( const char *bname);
private:
void check() const;
private:
void check() const;
};
......
extern "C" {
#include "co_cdh.h"
}
#include "wb_cdrep.h"
#include "wb_merep.h"
#include "wb_ldh_msg.h"
......@@ -97,7 +94,7 @@ wb_bdrep *wb_cdrep::bdrep( pwr_tStatus *sts, pwr_eBix bix)
wb_orepdbs *old;
while ( ODD(*sts)) {
if ( orep->cid() == pwr_eClass_ObjBodyDef &&
cdh_oixToBix( orep->oid().oix) == bix) {
cdh_oixToBix( orep->oid().oix) == bix) {
wb_bdrep *bdrep = new wb_bdrep( *orep);
return bdrep;
}
......@@ -127,8 +124,8 @@ wb_adrep *wb_cdrep::adrep( pwr_tStatus *sts, const char *aname)
orep_attr = (wb_orepdbs *)orep->m_vrep->child( sts, orep, n);
if ( ODD(*sts)) {
wb_adrep *adrep = new wb_adrep( *orep_attr);
orep->unref();
return adrep;
orep->unref();
return adrep;
}
}
old = orep;
......
......@@ -14,40 +14,40 @@ class wb_orepdbs;
class wb_cdrep
{
int m_nRef;
wb_orepdbs *m_orep;
pwr_tStatus m_sts;
int m_nRef;
wb_orepdbs *m_orep;
pwr_tStatus m_sts;
public:
wb_cdrep();
wb_cdrep(wb_adrep *); // x = other_object
wb_cdrep(const wb_orep&); // x = other orep
wb_cdrep(wb_mvrep *, const wb_orep&);
wb_cdrep(wb_mvrep *, pwr_tCid);
wb_cdrep(wb_mvrep *, wb_name);
public:
wb_cdrep();
wb_cdrep(wb_adrep *); // x = other_object
wb_cdrep(const wb_orep&); // x = other orep
wb_cdrep(wb_mvrep *, const wb_orep&);
wb_cdrep(wb_mvrep *, pwr_tCid);
wb_cdrep(wb_mvrep *, wb_name);
void unref();
wb_cdrep *ref();
void unref();
wb_cdrep *ref();
//wb_object& operator=(const wb_orep&);
//wb_object& operator=(const wb_orep&);
size_t size() { return 0;} // Fix get objects runtime body size
pwr_tCid cid();
size_t size() { return 0;} // Fix get objects runtime body size
pwr_tCid cid();
const char *name() const;
wb_name longName();
void name(const char *name);
void name(wb_name *name);
const char *name() const;
wb_name longName();
void name(const char *name);
void name(wb_name *name);
wb_bdrep *bdrep( pwr_tStatus *sts, pwr_eBix bix);
wb_bdrep *bdrep( pwr_tStatus *sts, const char *bname);
wb_adrep *adrep( pwr_tStatus *sts, const char *aname);
wb_orep *classBody( pwr_tStatus *sts, const char *bname);
wb_bdrep *bdrep( pwr_tStatus *sts, pwr_eBix bix);
wb_bdrep *bdrep( pwr_tStatus *sts, const char *bname);
wb_adrep *adrep( pwr_tStatus *sts, const char *aname);
wb_orep *classBody( pwr_tStatus *sts, const char *bname);
void templateBody( pwr_tStatus *sts, pwr_eBix bix, void *p);
void templateBody( pwr_tStatus *sts, pwr_eBix bix, void *p);
pwr_tStatus sts() { return m_sts;}
pwr_tStatus sts() { return m_sts;}
};
#endif
This diff is collapsed.
......@@ -7,24 +7,32 @@
#include "co_tree.h"
#include "wb_status.h"
#include "wb_ldh.h"
#include "wb_import.h"
typedef union {
class wb_vrep;
class wb_dbs : public wb_status, public wb_import
{
public:
typedef union {
struct {
pwr_tBit devOnly : 1;
pwr_tBit exist : 1;
pwr_tBit devOnly : 1;
pwr_tBit exist : 1;
} b;
pwr_tBitMask m;
#define mOentry_devOnly 1
#define mOentry_exist 2
} mOentry;
} mOentry;
typedef struct sOentry sOentry;
typedef struct sNentry sNentry;
typedef struct sCentry sCentry;
struct sOentry;
struct sNentry;
struct sCentry;
struct sOentry {
struct sOentry {
tree_sNode node;
dbs_sObject o;
dbs_sBody rbody;
......@@ -40,94 +48,102 @@ struct sOentry {
sOentry *loep;
sOentry *o_ll;
};
};
/* Name entry, used in name table. */
/* Name entry, used in name table. */
struct sNentry {
struct sNentry {
tree_sNode node;
dbs_sName n;
dbs_tRef ref;
sOentry *oep;
};
};
struct sCentry {
struct sCentry {
tree_sNode node;
dbs_sClass c;
dbs_tRef ref;
sOentry *o_lh; // Header of object list
sOentry *o_lt; // Tail of object list
};
class wb_vrep;
class wb_dbs : public wb_status
{
public:
FILE *m_fp; /**< file pointer */
char m_name[100]; /**< name of load file */
// wb_object *m_o; /* Volume object header. */
wb_vrep *m_v;
dbs_sVolume m_volume;
pwr_tOid m_oid;
dbs_sSect m_sect[dbs_eSect_]; /**< section header */
unsigned int m_warnings;
unsigned int m_errors;
};
FILE *m_fp; /**< file pointer */
char m_name[100]; /**< name of load file */
// wb_object *m_o; /* Volume object header. */
wb_vrep *m_v;
dbs_sVolume m_volume;
pwr_tOid m_oid;
dbs_sSect m_sect[dbs_eSect_]; /**< section header */
unsigned int m_warnings;
unsigned int m_errors;
unsigned int m_nObjects;
unsigned int m_nTreeObjects;
unsigned int m_nClassObjects;
unsigned int m_nNameObjects;
unsigned int m_nRbodyObjects;
unsigned int m_nDbodyObjects;
unsigned int m_nObjects;
unsigned int m_nTreeObjects;
unsigned int m_nClassObjects;
unsigned int m_nNameObjects;
unsigned int m_nRbodyObjects;
unsigned int m_nDbodyObjects;
sOentry *m_oep; /* object entry of volume object */
sOentry *m_oep; /* object entry of volume object */
tree_sTable *m_oid_th;
tree_sTable *m_name_th;
tree_sTable *m_class_th;
tree_sTable *m_oid_th;
tree_sTable *m_name_th;
tree_sTable *m_class_th;
wb_dbs();
wb_dbs(wb_vrep *);
wb_dbs();
wb_dbs(wb_vrep *);
~wb_dbs();
~wb_dbs();
//wb_dbs& operator=(const wb_object&);
//wb_dbs& operator=(const wb_object&);
operator bool() const;
operator bool() const;
bool operator==(wb_dbs&);
bool operator==(wb_dbs&);
// void buildFile();
void buildSectName();
void buildSectOid();
void buildSectClass();
void checkObject(sOentry *oep);
pwr_tStatus closeFile(pwr_tBoolean doDelete);
pwr_tBoolean createFile();
// ldhi_sObjHead *getAliasServer(sLCB *lcbp, ldhi_sObjHead *o, pwr_tOid *soid);
// pwr_tStatus getMountServer(sLCB *lcbp, ldhi_sObjHead *o, pwr_tOid *soid);
pwr_tStatus installObject(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid, pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid,
pwr_tOid loid, pwr_tObjName name, pwr_tObjName normname, pwr_tTime ohTime,
pwr_tTime rbTime, pwr_tTime dbTime, size_t rbSize, size_t dbSize);
pwr_tStatus installRbody(pwr_tOid oid, void *body);
pwr_tStatus installDbody(pwr_tOid oid, void *body);
void classInsert(sOentry *oep);
pwr_tStatus openFile();
pwr_tStatus writeSectFile();
pwr_tStatus writeSectDirectory();
pwr_tStatus writeSectVolume();
pwr_tStatus writeSectVolref();
pwr_tStatus writeSectOid();
pwr_tStatus writeSectObject();
pwr_tStatus writeSectRbody();
pwr_tStatus writeSectName();
pwr_tStatus writeSectClass();
pwr_tStatus writeSectDbody();
virtual bool importVolume(wb_export &e);
void buildFile();
void buildSectName();
void buildSectOid();
void buildSectClass();
void checkObject(sOentry *oep);
pwr_tStatus closeFile(pwr_tBoolean doDelete);
pwr_tBoolean createFile();
// ldhi_sObjHead *getAliasServer(sLCB *lcbp, ldhi_sObjHead *o, pwr_tOid *soid);
// pwr_tStatus getMountServer(sLCB *lcbp, ldhi_sObjHead *o, pwr_tOid *soid);
pwr_tStatus installObject(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid, pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid,
pwr_tOid loid, pwr_tObjName name, pwr_tObjName normname, pwr_tTime ohTime,
pwr_tTime rbTime, pwr_tTime dbTime, size_t rbSize, size_t dbSize);
pwr_tStatus installRbody(pwr_tOid oid, void *body);
pwr_tStatus installDbody(pwr_tOid oid, void *body);
void classInsert(sOentry *oep);
pwr_tStatus openFile();
pwr_tStatus writeSectFile();
pwr_tStatus writeSectDirectory();
pwr_tStatus writeSectVolume();
pwr_tStatus writeSectVolref();
pwr_tStatus writeSectOid();
pwr_tStatus writeSectObject();
pwr_tStatus writeSectRbody();
pwr_tStatus writeSectName();
pwr_tStatus writeSectClass();
pwr_tStatus writeSectDbody();
virtual bool importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid, pwr_tOid loid,
pwr_tObjName name, pwr_tObjName normname,
pwr_tTime ohTime, pwr_tTime rbTime, pwr_tTime dbTime,
size_t rbSize, size_t dbSize);
virtual bool importRbody(pwr_tOid oid, size_t size, void *body);
virtual bool importDbody(pwr_tOid oid, size_t size, void *body);
virtual bool importMeta(dbs_sEnv *ep);
private:
......
#include "wb_destination.h"
#include "wb_object.h"
wb_destination::wb_destination(wb_object &parent, wb_object &before, wb_object &after)
wb_destination::wb_destination(pwr_tOid oid, ldh_eDest code) :
m_oid(oid), m_code(code)
{
//m_parent = parent;
}
wb_destination::wb_destination(wb_object &o, ldh_eDest dest)
{
m_dest = dest;
switch (m_dest) {
case ldh_eDest_Before:
//m_parent = o.parent();
//m_after = o;
//m_before = o.before();
break;
case ldh_eDest_After:
//m_parent = object.parent;
//m_after = object.after;
//m_before = object;
break;
case ldh_eDest_IntoFirst:
//m_parent = object;
//m_before = object;
//m_after = object.first;
break;
case ldh_eDest_IntoLast:
//m_parent = object;
//m_after = object;
//m_before = object.last;
default:
break;
}
}
/*
wb_destination::adopt(wb_object o)
{
wb_object parent;
wb_object before;
wb_object after;
switch (m_dest) {
case first:
o.before(m_o);
if (m_o == m_o.first()) {
if (m_before == m_parent) {
m_parent.first(o);
} else {
m_before.after(o);
}
if (m_after == m_parent) {
m_parent.last(o);
} else {
m_after.before(o);
}
o.parent(parent);
o.before(before);
o.after(after);
wb_destination::wb_destination(wb_object &o, ldh_eDest code) :
m_oid(o.oid()), m_code(code)
{
}
*/
......@@ -4,33 +4,23 @@
#include "pwr.h"
#include "wb_ldh.h"
class wb_orep;
class wb_object;
class wb_destination
{
public:
wb_orep *m_parent;
wb_orep *m_before;
wb_orep *m_after;
ldh_eDest m_dest;
/*
Used as intention:
wb_Position(0, 0, after) => the position just before the object with oid = 'after'
wb_Position(0, before, 0) => the position just after the object with oid = 'before'
wb_Position(parent, 0, parent) => the position as last child of the object with oid = 'parent'
wb_Position(parent, parent, 0) => the position as first child of the object with oid = 'parent'
pwr_tOid m_oid;
ldh_eDest m_code;
*/
wb_destination(wb_object &parent, wb_object &before, wb_object &after);
wb_destination(wb_object &object, ldh_eDest dest);
wb_destination(wb_object &object, ldh_eDest code);
wb_destination(pwr_tOid oid, ldh_eDest code);
bool canAdopt(pwr_tCid cid) {return true;} // Fix
bool canAdopt(pwr_tOid oid) {return true;} // Fix
bool canAdopt(pwr_tCid cid) {return true;} // Fix
bool canAdopt(pwr_tOid oid) {return true;} // Fix
pwr_tOid oid() { return m_oid;}
ldh_eDest code() { return m_code;}
};
......
......@@ -4,13 +4,13 @@
wb_env::wb_env() : wb_status(LDH__SUCCESS)
{
m_erep = new wb_erep();
m_erep->ref();
m_erep = new wb_erep();
m_erep->ref();
}
wb_env::wb_env(wb_erep *e) : wb_status(LDH__SUCCESS), m_erep(e)
{
m_erep->ref();
m_erep->ref();
}
wb_env::wb_env(wb_env &e) : wb_status( e.sts()), m_erep(e.m_erep)
......@@ -21,39 +21,39 @@ wb_env::wb_env(wb_env &e) : wb_status( e.sts()), m_erep(e.m_erep)
wb_env& wb_env::operator=(const wb_env& x)
{
// Note! first ref() then unref(), because if
// m_erep == x.m_erep, erep could be deleted.
if ( x.m_erep)
x.m_erep->ref();
if ( m_erep)
m_erep->unref();
m_erep = x.m_erep;
m_sts = x.sts();
// Note! first ref() then unref(), because if
// m_erep == x.m_erep, erep could be deleted.
if ( x.m_erep)
x.m_erep->ref();
if ( m_erep)
m_erep->unref();
m_erep = x.m_erep;
m_sts = x.sts();
return *this;
return *this;
}
wb_env::operator bool() const
{
if (!m_erep)
return false;
if (!m_erep)
return false;
return true;
return true;
}
wb_env::operator wb_erep*() const
{
return m_erep;
return m_erep;
}
bool wb_env::open()
{
return true;
return true;
}
bool wb_env::close()
{
return true;
return true;
}
wb_volume wb_env::volume()
......
......@@ -12,37 +12,37 @@ class wb_erep;
class wb_env : public wb_status
{
protected:
wb_erep *m_erep;
wb_erep *m_erep;
public:
wb_env();
wb_env();
wb_env(wb_erep*);
wb_env(wb_env &e);
wb_env(wb_erep*);
wb_env(wb_env &e);
wb_env& operator=(const wb_env& x);
wb_env& operator=(const wb_env& x);
operator bool() const;
operator wb_erep*() const;
bool operator==(wb_env&);
operator bool() const;
operator wb_erep*() const;
bool operator==(wb_env&);
void load() { m_erep->load(&m_sts);}
bool open();
bool close();
void load() { m_erep->load(&m_sts);}
bool open();
bool close();
// Get first volume in list of db volumes.
wb_volume volume();
// Get db volume.
wb_volume volume(pwr_tVid);
// Get first volume in list of db volumes.
wb_volume volume();
// Get db volume.
wb_volume volume(pwr_tVid);
wb_volume volume(const char *name);
wb_volume externVolume(pwr_tVid);
wb_volume volume(const char *name);
wb_volume externVolume(pwr_tVid);
wb_volume snapshot(pwr_tVid);
wb_volume snapshot(pwr_tVid);
wb_volume createVolume(wb_cdef cdef, pwr_tVid vid, wb_name name);
wb_volume createVolume(wb_cdef cdef, pwr_tVid vid, wb_name name);
};
......
......@@ -31,14 +31,14 @@ wb_erep::~wb_erep()
void wb_erep::unref()
{
if (--m_nRef == 0)
delete this;
if (--m_nRef == 0)
delete this;
}
wb_erep *wb_erep::ref()
{
m_nRef++;
return this;
m_nRef++;
return this;
}
......@@ -118,8 +118,8 @@ wb_vrep *wb_erep::nextVolume(pwr_tStatus *sts, pwr_tVid vid)
if ( it != m_vrepdb.end()) {
it = m_vrepdbs.begin();
if ( it == m_vrepdbs.end()) {
*sts = LDH__NOSUCHVOL;
return 0;
*sts = LDH__NOSUCHVOL;
return 0;
}
}
}
......@@ -281,8 +281,8 @@ void wb_erep::loadCommonMeta( pwr_tStatus *status)
ifstream fpm( fname, ios::in);
if ( !fpm) {
if ( i == 0) {
*status = LDH__NOBASE;
return;
*status = LDH__NOBASE;
return;
}
else
continue;
......@@ -295,10 +295,10 @@ void wb_erep::loadCommonMeta( pwr_tStatus *status)
continue;
nr = dcli_parse( line, " ", "", (char *)vol_array,
sizeof(vol_array)/sizeof(vol_array[0]),
sizeof(vol_array[0]), 0);
sizeof(vol_array)/sizeof(vol_array[0]),
sizeof(vol_array[0]), 0);
if ( nr != 2)
cout << "Syntax error in file: " << fname << endl;
cout << "Syntax error in file: " << fname << endl;
// Load this volume
cdh_ToLower( vol_array[0], vol_array[0]);
......@@ -314,7 +314,7 @@ void wb_erep::loadCommonMeta( pwr_tStatus *status)
addDbs( &sts, vrep);
}
catch ( wb_error& e) {
cout << "** Unable to open volume " << vname << " " << e.what() << endl;
cout << "** Unable to open volume " << vname << " " << e.what() << endl;
}
}
fpm.close();
......@@ -355,8 +355,8 @@ void wb_erep::loadMeta( pwr_tStatus *status)
cout << line << endl;
nr = dcli_parse( line, " ", "", (char *)vol_array,
sizeof(vol_array)/sizeof(vol_array[0]),
sizeof(vol_array[0]), 0);
sizeof(vol_array)/sizeof(vol_array[0]),
sizeof(vol_array[0]), 0);
if ( nr != 4)
cout << "Syntax error in file: " << fname << endl;
......@@ -368,47 +368,47 @@ void wb_erep::loadMeta( pwr_tStatus *status)
cdh_ToLower( vol_array[0], vol_array[0]);
if ( strcmp( vol_array[3], "cnf") == 0) {
// Configured in this project, load from pwrp_load
strcpy( vname, "$pwrp_load/");
// Configured in this project, load from pwrp_load
strcpy( vname, "$pwrp_load/");
strcat( vname, vol_array[0]);
strcat( vname, ".dbs");
strcat( vname, ".dbs");
dcli_translate_filename( vname, vname);
cout << "Found: " << found_file << endl;
// Load...
try {
cout << "Found: " << found_file << endl;
// Load...
try {
vrep = new wb_vrepdbs( this, vname);
vrep->load();
vrep->load();
addDbs( &sts, vrep);
vol_cnt++;
}
catch ( wb_error& e) {
cout << "** Unable to open volume " << vname << " " << e.what() << endl;
}
}
catch ( wb_error& e) {
cout << "** Unable to open volume " << vname << " " << e.what() << endl;
}
}
else {
// Imported loadfile
for ( i = 0; i < m_dir_cnt; i++) {
strcpy( vname, m_dir_list[i]);
strcat( vname, vol_array[0]);
strcat( vname, ".dbs");
cout << "Try: " << vname << endl;
sts = dcli_search_file( vname, found_file, DCLI_DIR_SEARCH_INIT);
dcli_search_file( vname, found_file, DCLI_DIR_SEARCH_END);
if ( ODD(sts)) {
cout << "Found: " << found_file << endl;
// Load...
try {
// Imported loadfile
for ( i = 0; i < m_dir_cnt; i++) {
strcpy( vname, m_dir_list[i]);
strcat( vname, vol_array[0]);
strcat( vname, ".dbs");
cout << "Try: " << vname << endl;
sts = dcli_search_file( vname, found_file, DCLI_DIR_SEARCH_INIT);
dcli_search_file( vname, found_file, DCLI_DIR_SEARCH_END);
if ( ODD(sts)) {
cout << "Found: " << found_file << endl;
// Load...
try {
vrep = new wb_vrepdbs( this, vname);
vrep->load();
vrep->load();
// vrep->name( vol_array[0]);
addDbs( &sts, vrep);
}
catch ( wb_error& e) {
cout << "** Unable to open volume " << vname << " " << e.what() << endl;
}
break;
}
}
}
catch ( wb_error& e) {
cout << "** Unable to open volume " << vname << " " << e.what() << endl;
}
break;
}
}
}
}
else {
......@@ -446,7 +446,7 @@ void wb_erep::loadLocalWb( pwr_tStatus *rsts)
if ( ODD(sts))
addExtern( &sts, vrep);
else {
*rsts = sts;
*rsts = sts;
cout << "** Failiure loading local workbench volume" << endl;
return;
}
......
#ifndef wb_erep_h
#define wb_erep_h
#include "wb_vrep.h"
#include <map>
using namespace std;
......@@ -15,49 +14,49 @@ class wb_adrep;
class wb_erep
{
unsigned int m_nRef;
wb_merep *m_merep;
map<pwr_tVid, wb_vrep*> m_vrepdb;
map<pwr_tVid, wb_vrep*> m_vrepdbs;
map<pwr_tVid, wb_vrep*> m_vrepextern;
unsigned int m_nRef;
wb_merep *m_merep;
map<pwr_tVid, wb_vrep*> m_vrepdb;
map<pwr_tVid, wb_vrep*> m_vrepdbs;
map<pwr_tVid, wb_vrep*> m_vrepextern;
char m_dir_list[10][200];
int m_dir_cnt;
char m_dir_list[10][200];
int m_dir_cnt;
typedef map<pwr_tVid, wb_vrep*>::iterator vrep_iterator;
typedef map<pwr_tVid, wb_vrep*>::iterator vrep_iterator;
public:
wb_erep();
~wb_erep();
void unref();
wb_erep *ref();
//map<string
wb_merep *merep() { return m_merep;}
wb_vrep *volume(pwr_tStatus *sts);
wb_vrep *volume(pwr_tStatus *sts, pwr_tVid vid);
wb_vrep *volume(pwr_tStatus *sts, const char *name);
wb_vrep *nextVolume(pwr_tStatus *sts, pwr_tVid vid);
wb_vrep *externVolume(pwr_tStatus *sts, pwr_tVid vid);
void addDb( pwr_tStatus *sts, wb_vrep *vrep);
void addDbs( pwr_tStatus *sts, wb_vrep *vrep);
void addExtern( pwr_tStatus *sts, wb_vrep *vrep);
void removeDb( pwr_tStatus *sts, wb_vrep *vrep);
void removeDbs( pwr_tStatus *sts, wb_vrep *vrep);
void removeExtern( pwr_tStatus *sts, wb_vrep *vrep);
void load( pwr_tStatus *sts);
wb_orep *object( pwr_tStatus *sts, pwr_tOid oid);
wb_orep *object( pwr_tStatus *sts, const char *name);
wb_cdrep *cdrep( pwr_tStatus *sts, const wb_orep& o);
wb_tdrep *tdrep( pwr_tStatus *sts, const wb_adrep& a);
wb_erep();
~wb_erep();
void unref();
wb_erep *ref();
//map<string
wb_merep *merep() { return m_merep;}
wb_vrep *volume(pwr_tStatus *sts);
wb_vrep *volume(pwr_tStatus *sts, pwr_tVid vid);
wb_vrep *volume(pwr_tStatus *sts, const char *name);
wb_vrep *nextVolume(pwr_tStatus *sts, pwr_tVid vid);
wb_vrep *externVolume(pwr_tStatus *sts, pwr_tVid vid);
void addDb( pwr_tStatus *sts, wb_vrep *vrep);
void addDbs( pwr_tStatus *sts, wb_vrep *vrep);
void addExtern( pwr_tStatus *sts, wb_vrep *vrep);
void removeDb( pwr_tStatus *sts, wb_vrep *vrep);
void removeDbs( pwr_tStatus *sts, wb_vrep *vrep);
void removeExtern( pwr_tStatus *sts, wb_vrep *vrep);
void load( pwr_tStatus *sts);
wb_orep *object( pwr_tStatus *sts, pwr_tOid oid);
wb_orep *object( pwr_tStatus *sts, const char *name);
wb_cdrep *cdrep( pwr_tStatus *sts, const wb_orep& o);
wb_tdrep *tdrep( pwr_tStatus *sts, const wb_adrep& a);
private:
void loadDirList( pwr_tStatus *status);
void loadCommonMeta( pwr_tStatus *status);
void loadMeta( pwr_tStatus *status);
void loadLocalWb( pwr_tStatus *sts);
void loadDirList( pwr_tStatus *status);
void loadCommonMeta( pwr_tStatus *status);
void loadMeta( pwr_tStatus *status);
void loadLocalWb( pwr_tStatus *sts);
};
#endif
......
This diff is collapsed.
......@@ -13,30 +13,31 @@ class wb_adrep;
class wb_merep {
map<pwr_tVid, wb_mvrep*> m_mvrepdbs;
wb_erep *m_erep;
wb_vrep *m_vrep;
typedef map<pwr_tVid, wb_mvrep*>::iterator mvrep_iterator;
public:
wb_merep( wb_erep *erep, wb_vrep *vrep = 0) : m_erep(erep), m_vrep(vrep) {}
wb_mvrep *volume(pwr_tStatus *sts);
wb_mvrep *volume(pwr_tStatus *sts, pwr_tVid vid);
void addDbs( pwr_tStatus *sts, wb_mvrep *mvrep);
void removeDbs( pwr_tStatus *sts, wb_mvrep *mvrep);
wb_cdrep *cdrep( pwr_tStatus *sts, const wb_orep& o);
wb_cdrep *cdrep( pwr_tStatus *sts, pwr_tCid cid);
wb_cdrep *cdrep( pwr_tStatus *sts, wb_name name);
wb_tdrep *tdrep( pwr_tStatus *sts, const wb_adrep& a);
wb_tdrep *tdrep( pwr_tStatus *sts, pwr_tTid tid);
wb_tdrep *tdrep( pwr_tStatus *sts, wb_name name);
int getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, int *size,
int *offset, pwr_tTid *tid, int *elements,
pwr_eType *type, int *flags, int level);
map<pwr_tVid, wb_mvrep*> m_mvrepdbs;
wb_erep *m_erep;
wb_vrep *m_vrep;
typedef map<pwr_tVid, wb_mvrep*>::iterator mvrep_iterator;
public:
wb_merep( wb_erep *erep, wb_vrep *vrep = 0) : m_erep(erep), m_vrep(vrep) {}
wb_mvrep *volume(pwr_tStatus *sts);
wb_mvrep *volume(pwr_tStatus *sts, pwr_tVid vid);
void addDbs( pwr_tStatus *sts, wb_mvrep *mvrep);
void removeDbs( pwr_tStatus *sts, wb_mvrep *mvrep);
wb_cdrep *cdrep( pwr_tStatus *sts, const wb_orep& o);
wb_cdrep *cdrep( pwr_tStatus *sts, pwr_tCid cid);
wb_cdrep *cdrep( pwr_tStatus *sts, wb_name name);
wb_tdrep *tdrep( pwr_tStatus *sts, const wb_adrep& a);
wb_tdrep *tdrep( pwr_tStatus *sts, pwr_tTid tid);
wb_tdrep *tdrep( pwr_tStatus *sts, wb_name name);
int getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, int *size,
int *offset, pwr_tTid *tid, int *elements,
pwr_eType *type, int *flags, int level);
};
......
......@@ -5,24 +5,24 @@
class wb_mvolume
{
wb_mvrepdbs *m_mvrep;
int m_vid;
wb_mvrepdbs *m_mvrep;
int m_vid;
public:
wb_volume();
wb_volume(pwr_tVid vid);
wb_volume();
wb_volume(pwr_tVid vid);
wb_volume volume(pwr_tVid vid);
wb_volume volume(char *name);
wb_volume volume(pwr_tVid vid);
wb_volume volume(char *name);
wb_adef adef(wb_object o, wb_adef adef);
wb_adef adef(wb_object o, wb_name aname);
wb_adef adef(wb_name aname);
wb_adef adef(pwr_tAref *arp);
wb_adef adef(wb_object o, wb_adef adef);
wb_adef adef(wb_object o, wb_name aname);
wb_adef adef(wb_name aname);
wb_adef adef(pwr_tAref *arp);
wb_bdef();
wb_bdef();
wb_cdef();
wb_cdef();
};
......@@ -10,7 +10,7 @@ class wb_tdrep;
class wb_mvrep : public wb_vrep {
public:
public:
wb_cdrep *cdrep( const wb_orep& o);
wb_cdrep *cdrep( pwr_tCid cid);
wb_tdrep *tdrep( const wb_adrep& a);
......
......@@ -12,17 +12,17 @@ class wb_bdrep;
class wb_mvrepdbs
{
pwr_tVid m_vid;
pwr_tVid m_vid;
public:
wb_mvrepdbs();
wb_mvrepdbs(pwr_tVid vid);
wb_mvrepdbs();
wb_mvrepdbs(pwr_tVid vid);
wb_adrep adrep(wb_orep *o, char *aname);
wb_adrep adrep(wb_cdrep *c, char *aname);
wb_bdrep bdrep(wb_bdrep *b, char *aname);
wb_adrep adrep(pwr_sAttrRef *arp);
wb_adrep adrep(wb_orep *o, char *aname);
wb_adrep adrep(wb_cdrep *c, char *aname);
wb_bdrep bdrep(wb_bdrep *b, char *aname);
wb_adrep adrep(pwr_sAttrRef *arp);
};
......
......@@ -34,9 +34,9 @@
u h e y y r e a a y
m c I N i x p r p
e t d a b e a e
m u G t
e t M o
e S r
m u G t
e t M o
e S r
1 * * * * * * * 0 1 Id * _V0.123.34.63
1 * * * * * * * 1 1 Id * _V0.123.34.63:
......@@ -89,89 +89,89 @@
1 0 0 0 0 0 0 0 0 * Root Strict //Avol
1 0 0 0 0 0 0 0 1 * Root Strict //Avol/
*/
*/
class wb_nrep;
class wb_name : public wb_status
{
protected:
wb_nrep *m_nrep;
static const char* m_emptyString;
wb_nrep *m_nrep;
static const char* m_emptyString;
public:
wb_name() : wb_status(LDH__NONAME), m_nrep(0) {}
wb_name(const char*);
wb_name(wb_nrep*);
wb_name(const wb_name&);
wb_name() : wb_status(LDH__NONAME), m_nrep(0) {}
wb_name(const char*);
wb_name(wb_nrep*);
wb_name(const wb_name&);
~wb_name();
~wb_name();
const char* c_str() const;
const char* c_str() const;
wb_name& operator=(const wb_name& n);
wb_name& operator=(const wb_name& n);
operator bool() const { return oddSts();}
operator wb_nrep*() const;
bool operator==(wb_name&);
operator bool() const { return oddSts();}
operator wb_nrep*() const;
bool operator==(wb_name&);
// Name representation
bool hasVolume() const throw (wb_error) { check(); return m_nrep->hasVolume();}
bool hasPath() const throw (wb_error) { check(); return m_nrep->hasPath();}
bool hasObject() const throw (wb_error) { check(); return m_nrep->hasObject();}
bool hasSegment( int idx = 0) const throw (wb_error) { check(); return m_nrep->hasSegment( idx);}
bool hasAttribute( int idx = 0) const throw (wb_error) { check(); return m_nrep->hasAttribute( idx);}
bool hasAttrIndex( int idx = 0) const throw (wb_error) { check(); return m_nrep->hasAttrIndex( idx);}
int attrIndex( int idx = 0) const throw (wb_error) { check(); return m_nrep->attrIndex( idx);}
char *segment( int idx = 0, char *res = 0) const throw (wb_error) { check(); return m_nrep->segment( idx, res);}
char *path( char *res = 0) const throw (wb_error) { check(); return m_nrep->path( res);}
char *volume( char *res = 0) const throw (wb_error) { check(); return m_nrep->volume( res);}
char *object( char *res = 0) const throw (wb_error) { check(); return m_nrep->object( res);}
char *attribute( int idx = 0, char *res = 0) const throw (wb_error) { check(); return m_nrep->attribute( idx, res);}
char *normSegment( int idx = 0, char *res = 0) const throw (wb_error) { check(); return m_nrep->normSegment( idx, res);}
char *normPath( char *res = 0) const throw (wb_error) { check(); return m_nrep->normPath( res);}
char *normVolume( char *res = 0) const throw (wb_error) { check(); return m_nrep->normVolume( res);}
char *normObject( char *res = 0) const throw (wb_error) { check(); return m_nrep->normObject( res);}
char *normAttribute( int idx = 0, char *res = 0) const throw (wb_error) { check(); return m_nrep->normAttribute( idx, res);}
char *name() const throw (wb_error) { check(); return m_nrep->name();}
char *normName() const throw (wb_error) { check(); return m_nrep->normName();}
char *name( int ntype) const throw (wb_error) { check(); return m_nrep->name( ntype);}
char *normName( int ntype) const throw (wb_error) { check(); return m_nrep->normName( ntype);}
bool volumeIsEqual( const char *n) const throw (wb_error) { check(); return m_nrep->volumeIsEqual( n);}
bool objectIsEqual( const char *n) const throw (wb_error) { check(); return m_nrep->objectIsEqual( n);}
bool segmentIsEqual( const char *n, int idx = 0) const throw (wb_error) { check(); return m_nrep->segmentIsEqual( n, idx);}
bool attributeIsEqual( const char *n, int idx = 0) const throw (wb_error) { check(); return m_nrep->attributeIsEqual( n, idx);}
// Id representation
char *vid( char *res = 0) const throw (wb_error) { check(); return m_nrep->volume( res);}
char *oix( char *res = 0) const throw (wb_error) { check(); return m_nrep->segment( 1, res);}
char *bodyName( char *res = 0) const throw (wb_error) { check(); return m_nrep->segment( 2, res);}
int bodyOffset() const throw (wb_error) { check(); return m_nrep->bodyOffset();}
int bodySize() const throw (wb_error) { check(); return m_nrep->bodySize();}
// bool bodyId();
// bool bodyName();
// Name representation
bool hasVolume() const throw (wb_error) { check(); return m_nrep->hasVolume();}
bool hasPath() const throw (wb_error) { check(); return m_nrep->hasPath();}
bool hasObject() const throw (wb_error) { check(); return m_nrep->hasObject();}
bool hasSegment( int idx = 0) const throw (wb_error) { check(); return m_nrep->hasSegment( idx);}
bool hasAttribute( int idx = 0) const throw (wb_error) { check(); return m_nrep->hasAttribute( idx);}
bool hasAttrIndex( int idx = 0) const throw (wb_error) { check(); return m_nrep->hasAttrIndex( idx);}
int attrIndex( int idx = 0) const throw (wb_error) { check(); return m_nrep->attrIndex( idx);}
char *segment( int idx = 0, char *res = 0) const throw (wb_error) { check(); return m_nrep->segment( idx, res);}
char *path( char *res = 0) const throw (wb_error) { check(); return m_nrep->path( res);}
char *volume( char *res = 0) const throw (wb_error) { check(); return m_nrep->volume( res);}
char *object( char *res = 0) const throw (wb_error) { check(); return m_nrep->object( res);}
char *attribute( int idx = 0, char *res = 0) const throw (wb_error) { check(); return m_nrep->attribute( idx, res);}
char *normSegment( int idx = 0, char *res = 0) const throw (wb_error) { check(); return m_nrep->normSegment( idx, res);}
char *normPath( char *res = 0) const throw (wb_error) { check(); return m_nrep->normPath( res);}
char *normVolume( char *res = 0) const throw (wb_error) { check(); return m_nrep->normVolume( res);}
char *normObject( char *res = 0) const throw (wb_error) { check(); return m_nrep->normObject( res);}
char *normAttribute( int idx = 0, char *res = 0) const throw (wb_error) { check(); return m_nrep->normAttribute( idx, res);}
char *name() const throw (wb_error) { check(); return m_nrep->name();}
char *normName() const throw (wb_error) { check(); return m_nrep->normName();}
char *name( int ntype) const throw (wb_error) { check(); return m_nrep->name( ntype);}
char *normName( int ntype) const throw (wb_error) { check(); return m_nrep->normName( ntype);}
bool volumeIsEqual( const char *n) const throw (wb_error) { check(); return m_nrep->volumeIsEqual( n);}
bool objectIsEqual( const char *n) const throw (wb_error) { check(); return m_nrep->objectIsEqual( n);}
bool segmentIsEqual( const char *n, int idx = 0) const throw (wb_error) { check(); return m_nrep->segmentIsEqual( n, idx);}
bool attributeIsEqual( const char *n, int idx = 0) const throw (wb_error) { check(); return m_nrep->attributeIsEqual( n, idx);}
// Id representation
char *vid( char *res = 0) const throw (wb_error) { check(); return m_nrep->volume( res);}
char *oix( char *res = 0) const throw (wb_error) { check(); return m_nrep->segment( 1, res);}
char *bodyName( char *res = 0) const throw (wb_error) { check(); return m_nrep->segment( 2, res);}
int bodyOffset() const throw (wb_error) { check(); return m_nrep->bodyOffset();}
int bodySize() const throw (wb_error) { check(); return m_nrep->bodySize();}
// bool bodyId();
// bool bodyName();
static char *unatName( char *name) { return wb_nrep::unatName( name);}
static bool checkObjectName( const char *name) { return wb_nrep::checkObjectName( name);}
private:
void check() const { if ( evenSts()) throw wb_error(m_sts);}
static char *unatName( char *name) { return wb_nrep::unatName( name);}
static bool checkObjectName( const char *name) { return wb_nrep::checkObjectName( name);}
private:
void check() const { if ( evenSts()) throw wb_error(m_sts);}
};
inline const char* wb_name::c_str() const
{
if (m_nrep == 0)
return m_emptyString;
else
return m_nrep->name();
if (m_nrep == 0)
return m_emptyString;
else
return m_nrep->name();
}
inline ostream& operator<< (ostream& os, const wb_name& name)
{
return os << name.c_str();
return os << name.c_str();
}
......
......@@ -50,15 +50,15 @@ char wb_nrep::unatname_tab[] = \
#define nameDiff( s1, s2) ((long)(s1) - (long)(s2))
wb_nrep::wb_nrep() : m_nRef(0), num_seg(0), num_attr(0), vol_len(0),
seg(0), attr(0)
wb_nrep::wb_nrep() :
m_nRef(0), num_seg(0), num_attr(0), vol_len(0), seg(0), attr(0)
{
strcpy( oname,"");
}
wb_nrep::wb_nrep( const char *n) throw (wb_error) : num_seg(0), num_attr(0), vol_len(0),
vol_offs(0), b_size(0), b_offset(0),
seg(0), attr(0)
wb_nrep::wb_nrep( const char *n) throw (wb_error) :
num_seg(0), num_attr(0), vol_len(0),
vol_offs(0), b_size(0), b_offset(0), seg(0), attr(0)
{
const char *s;
int seg_cnt = 1;
......
......@@ -2,49 +2,50 @@
#include "wb_object.h"
#include "wb_location.h"
#include "wb_error.h"
#include "wb_bdef.h"
bool wb_object::check( string str)
{
if (m_orep == 0) {
m_sts = LDH__NOSUCHOBJ;//LDH__NOOBJECT;
throw wb_error_str(m_sts, str);
}
return true;
if (m_orep == 0) {
m_sts = LDH__NOSUCHOBJ;//LDH__NOOBJECT;
throw wb_error_str(m_sts, str);
}
return true;
}
bool wb_object::check()
{
if (m_orep == 0) {
m_sts = LDH__NOSUCHOBJ;//LDH__NOOBJECT;
throw wb_error(m_sts);
}
return true;
if (m_orep == 0) {
m_sts = LDH__NOSUCHOBJ;//LDH__NOOBJECT;
throw wb_error(m_sts);
}
return true;
}
// Return the current position of this object
wb_location wb_object::location()
{
return wb_location(*this);
return wb_location(*this);
}
wb_destination wb_object::destination(ldh_eDest dest)
{
return wb_destination(*this, dest);
return wb_destination(*this, dest);
}
wb_object::wb_object(wb_orep *orep) : wb_status(LDH__SUCCESS), m_orep(orep)
{
if (orep == 0)
m_sts = LDH__NOSUCHOBJ;
else
m_orep->ref();
if (orep == 0)
m_sts = LDH__NOSUCHOBJ;
else
m_orep->ref();
}
wb_object::wb_object(pwr_tStatus sts, wb_orep *orep) : wb_status(sts), m_orep(orep)
{
if (m_orep != 0)
m_orep = orep->ref();
if (m_orep != 0)
m_orep = orep->ref();
}
......@@ -66,16 +67,16 @@ wb_object::~wb_object()
wb_object& wb_object::operator=(const wb_object& x)
{
// Note! first ref() then unref(), because if
// m_orep == x.m_orep, orep could be deleted.
if ( x.m_orep)
x.m_orep->ref();
if ( m_orep)
m_orep->unref();
m_orep = x.m_orep;
m_sts = x.sts();
// Note! first ref() then unref(), because if
// m_orep == x.m_orep, orep could be deleted.
if ( x.m_orep)
x.m_orep->ref();
if ( m_orep)
m_orep->unref();
m_orep = x.m_orep;
m_sts = x.sts();
return *this;
return *this;
}
wb_object::operator bool() const
......@@ -85,7 +86,7 @@ wb_object::operator bool() const
wb_object::operator wb_orep*() const
{
return m_orep;
return m_orep;
}
const char *wb_object::name()
......@@ -107,12 +108,12 @@ wb_name wb_object::longName()
//
wb_object wb_object::next()
{
check("wb_object::next()");
check("wb_object::next()");
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->next(&sts);
wb_object o(sts, orep);
return o;
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->next(&sts);
wb_object o(sts, orep);
return o;
}
//
......@@ -120,12 +121,12 @@ wb_object wb_object::next()
//
wb_object wb_object::previous()
{
check("wb_object::previous()");
check("wb_object::previous()");
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->previous(&sts);
wb_object o(sts, orep);
return o;
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->previous(&sts);
wb_object o(sts, orep);
return o;
}
//
......@@ -133,12 +134,12 @@ wb_object wb_object::previous()
//
wb_object wb_object::after()
{
check("wb_object::after()");
check("wb_object::after()");
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->after(&sts);
wb_object o(sts, orep);
return o;
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->after(&sts);
wb_object o(sts, orep);
return o;
}
//
......@@ -146,12 +147,12 @@ wb_object wb_object::after()
//
wb_object wb_object::before()
{
check("wb_object::before()");
check("wb_object::before()");
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->before(&sts);
wb_object o(sts, orep);
return o;
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->before(&sts);
wb_object o(sts, orep);
return o;
}
//
......@@ -159,12 +160,12 @@ wb_object wb_object::before()
//
wb_object wb_object::parent()
{
check("wb_object::parent()");
check("wb_object::parent()");
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->parent(&sts);
wb_object o(sts, orep);
return o;
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->parent(&sts);
wb_object o(sts, orep);
return o;
}
//
......@@ -172,12 +173,12 @@ wb_object wb_object::parent()
//
wb_object wb_object::first()
{
check("wb_object::first()");
check("wb_object::first()");
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->first(&sts);
wb_object o(sts, orep);
return o;
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->first(&sts);
wb_object o(sts, orep);
return o;
}
//
......@@ -185,12 +186,12 @@ wb_object wb_object::first()
//
wb_object wb_object::child( const char* name)
{
check("wb_object::child()");
check("wb_object::child()");
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->child(&sts, name);
wb_object o(sts, orep);
return o;
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->child(&sts, name);
wb_object o(sts, orep);
return o;
}
//
......@@ -198,120 +199,120 @@ wb_object wb_object::child( const char* name)
//
wb_object wb_object::last()
{
check("wb_object::last()");
check("wb_object::last()");
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->last(&sts);
wb_object o(sts, orep);
pwr_tStatus sts = LDH__SUCCESS;
wb_orep *orep = m_orep->last(&sts);
wb_object o(sts, orep);
return o;
return o;
}
pwr_tOid wb_object::oid()
{
check();
check();
return m_orep->oid();
return m_orep->oid();
}
pwr_tVid wb_object::vid()
{
check();
check();
return m_orep->vid();
return m_orep->vid();
}
pwr_tCid wb_object::cid()
{
check();
check();
return m_orep->cid();
return m_orep->cid();
}
pwr_tOix wb_object::oix()
{
check();
check();
return m_orep->oix();
return m_orep->oix();
}
pwr_tOid wb_object::poid()
{
check();
check();
return m_orep->poid();
return m_orep->poid();
}
pwr_tOid wb_object::foid()
{
check();
check();
return m_orep->foid();
return m_orep->foid();
}
pwr_tOid wb_object::loid()
{
check();
check();
return m_orep->loid();
return m_orep->loid();
}
pwr_tOid wb_object::boid()
{
check();
check();
return m_orep->boid();
return m_orep->boid();
}
pwr_tOid wb_object::aoid()
{
check();
check();
return m_orep->aoid();
return m_orep->aoid();
}
pwr_tTime wb_object::ohTime()
{
check();
check();
return m_orep->ohTime();
return m_orep->ohTime();
}
bool wb_object::operator==(wb_object& x)
{
check();
check();
return (x.m_orep == m_orep);
return (x.m_orep == m_orep);
}
wb_attribute wb_object::attribute()
{
check();
check();
pwr_tStatus sts = LDH__SUCCESS;
wb_attribute a(sts, m_orep);
pwr_tStatus sts = LDH__SUCCESS;
wb_attribute a(sts, m_orep);
return a;
return a;
}
wb_attribute wb_object::attribute(const char *aname)
{
check();
check();
pwr_tStatus sts = LDH__SUCCESS;
wb_attribute a(sts, m_orep, aname);
pwr_tStatus sts = LDH__SUCCESS;
wb_attribute a(sts, m_orep, aname);
return a;
return a;
}
wb_attribute wb_object::attribute(const char *bname, const char *aname)
{
check();
check();
pwr_tStatus sts = LDH__SUCCESS;
wb_attribute a(sts, m_orep, bname, aname);
pwr_tStatus sts = LDH__SUCCESS;
wb_attribute a(sts, m_orep, bname, aname);
return a;
return a;
}
size_t wb_object::rbSize()
......@@ -355,24 +356,24 @@ wb_bdef wb_object::bdef(pwr_eBix bix)
/* Object SigChanCon $ObjXRef 2
Body SysBody
Attr Identity = "Ai"
Attr Source = "Ai"
Attr Target = "ChanAi"
Attr SourceAttribute = "SigChanCon"
Attr TargetAttribute = "SigChanCon"
EndBody
EndObject
Body SysBody
Attr Identity = "Ai"
Attr Source = "Ai"
Attr Target = "ChanAi"
Attr SourceAttribute = "SigChanCon"
Attr TargetAttribute = "SigChanCon"
EndBody
EndObject
*/
pwr_tStatus wb_object::checkXref(const char *name)
{
//pwr_sObjXRef pobjXDef;
//wb_attribute a = attribute(name);
//pwr_sObjXRef pobjXDef;
//wb_attribute a = attribute(name);
//pwr_tOid *oidp = a.valp();
//pwr_tOid *oidp = a.valp();
//pwr_sObjXRef *oxrp = a.valp();
//pwr_sObjXRef *oxrp = a.valp();
return LDH__SUCCESS;
return LDH__SUCCESS;
}
......@@ -19,84 +19,84 @@ class wb_object : public wb_status
{
public:
wb_orep *m_orep;
wb_orep *m_orep;
wb_object();
wb_object(wb_orep*);
wb_object(pwr_tStatus, wb_orep*);
wb_object(const wb_object&);
wb_object();
wb_object(wb_orep*);
wb_object(pwr_tStatus, wb_orep*);
wb_object(const wb_object&);
~wb_object();
~wb_object();
wb_object& operator=(const wb_object&);
wb_object& operator=(const wb_object&);
operator bool() const;
operator wb_orep*() const;
bool operator==(wb_object&);
operator bool() const;
operator wb_orep*() const;
bool operator==(wb_object&);
void uniqueName(const char *) {} // Fix
void uniqueName(const char *) {} // Fix
pwr_tStatus checkXref(const char *name);
pwr_tStatus checkXref(const char *name);
void user(void *p) {} // Fix // set user data
void *user() { return 0;} // Fix // get user data
void user(void *p) {} // Fix // set user data
void *user() { return 0;} // Fix // get user data
ldh_sRefInfo *refinfo(ldh_sRefInfo *rp) { ldh_sRefInfo *r; return r;} // Fix
ldh_sRefInfo *refinfo(ldh_sRefInfo *rp) { ldh_sRefInfo *r; return r;} // Fix
pwr_tOid oid(); //< Object identifier of this object
pwr_tVid vid(); //< Volume identifier of this object
pwr_tOix oix(); //< Object index of this object
pwr_tCid cid(); //< Class identifier of class that this object is an instance of
pwr_tOid oid(); //< Object identifier of this object
pwr_tVid vid(); //< Volume identifier of this object
pwr_tOix oix(); //< Object index of this object
pwr_tCid cid(); //< Class identifier of class that this object is an instance of
pwr_tOid poid(); //< Object identifier of parent of this object
pwr_tOid foid(); //< Object identifier of first child of this object
pwr_tOid loid(); //< Object identifier of last child of this object
pwr_tOid boid(); //< Object identifier of object before this object
pwr_tOid aoid(); //< Object identifier of object after this object
pwr_tOid poid(); //< Object identifier of parent of this object
pwr_tOid foid(); //< Object identifier of first child of this object
pwr_tOid loid(); //< Object identifier of last child of this object
pwr_tOid boid(); //< Object identifier of object before this object
pwr_tOid aoid(); //< Object identifier of object after this object
pwr_tOix poix(); //< Object index of parent of this object
pwr_tOix foix(); //< Object index of first child of this object
pwr_tOix loix(); //< Object index of last child of this object
pwr_tOix boix(); //< Object index of object before this object
pwr_tOix aoix(); //< Object index of object after this object
pwr_tOix poix(); //< Object index of parent of this object
pwr_tOix foix(); //< Object index of first child of this object
pwr_tOix loix(); //< Object index of last child of this object
pwr_tOix boix(); //< Object index of object before this object
pwr_tOix aoix(); //< Object index of object after this object
const char *name();
wb_name longName();
const char *name();
wb_name longName();
pwr_tTime ohTime(); //< time when this object was last changed
pwr_tTime rbTime(); //< time when run time body of this object was last changed
pwr_tTime dbTime(); //< time when development body of this object was last changed
pwr_tTime ohTime(); //< time when this object was last changed
pwr_tTime rbTime(); //< time when run time body of this object was last changed
pwr_tTime dbTime(); //< time when development body of this object was last changed
size_t rbSize(); //< size of run time body
size_t dbSize(); //< size of development body
size_t rbSize(); //< size of run time body
size_t dbSize(); //< size of development body
wb_bdef bdef(const char* bname);
wb_bdef bdef(pwr_eBix bix);
wb_bdef bdef(const char* bname);
wb_bdef bdef(pwr_eBix bix);
wb_attribute attribute();
wb_attribute attribute(const char *aname);
wb_attribute attribute(const char *bname, const char *aname);
wb_attribute attribute();
wb_attribute attribute(const char *aname);
wb_attribute attribute(const char *bname, const char *aname);
/* Navigational operations */
/* Navigational operations */
wb_object ancestor();
wb_object parent();
wb_object after(); //< next sibling
wb_object before(); //< previous sibling
wb_object first(); //< first child
wb_object child(const char *name);
wb_object last(); //< last child
wb_object ancestor();
wb_object parent();
wb_object after(); //< next sibling
wb_object before(); //< previous sibling
wb_object first(); //< first child
wb_object child(const char *name);
wb_object last(); //< last child
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 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_location location();
wb_destination destination(ldh_eDest dest);
wb_location location();
wb_destination destination(ldh_eDest dest);
private:
bool check();
bool check(string str);
bool check();
bool check(string str);
};
......
......@@ -2,12 +2,12 @@
void wb_orep::unref()
{
if (--m_nRef == 0)
delete this;
if (--m_nRef == 0)
delete this;
}
wb_orep *wb_orep::ref()
{
m_nRef++;
return this;
m_nRef++;
return this;
}
......@@ -16,54 +16,54 @@ class wb_orep
{
protected:
wb_vrep *m_vrep;
int m_nRef;
wb_vrep *m_vrep;
int m_nRef;
public:
//virtual wb_orep(int oid) = 0;
virtual ~wb_orep() {}
//virtual wb_orep(int oid) = 0;
virtual ~wb_orep() {}
void unref();
wb_orep *ref();
void unref();
wb_orep *ref();
virtual pwr_tOid oid() const = 0;
virtual pwr_tVid vid() const = 0;
virtual pwr_tOix oix() const = 0;
virtual pwr_tOid oid() const = 0;
virtual pwr_tVid vid() const = 0;
virtual pwr_tOix oix() const = 0;
virtual pwr_tCid cid() const = 0;
virtual pwr_tOid poid() const = 0;
virtual pwr_tOid foid() const = 0;
virtual pwr_tOid loid() const = 0;
virtual pwr_tOid boid() const = 0;
virtual pwr_tOid aoid() const = 0;
virtual pwr_tCid cid() const = 0;
virtual pwr_tOid poid() const = 0;
virtual pwr_tOid foid() const = 0;
virtual pwr_tOid loid() const = 0;
virtual pwr_tOid boid() const = 0;
virtual pwr_tOid aoid() const = 0;
virtual const char * name() const = 0;
virtual wb_name longName() = 0;
virtual pwr_tTime ohTime() const = 0;
virtual const char * name() const = 0;
virtual wb_name longName() = 0;
virtual pwr_tTime ohTime() const = 0;
virtual bool isOffspringOf(const wb_orep *o) const = 0;
virtual bool isOffspringOf(const wb_orep *o) const = 0;
// Navigational operations
// Navigational operations
virtual wb_orep *ancestor(pwr_tStatus *sts) const = 0; //< get object at top of hierarchy
virtual wb_orep *parent(pwr_tStatus *sts) const = 0;
virtual wb_orep *after(pwr_tStatus *sts) const = 0; //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const = 0; //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const = 0; //< get first child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const = 0; //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const = 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 *previous(pwr_tStatus *sts) const = 0; //< get previous in list of objects of same class in one volume
virtual wb_orep *ancestor(pwr_tStatus *sts) const = 0; //< get object at top of hierarchy
virtual wb_orep *parent(pwr_tStatus *sts) const = 0;
virtual wb_orep *after(pwr_tStatus *sts) const = 0; //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const = 0; //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const = 0; //< get first child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const = 0; //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const = 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 *previous(pwr_tStatus *sts) const = 0; //< get previous in list of objects of same class in one volume
virtual wb_position position() = 0;
virtual wb_position position(ldh_eDest dest) = 0;
virtual wb_position position() = 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*, const char *aname) = 0;
virtual wb_adrep *attribute(pwr_tStatus*) = 0;
virtual wb_erep *erep() const = 0;
virtual wb_vrep *vrep() const = 0;
virtual wb_erep *erep() const = 0;
virtual wb_vrep *vrep() const = 0;
};
#endif
#include "wb_orepdb.h"
#include "wb_vrepdb.h"
wb_orepdb::~wb_orepdb()
{
}
//
// Operations declared in wb_Orep
// Operations declared in wb_orep
//
pwr_tOid wb_orepdb::oid() const
{
return m_ohead.oid;
pwr_tStatus sts;
return m_vrep->oid(&sts, (wb_orep*)this);
}
pwr_tVid wb_orepdb::vid() const
{
return m_ohead.oid.vid;
pwr_tStatus sts;
return m_vrep->vid(&sts, (wb_orep*)this);
}
pwr_tOix wb_orepdb::oix() const
{
return m_ohead.oid.oix;
pwr_tStatus sts;
return m_vrep->oix(&sts, (wb_orep*)this);
}
pwr_tOid wb_orepdb::poid() const
{
return m_ohead.poid;
pwr_tStatus sts;
return m_vrep->poid(&sts, (wb_orep*)this);
}
pwr_tOid wb_orepdb::foid() const
{
return m_ohead.foid;
pwr_tStatus sts;
return m_vrep->foid(&sts, (wb_orep*)this);
}
pwr_tOid wb_orepdb::loid() const
{
return m_ohead.loid;
pwr_tStatus sts;
return m_vrep->loid(&sts, (wb_orep*)this);
}
pwr_tOid wb_orepdb::boid() const
{
return m_ohead.boid;
pwr_tStatus sts;
return m_vrep->boid(&sts, (wb_orep*)this);
}
pwr_tOid wb_orepdb::aoid() const
{
return m_ohead.aoid;
pwr_tStatus sts;
return m_vrep->aoid(&sts, (wb_orep*)this);
}
const char * wb_orepdb::name() const
{
return m_ohead.name;
pwr_tStatus sts;
return m_vrep->objectName(&sts, (wb_orep*)this);
}
pwr_tTime wb_orepdb::ohTime() const
{
return m_ohead.time;
pwr_tStatus sts;
return m_vrep->ohTime(&sts, (wb_orep*)this);
}
bool wb_orepdb::isOffspringOf(const wb_orep *o) const
{
return true;
pwr_tStatus sts;
return m_vrep->isOffspringOf(&sts, (wb_orep*)this, o);
}
wb_orep *wb_orepdb::ancestor(pwr_tStatus *sts) const
{
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
{
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
{
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
{
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) const
{
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
{
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
{
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
{
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
{
return m_vrep->previous(sts, (wb_orep*)this);
return m_vrep->previous(sts, (wb_orep*)this);
}
wb_position wb_orepdb::position()
{
wb_position pos;
......@@ -124,7 +135,6 @@ wb_position wb_orepdb::position(ldh_eDest dest)
return pos;
}
wb_adrep *wb_orepdb::attribute(pwr_tStatus*, const char *aname)
{
return 0;
......@@ -134,4 +144,3 @@ wb_adrep *wb_orepdb::attribute(pwr_tStatus*)
{
return 0;
}
......@@ -4,83 +4,58 @@
#include "pwr.h"
#include "wb_orep.h"
#include "pwr_class.h"
typedef struct {
pwr_tTime time;
pwr_tUInt32 size;
} ldh_sBodyRef;
typedef struct {
} LdhDbBody;
typedef struct {
pwr_tOid oid; /**< object identifier */
pwr_tCid cid; /**< class identifier */
pwr_tOid poid; /**< object identifier of parent */
pwr_tObjName name; /**< name of object */
pwr_tObjName normname; /**< normalized object name. */
pwr_tTime time; /**< time of last change in object header */
pwr_tOid soid; /**< object identifier of server object. */
pwr_tOid boid; /**< object before this object. */
pwr_tOid aoid; /**< object after this object. */
pwr_tOid foid; /**< first child object. */
pwr_tOid loid; /**< last child object. */
pwr_mClassDef flags;
ldh_sBodyRef body[2]; /**< runtime body */
//dbs_sBodyRef dbody; /**< development body */
} ldh_sOhead;
#include "wb_db.h"
class wb_orepdb : wb_orep
{
friend class wb_vrepdb;
friend class wb_vrepdb;
db_sObject *m_o;
pwr_tOid m_oid;
public:
ldh_sOhead m_ohead;
wb_orepdb();
wb_orepdb(pwr_tOid oid);
~wb_orepdb();
virtual pwr_tOid oid() const;
virtual pwr_tVid vid() const;
virtual pwr_tOix oix() const;
virtual pwr_tCid cid() const;
virtual pwr_tOid poid() const;
virtual pwr_tOid foid() const;
virtual pwr_tOid loid() const;
virtual pwr_tOid boid() const;
virtual pwr_tOid aoid() const;
wb_orepdb();
wb_orepdb(pwr_tOid oid);
wb_orepdb(db_sObject *o);
~wb_orepdb();
virtual pwr_tOid oid() const;
virtual pwr_tVid vid() const;
virtual pwr_tOix oix() const;
virtual pwr_tCid cid() const;
virtual pwr_tOid poid() const;
virtual pwr_tOid foid() const;
virtual pwr_tOid loid() const;
virtual pwr_tOid boid() const;
virtual pwr_tOid aoid() const;
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual bool isOffspringOf(const wb_orep *o) const;
virtual bool isOffspringOf(const wb_orep *o) const;
// Navigational operations
virtual wb_orep *ancestor(pwr_tStatus *sts) const; //< get object at top of hierarchy
virtual wb_orep *parent(pwr_tStatus *sts) const;
virtual wb_orep *after(pwr_tStatus *sts) const; //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const; //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const; //< get first child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const; //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const; //< 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 *previous(pwr_tStatus *sts) const; //< get previous in list of objects of same class in one volume
virtual wb_position position();
virtual wb_position position(ldh_eDest dest);
virtual wb_adrep *attribute(pwr_tStatus*, const char *aname);
virtual wb_adrep *attribute(pwr_tStatus*);
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
// Navigational operations
virtual wb_orep *ancestor(pwr_tStatus *sts) const; //< get object at top of hierarchy
virtual wb_orep *parent(pwr_tStatus *sts) const;
virtual wb_orep *after(pwr_tStatus *sts) const; //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const; //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const; //< get first child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const; //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const; //< 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 *previous(pwr_tStatus *sts) const; //< get previous in list of objects of same class in one volume
virtual wb_position position();
virtual wb_position position(ldh_eDest dest);
virtual wb_adrep *attribute(pwr_tStatus*, const char *aname);
virtual wb_adrep *attribute(pwr_tStatus*);
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
};
#endif
This diff is collapsed.
......@@ -7,63 +7,63 @@
class wb_orepdbs : public wb_orep
{
dbs_sObject *m_o;
wb_vrepdbs *m_vrep;
unsigned int m_refCount;
dbs_sObject *m_o;
wb_vrepdbs *m_vrep;
unsigned int m_refCount;
friend class wb_cdrep;
friend class wb_bdrep;
friend class wb_adrep;
friend class wb_tdrep;
friend class wb_vrepdbs;
friend class wb_cdrep;
friend class wb_bdrep;
friend class wb_adrep;
friend class wb_tdrep;
friend class wb_vrepdbs;
public:
wb_orepdbs(dbs_sObject *o);
//~wb_orepdbs();
wb_orepdbs(dbs_sObject *o);
//~wb_orepdbs();
void* operator new(size_t size, wb_vrepdbs *v);
//void operator delete(void *p, wb_vrepdbs *v);
void* operator new(size_t size, wb_vrepdbs *v);
//void operator delete(void *p, wb_vrepdbs *v);
virtual pwr_tOid oid() const;
virtual pwr_tVid vid() const;
virtual pwr_tOix oix() const;
virtual pwr_tOid oid() const;
virtual pwr_tVid vid() const;
virtual pwr_tOix oix() const;
virtual pwr_tCid cid() const;
virtual pwr_tOid poid() const;
virtual pwr_tOid foid() const;
virtual pwr_tOid loid() const;
virtual pwr_tOid boid() const;
virtual pwr_tOid aoid() const;
virtual pwr_tCid cid() const;
virtual pwr_tOid poid() const;
virtual pwr_tOid foid() const;
virtual pwr_tOid loid() const;
virtual pwr_tOid boid() const;
virtual pwr_tOid aoid() const;
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual bool isOffspringOf(const wb_orep *o) const;
virtual bool isOffspringOf(const wb_orep *o) const;
// Navigational operations
// Navigational operations
virtual wb_orep *ancestor(pwr_tStatus *sts) const; //< get object at top of hierarchy
virtual wb_orep *parent(pwr_tStatus *sts) const;
virtual wb_orep *after(pwr_tStatus *sts) const; //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const; //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const; //< get first child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const; //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const; //< 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 *previous(pwr_tStatus *sts) const; //< get previous in list of objects of same class in one volume
virtual wb_orep *ancestor(pwr_tStatus *sts) const; //< get object at top of hierarchy
virtual wb_orep *parent(pwr_tStatus *sts) const;
virtual wb_orep *after(pwr_tStatus *sts) const; //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const; //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const; //< get first child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const; //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const; //< 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 *previous(pwr_tStatus *sts) const; //< get previous in list of objects of same class in one volume
virtual wb_position position();
virtual wb_position position(ldh_eDest dest);
virtual wb_position position();
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*, const char *aname);
virtual wb_adrep *attribute(pwr_tStatus*);
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
dbs_sObject *o() const { return m_o;}
dbs_sObject *o() const { return m_o;}
};
......
......@@ -70,7 +70,7 @@ pwr_tOid wb_orepwbl::aoid() const
const char * wb_orepwbl::name() const
{
return m_wblnode->name();
return m_wblnode->name();
}
wb_name wb_orepwbl::longName()
......@@ -84,59 +84,59 @@ wb_name wb_orepwbl::longName()
pwr_tTime wb_orepwbl::ohTime() const
{
return m_wblnode->getFileTime();
return m_wblnode->getFileTime();
}
bool wb_orepwbl::isOffspringOf(const wb_orep *o) const
{
return true;
return true;
}
wb_orep *wb_orepwbl::ancestor(pwr_tStatus *sts) const
{
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
{
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
{
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
{
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
{
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
{
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
{
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
{
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
{
return m_vrep->previous(sts, (wb_orep *)this);
return m_vrep->previous(sts, (wb_orep *)this); //
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -13,28 +13,28 @@ class wb_orep;
class wb_tdef : public wb_status
{
public:
wb_tdrep *m_tdrep;
wb_tdrep *m_tdrep;
wb_tdef();
wb_tdef( wb_tdrep *tdrep);
wb_tdef( wb_adef&);
wb_tdef(wb_mvrep *, pwr_tTid);
wb_tdef(const wb_tdef&);
wb_tdef& operator=(const wb_tdef&);
~wb_tdef();
operator bool() const { return m_tdrep != 0;}
operator wb_tdrep*() const;
bool operator==(wb_tdef&);
wb_tdef();
wb_tdef( wb_tdrep *tdrep);
wb_tdef( wb_adef&);
wb_tdef(wb_mvrep *, pwr_tTid);
wb_tdef(const wb_tdef&);
wb_tdef& operator=(const wb_tdef&);
~wb_tdef();
operator bool() const { return m_tdrep != 0;}
operator wb_tdrep*() const;
bool operator==(wb_tdef&);
size_t size();
pwr_tTid tid();
int nElement();
const char *name() const;
wb_name longName();
size_t size();
pwr_tTid tid();
int nElement();
const char *name() const;
wb_name longName();
private:
void check() const;
private:
void check() const;
};
#endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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