Commit eeec0970 authored by lw's avatar lw

*** empty log message ***

parent 4e76c27e
......@@ -228,7 +228,7 @@ typedef union {
typedef struct {
pwr_tOid Objid;
pwr_tClassId Body;
pwr_tCid Body;
pwr_tUInt32 Offset;
pwr_tUInt32 Size;
pwr_mAttrRef Flags;
......@@ -250,6 +250,10 @@ static const pwr_tClassId pwr_cNClassId = 0;
static const pwr_tTypeId pwr_cNTypeId = 0;
static const pwr_tVolumeId pwr_cNVolumeId = 0;
static const pwr_tNodeId pwr_cNNodeId = 0;
static const pwr_tCid pwr_cNCid = 0;
static const pwr_tTid pwr_cNTid = 0;
static const pwr_tVid pwr_cNVid = 0;
static const pwr_tNid pwr_cNNid = 0;
/* Gereral macro definitions */
......
......@@ -68,7 +68,8 @@ typedef struct {
unsigned int vid_3 : 8;
#endif
} cdh_mObjid;
} cdh_mOid;
typedef cdh_mOid cdh_mObjid;
typedef struct {
unsigned int rix : 32;
......@@ -88,7 +89,8 @@ typedef struct {
unsigned int vid_3 : 8;
#endif
} cdh_mRefId;
} cdh_mRid;
typedef cdh_mRid cdh_mRefId;
typedef struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -106,7 +108,8 @@ typedef struct {
unsigned int vid_3 : 8;
#endif
} cdh_mVolumeId;
} cdh_mVid;
typedef cdh_mVid cdh_mVolumeId;
typedef struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -124,7 +127,8 @@ typedef struct {
unsigned int nid_3 : 8;
#endif
} cdh_mNodeId;
} cdh_mNid;
typedef cdh_mNid cdh_mNodeId;
typedef struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -176,7 +180,8 @@ typedef struct {
unsigned int vid_1 : 8;
#endif
} cdh_mClassId;
} cdh_mCid;
typedef cdh_mCid cdh_mClassId;
typedef struct {
#if (pwr_dHost_byteOrder == pwr_dBigEndian)
......@@ -228,35 +233,41 @@ typedef struct {
unsigned int vid_1 : 8;
#endif
} cdh_mTypeId;
} cdh_mTid;
typedef cdh_mTid cdh_mTypeId;
typedef union {
pwr_tObjid pwr;
pwr_tOid pwr;
cdh_mObjid o;
cdh_mClassObjid c;
cdh_mTypeObjid t;
} cdh_uObjid;
} cdh_uOid;
typedef cdh_uOid cdh_uObjid;
typedef union {
pwr_tRefId pwr;
cdh_mRefId r;
} cdh_uRefId;
pwr_tRid pwr;
cdh_mRid r;
} cdh_uRid;
typedef cdh_uRid cdh_uRefId;
typedef union {
pwr_tClassId pwr;
cdh_mClassId c;
cdh_mTypeId t;
} cdh_uTypeId;
pwr_tCid pwr;
cdh_mCid c;
cdh_mTid t;
} cdh_uTid;
typedef cdh_uTid cdh_uTypeId;
typedef union {
pwr_tVolumeId pwr;
cdh_mVolumeId v;
} cdh_uVolumeId;
pwr_tVid pwr;
cdh_mVid v;
} cdh_uVid;
typedef cdh_uVid cdh_uVolumeId;
typedef union {
pwr_tNodeId pwr;
cdh_mNodeId n;
} cdh_uNodeId;
pwr_tNid pwr;
cdh_mNid n;
} cdh_uNid;
typedef cdh_uNid cdh_uNodeId;
typedef enum {
cdh_eId__ = 0,
......@@ -272,11 +283,11 @@ typedef enum {
} cdh_eId;
typedef union {
pwr_tObjectIx oix;
pwr_tObjid oid;
pwr_tClassId cid;
pwr_tVolumeId vid;
pwr_tTypeId tid;
pwr_tOix oix;
pwr_tOid oid;
pwr_tCid cid;
pwr_tVid vid;
pwr_tTid tid;
pwr_tSubid sid;
pwr_tDlid did;
pwr_sAttrRef aref;
......@@ -311,7 +322,7 @@ typedef struct {
typedef struct {
cdh_sObjName name;
pwr_tObjid poid;
pwr_tOid poid;
} cdh_sFamily;
typedef union {
......@@ -527,14 +538,14 @@ typedef union {
} cdh_mName;
typedef struct {
pwr_tObjid poid; /* Parent objid, or NOBJID */
pwr_tOid poid; /* Parent objid, or NOBJID */
cdh_mParseName parseFlags;
cdh_mName flags;
void *ohp;
cdh_eId eId;
cdh_uId uId;
pwr_tTypeId bid;
pwr_tTid bid;
pwr_tUInt32 index;
pwr_tUInt32 offset;
pwr_tUInt32 size;
......@@ -550,30 +561,30 @@ typedef struct {
int
cdh_ObjidCompare (
pwr_tObjid Object_1,
pwr_tObjid Object_2
pwr_tOid Object_1,
pwr_tOid Object_2
);
int
cdh_ObjidIsEqual (
pwr_tObjid Object_1,
pwr_tObjid Object_2
pwr_tOid Object_1,
pwr_tOid Object_2
);
int
cdh_ObjidIsNotEqual (
pwr_tObjid Object_1,
pwr_tObjid Object_2
pwr_tOid Object_1,
pwr_tOid Object_2
);
int
cdh_ObjidIsNull (
pwr_tObjid Object
pwr_tOid Object
);
int
cdh_ObjidIsNotNull (
pwr_tObjid Object
pwr_tOid Object
);
int
......@@ -660,29 +671,29 @@ cdh_DlidIsNotNull (
pwr_tDlid DirectLink
);
pwr_tClassId
pwr_tCid
cdh_ClassObjidToId (
pwr_tObjid Object
pwr_tOid Object
);
pwr_tObjid
pwr_tOid
cdh_ClassIdToObjid (
pwr_tClassId Class
pwr_tCid Class
);
pwr_tTypeId
pwr_tTid
cdh_TypeObjidToId (
pwr_tObjid Object
pwr_tOid Object
);
int
cdh_TypeIdToIndex (
pwr_tTypeId Type
pwr_tTid Type
);
pwr_tObjid
pwr_tOid
cdh_TypeIdToObjid (
pwr_tTypeId Type
pwr_tTid Type
);
pwr_tStatus
......@@ -703,31 +714,31 @@ cdh_StringToAttrValue (
pwr_tStatus
cdh_StringToClassId (
const char *s,
pwr_tClassId *cid
pwr_tCid *cid
);
pwr_tStatus
cdh_StringToTypeId (
const char *s,
pwr_tTypeId *tid
pwr_tTid *tid
);
pwr_tStatus
cdh_StringToVolumeId (
const char *s,
pwr_tVolumeId *tid
pwr_tVid *tid
);
pwr_tStatus
cdh_StringToObjectIx (
const char *s,
pwr_tObjectIx *oix
pwr_tOix *oix
);
pwr_tStatus
cdh_StringToObjid (
const char *s,
pwr_tObjid *oix
pwr_tOid *oid
);
pwr_tStatus
......@@ -745,21 +756,21 @@ cdh_StringToDlid (
char *
cdh_ClassIdToString (
char *s,
pwr_tClassId cid,
pwr_tCid cid,
int prefix
);
char *
cdh_ObjectIxToString (
char *s,
pwr_tObjectIx oix,
pwr_tOix oix,
int prefix
);
char *
cdh_ObjidToString (
char *s,
pwr_tObjid oid,
pwr_tOid oid,
int prefix
);
......@@ -773,25 +784,21 @@ cdh_ArefToString (
char *
cdh_NodeIdToString (
char *s,
pwr_tNodeId nid,
pwr_tNid nid,
int prefix,
int suffix
);
char *
cdh_TypeIdToString (
char *s,
pwr_tTypeId tid,
int prefix
);
cdh_TypeIdToString(char *s, pwr_tTid tid, int prefix);
char *
cdh_VolumeIdToString (
char *s,
pwr_tVolumeId vid,
pwr_tVid vid,
int prefix,
int suffix
);
);
char *
cdh_SubidToString (
......@@ -811,7 +818,7 @@ cdh_sFamily *
cdh_Family (
cdh_sFamily *f,
const char *name,
pwr_tObjid poid
pwr_tOid poid
);
cdh_sObjName *
......@@ -829,7 +836,7 @@ cdh_sParseName *
cdh_ParseName (
pwr_tStatus *sts,
cdh_sParseName *pn,
pwr_tObjid poid,
pwr_tOid poid,
const char *name,
pwr_tUInt32 flags
);
......
This diff is collapsed.
......@@ -49,7 +49,7 @@
% | Information about volumes mounted in this volume. |
% | |
% +====================================================+
% | Oix (Object index) Section |
% | Oid (Object identity) Section |
% +----------------------------------------------------+
% | |
% | |
......@@ -162,7 +162,7 @@
%#define dbs_cAlignInc 7
%#define dbs_dAlign(size) (((size) + dbs_cAlignInc) & ~dbs_cAlignInc)
%#define dbs_dPadding(size) ((((size) + dbs_cAlignInc) & ~dbs_cAlignInc) - (size))
%#define dbs_dMakeRef(sect, offset) (0 & ((sect) << dbs_cOffsBits) & (offset))
%#define dbs_dMakeRef(sect, offset) (0 | ((sect) << dbs_cOffsBits) | (offset))
%
%typedef union {
% struct {
......@@ -175,6 +175,7 @@
%pwr_tBoolean
%pdr_dbs_uRefBits(PDR *pdrs, dbs_uRefBits *objp);
%
%
#endif
struct dbs_sQlink {
......@@ -189,9 +190,9 @@ enum dbs_eSect {
dbs_eSect_dir = 0,
dbs_eSect_volume = 1,
dbs_eSect_volref = 2,
dbs_eSect_oid = 3,
dbs_eSect_object = 4,
dbs_eSect_rbody = 5,
dbs_eSect_oix = 3,
dbs_eSect_name = 6,
dbs_eSect_dbody = 8,
dbs_eSect_class = 10,
......@@ -202,7 +203,7 @@ enum dbs_eSect {
#ifdef PDR_HDR
%#define dbs_mSect_volume pwr_Bit(dbs_eSect_volume)
%#define dbs_mSect_volref pwr_Bit(dbs_eSect_volref)
%#define dbs_mSect_oix pwr_Bit(dbs_eSect_oix)
%#define dbs_mSect_oid pwr_Bit(dbs_eSect_oid)
%#define dbs_mSect_object pwr_Bit(dbs_eSect_object)
%#define dbs_mSect_rbody pwr_Bit(dbs_eSect_rbody)
%#define dbs_mSect_name pwr_Bit(dbs_eSect_name)
......@@ -285,6 +286,12 @@ enum dbs_eFile {
%
#endif
struct dbs_sBintab {
dbs_tRef start;
dbs_tRef end;
pwr_tUInt32 rsize;
};
#ifdef PDR_HDR
%/**
% * @note You can't use pdr_dbs_sFile directly due to the format member.
......@@ -342,6 +349,10 @@ struct dbs_sVolume {
pwr_tTime time; /**< time at which this load file was created */
pwr_tUInt32 cardinality; /**< number objects in this volume */
pwr_tUInt32 rbodySize;
dbs_sBintab name_bt; /**< search for object with parent and name */
dbs_sBintab oid_bt; /**< search for object with identity */
dbs_sBintab class_bt; /**< search for object with class */
};
/**
......@@ -364,19 +375,19 @@ struct dbs_sVolRef {
/**
* Object Index (oix) Section.
* Object Identity (oid) Section.
*
* Layout of an object index table entry.
* Oix entries are stored in oix-sect.
* Used to find an object with object index as key.
* Layout of an object identity table entry.
* Oid entries are stored in oid-sect.
* Used to find an object with object identity as key.
* Table lookup mechanism is binary lookup.
*/
#ifdef PDR_HDR
%#define dbs_cVersionOix 1
%#define dbs_cVersionOid 1
#endif
struct dbs_sOix {
pwr_tOix oix; /**< Object index */
struct dbs_sOid {
pwr_tOid oid; /**< Object identity */
dbs_tRef ref; /**< Address, section relative, to object in object section */
};
......@@ -400,12 +411,6 @@ struct dbs_sOlink {
pwr_tOix succ;
};
struct dbs_sBintab {
dbs_tRef start;
dbs_tRef end;
pwr_tUInt32 rsize;
};
struct dbs_sObject {
pwr_tOid oid; /**< object identifier */
pwr_tCid cid; /**< class identifier */
......@@ -442,6 +447,7 @@ struct dbs_sObject {
struct dbs_sClass {
pwr_tCid cid; /**< class identifier */
pwr_tUInt32 nObjects;
dbs_sQlink o_lh; /**< root of list of all object
of this class within this volume */
};
......@@ -506,7 +512,7 @@ struct dbs_sName {
% FILE *f;
% dbs_sFile file;
% pwr_tUInt32 nSect;
% dbs_sSect sect[dbs_eSect_];
% dbs_sSect *sect;
%
% /* the rest is used only if mapped */
% pwr_tUInt32 size; /**< size of mapped file */
......@@ -518,37 +524,51 @@ struct dbs_sName {
%#define dbs_Qitem(a, b, c) ((b *)((char *)a - offsetof(b, c)))
%#define dbs_Qlink(a, b, c) ((dbs_sQlink *)((char *)a + offsetof(b, c)))
%
%void *dbs_Address(pwr_tStatus*, dbs_sEnv*, dbs_tRef);
%void *dbs_Alloc(pwr_tStatus*, dbs_sEnv*, pwr_tUInt32);
%pwr_tBoolean dbs_AllocLookasideSegment(pwr_tStatus*, dbs_sEnv*, pwr_tUInt32, pwr_tUInt32);
%void *dbs_AllocNamedSegment(pwr_tStatus*, dbs_sEnv*, pwr_tUInt32, char*);
%void *dbs_Address(pwr_tStatus*, const dbs_sEnv*, dbs_tRef);
%void *dbs_Alloc(pwr_tStatus*, const dbs_sEnv*, pwr_tUInt32);
%pwr_tBoolean dbs_AllocLookasideSegment(pwr_tStatus*, const dbs_sEnv*, pwr_tUInt32, pwr_tUInt32);
%void *dbs_AllocNamedSegment(pwr_tStatus*, const dbs_sEnv*, pwr_tUInt32, char*);
%dbs_sEnv *dbs_Create(pwr_tStatus*, dbs_sEnv*, char*, pwr_tUInt32, pwr_tUInt32);
%void dbs_Dump(pwr_tStatus*, dbs_sEnv*);
%pwr_tBoolean dbs_Free(pwr_tStatus*, dbs_sEnv*, void*);
%pwr_tBoolean dbs_FreeReference(pwr_tStatus*, dbs_sEnv*, dbs_tRef);
%dbs_tRef dbs_InDbs(pwr_tStatus*, dbs_sEnv*, void*, pwr_tUInt32);
%dbs_tRef dbs_ItemReference(pwr_tStatus*, dbs_sEnv*, void*);
%dbs_sQlink *dbs_Qalloc(pwr_tStatus*, dbs_sEnv*);
%pwr_tBoolean dbs_QhasOne(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*);
%void dbs_Dump(pwr_tStatus*, const dbs_sEnv*);
%pwr_tBoolean dbs_Free(pwr_tStatus*, const dbs_sEnv*, void*);
%pwr_tBoolean dbs_FreeReference(pwr_tStatus*, const dbs_sEnv*, dbs_tRef);
%dbs_tRef dbs_InDbs(pwr_tStatus*, const dbs_sEnv*, void*, pwr_tUInt32);
%dbs_tRef dbs_ItemReference(pwr_tStatus*, const dbs_sEnv*, void*);
%dbs_sQlink *dbs_Qalloc(pwr_tStatus*, const dbs_sEnv*);
%pwr_tBoolean dbs_QhasOne(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*);
%dbs_tRef dbs_Qinit(pwr_tStatus*, dbs_sQlink*, dbs_tRef);
%dbs_sQlink *dbs_Qinsert(pwr_tStatus*, dbs_sQlink*, dbs_sQlink*, dbs_sQlink*);
%dbs_sQlink *dbs_QinsertPred(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*, dbs_sQlink*);
%dbs_sQlink *dbs_QinsertSucc(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*, dbs_sQlink*);
%pwr_tBoolean dbs_QisEmpty(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*);
%pwr_tBoolean dbs_QisLinked(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*);
%pwr_tBoolean dbs_QisNull(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*);
%dbs_sQlink *dbs_Qmove(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*, dbs_sQlink*);
%dbs_sQlink *dbs_Qpred(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*);
%dbs_sQlink *dbs_Qremove(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*);
%dbs_sQlink *dbs_QremovePred(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*);
%dbs_sQlink *dbs_QremoveSucc(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*);
%dbs_sQlink *dbs_Qsucc(pwr_tStatus*, dbs_sEnv*, dbs_sQlink*);
%dbs_tRef dbs_RefAlloc(pwr_tStatus*, dbs_sEnv*, pwr_tUInt32);
%dbs_tRef dbs_Reference(pwr_tStatus*, dbs_sEnv*, void*);
%
%pwr_tBoolean dbs_AlignedRead(pwr_tStatus *sts, void *buf, pwr_tUInt32 size, dbs_sEnv *ep);
%dbs_sQlink *dbs_QinsertPred(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*, dbs_sQlink*);
%dbs_sQlink *dbs_QinsertSucc(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*, dbs_sQlink*);
%pwr_tBoolean dbs_QisEmpty(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*);
%pwr_tBoolean dbs_QisLinked(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*);
%pwr_tBoolean dbs_QisNull(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*);
%dbs_sQlink *dbs_Qmove(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*, dbs_sQlink*);
%dbs_sQlink *dbs_Qpred(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*);
%dbs_sQlink *dbs_Qremove(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*);
%dbs_sQlink *dbs_QremovePred(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*);
%dbs_sQlink *dbs_QremoveSucc(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*);
%dbs_sQlink *dbs_Qsucc(pwr_tStatus*, const dbs_sEnv*, dbs_sQlink*);
%dbs_tRef dbs_RefAlloc(pwr_tStatus*, const dbs_sEnv*, pwr_tUInt32);
%dbs_tRef dbs_Reference(pwr_tStatus*, const dbs_sEnv*, void*);
%
%pwr_tBoolean dbs_AlignedRead(pwr_tStatus *sts, void *buf, pwr_tUInt32 size, const dbs_sEnv *ep);
%pwr_tBoolean dbs_Close(pwr_tStatus *sts, dbs_sEnv *ep);
%dbs_sEnv *dbs_Open(pwr_tStatus *sts, dbs_sEnv *ep, const char *filename);
%dbs_sEnv *dbs_Map(pwr_tStatus *sts, dbs_sEnv *ep, const char *filename);
%
%dbs_sObject *dbs_OidToObject(pwr_tStatus *sts, const dbs_sEnv *ep, pwr_tOid oid);
%dbs_sObject *dbs_NameToObject(pwr_tStatus *sts, const dbs_sEnv *ep, pwr_tOid oid, char *name);
%dbs_sObject *dbs_Parent(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op);
%dbs_sObject *dbs_After(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op);
%dbs_sObject *dbs_Before(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op);
%dbs_sObject *dbs_First(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op);
%dbs_sObject *dbs_Last(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op);
%dbs_sObject *dbs_ClassToObject(pwr_tStatus *sts, const dbs_sEnv *ep, pwr_tCid cid);
%dbs_sObject *dbs_Next(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op);
%dbs_sObject *dbs_Previous(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op);
%dbs_sObject *dbs_Child(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op, char *name);
%dbs_sObject *dbs_Ancestor(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op);
%
%
%#ifdef __cplusplus
......
......@@ -4,7 +4,6 @@
#include "pwr.h"
#include "wb_orep.h"
#include "wb_object.h"
#include "co_dbs.h"
#include "wb_name.h"
class wb_adef;
......
......@@ -3,7 +3,6 @@
#include "pwr.h"
#include "pwr_class.h"
#include "co_dbs.h"
#include "wb_name.h"
#include "wb_orep.h"
......
This diff is collapsed.
......@@ -31,6 +31,7 @@ struct sOentry {
dbs_sBody dbody;
mOentry flags;
dbs_tRef ref;
dbs_tRef oidref;
sOentry *poep;
sOentry *boep;
......@@ -46,12 +47,14 @@ struct sOentry {
struct sNentry {
tree_sNode node;
dbs_sName n;
dbs_tRef ref;
sOentry *oep;
};
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
};
......@@ -73,9 +76,16 @@ public:
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;
sOentry *m_oep; /* object entry of volume object */
tree_sTable *m_oix_th;
tree_sTable *m_oid_th;
tree_sTable *m_name_th;
tree_sTable *m_class_th;
......@@ -92,6 +102,7 @@ public:
void buildFile();
void buildSectName();
void buildSectOid();
void buildSectClass();
void checkObject(sOentry *oep);
pwr_tStatus closeFile(pwr_tBoolean doDelete);
......@@ -110,7 +121,7 @@ public:
pwr_tStatus writeSectDirectory();
pwr_tStatus writeSectVolume();
pwr_tStatus writeSectVolref();
pwr_tStatus writeSectOix();
pwr_tStatus writeSectOid();
pwr_tStatus writeSectObject();
pwr_tStatus writeSectRbody();
pwr_tStatus writeSectName();
......
......@@ -3,17 +3,18 @@
#include "wb_ldh_msg.h"
#include "wb_error.h"
/*
void * wb_orepdbs::operator new(size_t size, wb_vrepdbs *v)
void *
wb_orepdbs::operator new(size_t size, wb_vrepdbs *v)
{
return v->newOrepDbs(size);
return (void *)v->new_wb_repdbs(size);
}
void wb_orepdbs::operator delete(size_t size, void *p, wb_vrepdbs *v)
void
wb_orepdbs::operator delete(void *p, size_t size, wb_vrepdbs *v)
{
v->deleteOrepDbs(size, p);
v->delete_wb_orepdbs(size, p);
}
*/
wb_orepdbs::wb_orepdbs(dbs_sObject *o)
{
......@@ -74,44 +75,50 @@ char * const wb_orepdbs::name()
wb_orep *wb_orepdbs::after(pwr_tStatus *sts) const
{
dbs_sQlink *succ = dbs_Qsucc(sts, m_vrep->m_dbsenv, &m_o->sib_ll);
if (succ == 0)
return 0;
return new (m_vrep) wb_orepdbs(dbs_Qitem(succ, dbs_sObject, sib_ll));
return m_vrep->after(sts, (wb_orep*)this);
}
wb_orep *wb_orepdbs::before(pwr_tStatus *sts) const
{
dbs_sQlink *pred = dbs_Qpred(sts, m_vrep->m_dbsenv, &m_o->sib_ll);
if (pred == 0)
return 0;
return new (m_vrep) wb_orepdbs(dbs_Qitem(pred, dbs_sObject, sib_ll));
return m_vrep->before(sts, (wb_orep*)this);
}
wb_orep *wb_orepdbs::parent(pwr_tStatus *sts) const
{
if (m_o->pref == dbs_cNref) {
*sts = LDH__NO_PARENT;
return 0;
}
return m_vrep->parent(sts, (wb_orep*)this);
}
dbs_sObject *dbs_o = (dbs_sObject*)dbs_Address(sts, m_vrep->m_dbsenv, m_o->pref);
if (dbs_o == 0) {
return 0;
}
wb_orep *wb_orepdbs::first(pwr_tStatus *sts) const
{
return m_vrep->first(sts, (wb_orep*)this);
}
wb_orep *wb_orepdbs::child(pwr_tStatus *sts, char *name) const
{
return m_vrep->child(sts, (wb_orep*)this, name);
}
wb_orep *wb_orepdbs::last(pwr_tStatus *sts) const
{
return m_vrep->last(sts, (wb_orep*)this);
}
return new (m_vrep) wb_orepdbs(dbs_o);
wb_orep *wb_orepdbs::next(pwr_tStatus *sts) const
{
return m_vrep->next(sts, (wb_orep*)this);
}
wb_orep *wb_orepdbs::previous(pwr_tStatus *sts) const
{
return m_vrep->previous(sts, (wb_orep*)this);
}
wb_adrep *attribute(pwr_tStatus *sts)
wb_adrep *wb_orepdbs::attribute(pwr_tStatus *sts)
{
return 0;;
}
wb_adrep *attribute(pwr_tStatus *sts, const char *name)
wb_adrep *wb_orepdbs::attribute(pwr_tStatus *sts, const char *name)
{
return 0;//m_vrep->attribute(sts, cid(), name);
}
......@@ -22,8 +22,8 @@ public:
wb_orepdbs(dbs_sObject *o);
~wb_orepdbs();
// void* operator new(size_t size, wb_vrepdbs *v);
// void operator delete(void *p, size_t size, wb_vrepdbs *v);
void* operator new(size_t size, wb_vrepdbs *v);
void operator delete(void *p, size_t size, wb_vrepdbs *v);
virtual pwr_tOid oid() const;
virtual pwr_tVid vid() const;
......@@ -63,6 +63,8 @@ public:
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
dbs_sObject *o() const { return m_o;}
};
#endif
......@@ -62,23 +62,23 @@ public:
virtual bool writeBody() = 0;
virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o) const = 0;
virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o) = 0;
virtual wb_orep *parent(pwr_tStatus *sts, wb_orep *o) const = 0;
virtual wb_orep *parent(pwr_tStatus *sts, wb_orep *o) = 0;
virtual wb_orep *after(pwr_tStatus *sts, wb_orep *o) const = 0;
virtual wb_orep *after(pwr_tStatus *sts, wb_orep *o) = 0;
virtual wb_orep *before(pwr_tStatus *sts, wb_orep *o) const = 0;
virtual wb_orep *before(pwr_tStatus *sts, wb_orep *o) = 0;
virtual wb_orep *first(pwr_tStatus *sts, wb_orep *o) const = 0;
virtual wb_orep *first(pwr_tStatus *sts, wb_orep *o) = 0;
virtual wb_orep *child(pwr_tStatus *sts, wb_orep *o, char *name) const = 0;
virtual wb_orep *child(pwr_tStatus *sts, wb_orep *o, char *name) = 0;
virtual wb_orep *last(pwr_tStatus *sts, wb_orep *o) const = 0;
virtual wb_orep *last(pwr_tStatus *sts, wb_orep *o) = 0;
virtual wb_orep *next(pwr_tStatus *sts, wb_orep *o) const = 0;
virtual wb_orep *next(pwr_tStatus *sts, wb_orep *o) = 0;
virtual wb_orep *previous(pwr_tStatus *sts, wb_orep *o) const = 0;
virtual wb_orep *previous(pwr_tStatus *sts, wb_orep *o) = 0;
virtual wb_srep *newSession() = 0;
......
......@@ -13,18 +13,44 @@ wb_vrep *wb_vrepdbs::ref()
return this;
}
wb_vrepdbs::wb_vrepdbs()
#if 1
wb_vrepdbs::wb_vrepdbs(const char *fileName)
{
pwr_tStatus sts;
dbs_sEnv *ep =dbs_Map(&sts, &m_dbsenv, fileName);
if (!ep)
ep = 0;
}
wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, pwr_tOid oid)
{
//wb_orepdbs *o = new wb_orepdbs();
dbs_sObject *op = dbs_OidToObject(sts, &m_dbsenv, oid);
if (op == 0)
return 0;
return new (this) wb_orepdbs(op);
}
wb_orep *wb_vrepdbs::object(pwr_tStatus *sts, wb_orep *parent, wb_name name)
{
#if 0
dbs_sName n;
n.poix = parent->oix();
strcpy(n.normname, name.normName(cdh_mName_object));
dbs_sName *nrp = dbs_Bfind(&sts, &m_dbsenv, m_dbs.name_bt, &n, dbs_CompName);
if (!nrp)
return 0;
dbs_Object *o = dbs_Address(&sts, &m_dbsenv, nrp->ref);
if (!o)
return 0;
return new (this) orepdbs(o);
#endif
return 0;
}
......@@ -108,57 +134,93 @@ bool wb_vrepdbs::writeBody()
}
wb_orep *wb_vrepdbs::ancestor(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepdbs::ancestor(pwr_tStatus *sts, wb_orep *o)
{
dbs_sObject *op = dbs_Ancestor(sts, &m_dbsenv, ((wb_orepdbs *)o)->o());
if (op == 0)
return 0;
return new (this) wb_orepdbs(op);
}
wb_orep *wb_vrepdbs::parent(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepdbs::parent(pwr_tStatus *sts, wb_orep *o)
{
dbs_sObject *op = dbs_Parent(sts, &m_dbsenv, ((wb_orepdbs *)o)->o());
if (op == 0)
return 0;
return new (this) wb_orepdbs(op);
}
wb_orep *wb_vrepdbs::after(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepdbs::after(pwr_tStatus *sts, wb_orep *o)
{
dbs_sObject *op = dbs_After(sts, &m_dbsenv, ((wb_orepdbs *)o)->o());
if (op == 0)
return 0;
return new (this) wb_orepdbs(op);
}
wb_orep *wb_vrepdbs::before(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepdbs::before(pwr_tStatus *sts, wb_orep *o)
{
dbs_sObject *op = dbs_Before(sts, &m_dbsenv, ((wb_orepdbs *)o)->o());
if (op == 0)
return 0;
return new (this) wb_orepdbs(op);
}
wb_orep *wb_vrepdbs::first(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepdbs::first(pwr_tStatus *sts, wb_orep *o)
{
dbs_sObject *op = dbs_First(sts, &m_dbsenv, ((wb_orepdbs *)o)->o());
if (op == 0)
return 0;
return new (this) wb_orepdbs(op);
}
wb_orep *wb_vrepdbs::child(pwr_tStatus *sts, wb_orep *o, char *name) const
wb_orep *wb_vrepdbs::child(pwr_tStatus *sts, wb_orep *o, char *name)
{
dbs_sObject *op = dbs_Child(sts, &m_dbsenv, ((wb_orepdbs *)o)->o(), name);
if (op == 0)
return 0;
return new (this) wb_orepdbs(op);
}
wb_orep *wb_vrepdbs::last(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepdbs::last(pwr_tStatus *sts, wb_orep *o)
{
dbs_sObject *op = dbs_Last(sts, &m_dbsenv, ((wb_orepdbs *)o)->o());
if (op == 0)
return 0;
return new (this) wb_orepdbs(op);
}
wb_orep *wb_vrepdbs::next(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepdbs::next(pwr_tStatus *sts, wb_orep *o)
{
dbs_sObject *op = dbs_Next(sts, &m_dbsenv, ((wb_orepdbs *)o)->o());
if (op == 0)
return 0;
return new (this) wb_orepdbs(op);
}
wb_orep *wb_vrepdbs::previous(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepdbs::previous(pwr_tStatus *sts, wb_orep *o)
{
dbs_sObject *op = dbs_Previous(sts, &m_dbsenv, ((wb_orepdbs *)o)->o());
if (op == 0)
return 0;
return new (this) wb_orepdbs(op);
}
......@@ -166,3 +228,4 @@ wb_srep *wb_vrepdbs::newSession()
{
return (wb_srep*)0;
}
#endif
......@@ -16,10 +16,10 @@ public:
unsigned int m_nSession;
unsigned int m_nRef;
dbs_sEnv *m_dbsenv;
dbs_sEnv m_dbsenv;
wb_vrepdbs();
wb_vrepdbs(const char *fileName);
virtual void unref();
virtual wb_vrep *ref();
......@@ -54,28 +54,31 @@ public:
virtual bool writeBody();
virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o) const;
virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o);
virtual wb_orep *parent(pwr_tStatus *sts, wb_orep *o) const;
virtual wb_orep *parent(pwr_tStatus *sts, wb_orep *o);
virtual wb_orep *after(pwr_tStatus *sts, wb_orep *o) const;
virtual wb_orep *after(pwr_tStatus *sts, wb_orep *o);
virtual wb_orep *before(pwr_tStatus *sts, wb_orep *o) const;
virtual wb_orep *before(pwr_tStatus *sts, wb_orep *o);
virtual wb_orep *first(pwr_tStatus *sts, wb_orep *o) const;
virtual wb_orep *first(pwr_tStatus *sts, wb_orep *o);
virtual wb_orep *child(pwr_tStatus *sts, wb_orep *o, char *name) const;
virtual wb_orep *child(pwr_tStatus *sts, wb_orep *o, char *name);
virtual wb_orep *last(pwr_tStatus *sts, wb_orep *o) const;
virtual wb_orep *last(pwr_tStatus *sts, wb_orep *o);
virtual wb_orep *next(pwr_tStatus *sts, wb_orep *o) const;
virtual wb_orep *next(pwr_tStatus *sts, wb_orep *o);
virtual wb_orep *previous(pwr_tStatus *sts, wb_orep *o) const;
virtual wb_orep *previous(pwr_tStatus *sts, wb_orep *o);
virtual wb_srep *newSession();
virtual bool isLocal(wb_orep *o) const;
virtual bool isLocal(wb_orep *o);
virtual pwr_tVid vid() const;
wb_orepdbs *new_wb_repdbs(size_t size);
void delete_wb_orepdbs(size_t size, void *p);
};
#endif
......@@ -927,7 +927,7 @@ wb_orep *wb_vrepwbl::object(pwr_tStatus *sts)
return orep;
}
wb_orep *wb_vrepwbl::ancestor(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepwbl::ancestor(pwr_tStatus *sts, wb_orep *o)
{
wb_orepwbl *orep = 0;
......@@ -941,7 +941,7 @@ wb_orep *wb_vrepwbl::ancestor(pwr_tStatus *sts, wb_orep *o) const
return orep;
}
wb_orep *wb_vrepwbl::parent(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepwbl::parent(pwr_tStatus *sts, wb_orep *o)
{
wb_orepwbl *orep = 0;
......@@ -955,7 +955,7 @@ wb_orep *wb_vrepwbl::parent(pwr_tStatus *sts, wb_orep *o) const
return orep;
}
wb_orep *wb_vrepwbl::after(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepwbl::after(pwr_tStatus *sts, wb_orep *o)
{
wb_orepwbl *orep = 0;
......@@ -968,7 +968,7 @@ wb_orep *wb_vrepwbl::after(pwr_tStatus *sts, wb_orep *o) const
return orep;
}
wb_orep *wb_vrepwbl::before(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepwbl::before(pwr_tStatus *sts, wb_orep *o)
{
wb_orepwbl *orep = 0;
......@@ -982,7 +982,7 @@ wb_orep *wb_vrepwbl::before(pwr_tStatus *sts, wb_orep *o) const
return orep;
}
wb_orep *wb_vrepwbl::first(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepwbl::first(pwr_tStatus *sts, wb_orep *o)
{
wb_orepwbl *orep = 0;
......@@ -996,12 +996,12 @@ wb_orep *wb_vrepwbl::first(pwr_tStatus *sts, wb_orep *o) const
return orep;
}
wb_orep *wb_vrepwbl::child(pwr_tStatus *sts, wb_orep *o, char *name) const
wb_orep *wb_vrepwbl::child(pwr_tStatus *sts, wb_orep *o, char *name)
{
return 0;
}
wb_orep *wb_vrepwbl::last(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepwbl::last(pwr_tStatus *sts, wb_orep *o)
{
wb_orepwbl *orep = 0;
......@@ -1017,12 +1017,12 @@ wb_orep *wb_vrepwbl::last(pwr_tStatus *sts, wb_orep *o) const
return orep;
}
wb_orep *wb_vrepwbl::next(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepwbl::next(pwr_tStatus *sts, wb_orep *o)
{
return 0;
}
wb_orep *wb_vrepwbl::previous(pwr_tStatus *sts, wb_orep *o) const
wb_orep *wb_vrepwbl::previous(pwr_tStatus *sts, wb_orep *o)
{
return 0;
}
......
......@@ -150,23 +150,23 @@ public:
bool writeBody() {return false;};
wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o) const;
wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o);
wb_orep *parent(pwr_tStatus *sts, wb_orep *o) const;
wb_orep *parent(pwr_tStatus *sts, wb_orep *o);
wb_orep *after(pwr_tStatus *sts, wb_orep *o) const;
wb_orep *after(pwr_tStatus *sts, wb_orep *o);
wb_orep *before(pwr_tStatus *sts, wb_orep *o) const;
wb_orep *before(pwr_tStatus *sts, wb_orep *o);
wb_orep *first(pwr_tStatus *sts, wb_orep *o) const;
wb_orep *first(pwr_tStatus *sts, wb_orep *o);
wb_orep *child(pwr_tStatus *sts, wb_orep *o, char *name) const;
wb_orep *child(pwr_tStatus *sts, wb_orep *o, char *name);
wb_orep *last(pwr_tStatus *sts, wb_orep *o) const;
wb_orep *last(pwr_tStatus *sts, wb_orep *o);
wb_orep *next(pwr_tStatus *sts, wb_orep *o) const;
wb_orep *next(pwr_tStatus *sts, wb_orep *o);
wb_orep *previous(pwr_tStatus *sts, wb_orep *o) const;
wb_orep *previous(pwr_tStatus *sts, wb_orep *o);
wb_srep *newSession() {return 0;};
......
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