Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
effa81d9
Commit
effa81d9
authored
Nov 06, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update classes: attribute references pointing to elements in attributes objects wasn't updated
parent
85866271
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
189 additions
and
72 deletions
+189
-72
wb/lib/wb/src/wb_vrepdb.cpp
wb/lib/wb/src/wb_vrepdb.cpp
+186
-70
wb/lib/wb/src/wb_vrepdb.h
wb/lib/wb/src/wb_vrepdb.h
+3
-2
No files found.
wb/lib/wb/src/wb_vrepdb.cpp
View file @
effa81d9
/*
* Proview $Id: wb_vrepdb.cpp,v 1.5
6 2007-10-19 07:00:02
claes Exp $
* Proview $Id: wb_vrepdb.cpp,v 1.5
7 2007-11-06 13:29:38
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -1746,10 +1746,16 @@ comp_attribute(tree_sTable *tp, tree_sNode *x, tree_sNode *y)
if
(
xp
->
key
.
bix
<
yp
->
key
.
bix
)
return
-
1
;
if
(
xp
->
key
.
oStart
>
yp
->
key
.
o
End
)
if
(
xp
->
key
.
oStart
>
yp
->
key
.
o
Start
)
return
1
;
if
(
xp
->
key
.
oEnd
<
yp
->
key
.
oStart
)
if
(
xp
->
key
.
oStart
<
yp
->
key
.
oStart
)
return
-
1
;
if
(
xp
->
key
.
oEnd
>
yp
->
key
.
oEnd
)
return
1
;
if
(
xp
->
key
.
oEnd
<
yp
->
key
.
oEnd
)
return
-
1
;
return
0
;
...
...
@@ -1841,13 +1847,22 @@ int wb_vrepdb::updateArefs(pwr_tOid oid, pwr_tCid cid)
try
{
pwr_sAttrRef
*
arp
=
(
pwr_sAttrRef
*
)(
p
+
ap
->
key
.
offset
);
if
(
cdh_ObjidIsEqual
(
arp
->
Objid
,
pwr_cNObjid
))
{
ap
=
(
sAref
*
)
tree_FindSuccessor
(
&
sts
,
m_aref_th
,
&
ap
->
key
);
continue
;
}
wb_db_ohead
aohead
(
m_db
,
m_db
->
m_txn
,
arp
->
Objid
);
wb_cdrep
*
n_cdrep
=
m_erep
->
merep
()
->
cdrep
(
&
sts
,
aohead
.
cid
());
wb_bdrep
*
n_bdrep
;
pwr_eBix
bix
=
pwr_eBix_rt
;
if
(
EVEN
(
sts
))
printf
(
"cdrep sts %d"
,
sts
);
else
n_bdrep
=
n_cdrep
->
bdrep
(
&
sts
,
ap
->
key
.
bix
);
else
{
bix
=
(
pwr_eBix
)(
arp
->
Body
&
7
);
if
(
bix
!=
pwr_eBix_dev
)
bix
=
pwr_eBix_rt
;
n_bdrep
=
n_cdrep
->
bdrep
(
&
sts
,
bix
);
}
if
(
EVEN
(
sts
))
{
ap
=
(
sAref
*
)
tree_FindSuccessor
(
&
sts
,
m_aref_th
,
&
ap
->
key
);
continue
;
...
...
@@ -1866,11 +1881,12 @@ int wb_vrepdb::updateArefs(pwr_tOid oid, pwr_tCid cid)
else
{
sAttributeKey
k
;
k
.
cid
=
aohead
.
cid
();
k
.
bix
=
ap
->
key
.
bix
;
k
.
bix
=
bix
;
k
.
oStart
=
arp
->
Offset
;
k
.
oEnd
=
arp
->
Offset
+
arp
->
Size
-
1
;
sAttribute
*
cap
=
(
sAttribute
*
)
tree_Find
(
&
sts
,
m_attribute_th
,
&
k
);
if
(
cap
!=
0
)
{
nAref
[
ap
->
key
.
bix
-
1
]
++
;
if
(
arp
->
Size
>
cap
->
o
.
aref
.
Size
)
{
...
...
@@ -2211,6 +2227,7 @@ void wb_vrepdb::checkAttributes(pwr_tCid cid)
if
(
ODD
(
sts
))
{
wb_bdrep
*
o_bdrep
=
o_cdrep
->
bdrep
(
&
sts
,
bix
);
if
(
ODD
(
sts
))
{
pwr_tCid
body
=
o_cdrep
->
cid
()
|
o_bdrep
->
bix
();
wb_adrep
*
o_adrep
=
o_bdrep
->
adrep
(
&
sts
);
while
(
ODD
(
sts
))
{
...
...
@@ -2218,11 +2235,21 @@ void wb_vrepdb::checkAttributes(pwr_tCid cid)
if
(
o_adrep
->
type
()
==
pwr_eType_AttrRef
)
{
sArefKey
a
;
if
(
o_adrep
->
isArray
())
{
for
(
int
j
=
0
;
j
<
o_adrep
->
nElement
();
j
++
)
{
a
.
cid
=
cid
;
a
.
bix
=
bix
;
a
.
offset
=
o_adrep
->
offset
()
+
j
*
o_adrep
->
size
()
/
o_adrep
->
nElement
();
tree_Insert
(
&
sts
,
m_aref_th
,
&
a
);
}
}
else
{
a
.
cid
=
cid
;
a
.
bix
=
bix
;
a
.
offset
=
o_adrep
->
offset
();
tree_Insert
(
&
sts
,
m_aref_th
,
&
a
);
}
}
// Indentify attribute with the same aix
bool
found
=
false
;
...
...
@@ -2237,32 +2264,67 @@ void wb_vrepdb::checkAttributes(pwr_tCid cid)
delete
prev
;
}
if
(
found
)
{
if
(
(
o_adrep
->
offset
()
!=
n_adrep
->
offset
())
||
if
(
(
o_adrep
->
offset
()
!=
n_adrep
->
offset
())
||
(
o_adrep
->
size
()
!=
n_adrep
->
size
())
||
(
o_adrep
->
type
()
!=
n_adrep
->
type
())
||
//(o_adrep->tid() != n_adrep->tid()) ||
(
o_adrep
->
nElement
()
!=
n_adrep
->
nElement
())
||
(
o_adrep
->
index
()
!=
n_adrep
->
index
())
)
{
(
o_adrep
->
index
()
!=
n_adrep
->
index
()))
{
sAttributeKey
ak
;
sAttribute
*
ap
;
ak
.
cid
=
cid
;
ak
.
bix
=
bix
;
ak
.
oStart
=
o_adrep
->
offset
();
ak
.
oEnd
=
o_adrep
->
offset
()
+
o_adrep
->
size
()
-
1
;
ak
.
oEnd
=
ak
.
oStart
+
o_adrep
->
size
()
-
1
;
ap
=
(
sAttribute
*
)
tree_Insert
(
&
sts
,
m_attribute_th
,
&
ak
);
ap
->
o
.
aref
=
o_adrep
->
aref
();
ap
->
n
.
aref
=
n_adrep
->
aref
();
ap
->
o
.
aix
=
o_adrep
->
aix
();
ap
->
n
.
aix
=
n_adrep
->
aix
();
ap
->
o
.
nElement
=
o_adrep
->
nElement
();
ap
->
n
.
nElement
=
n_adrep
->
nElement
();
if
(
o_adrep
->
isArray
())
{
// Insert each element
for
(
int
j
=
0
;
j
<
MIN
(
o_adrep
->
nElement
(),
n_adrep
->
nElement
());
j
++
)
{
sAttributeKey
ak
;
sAttribute
*
ap
;
int
esize
=
o_adrep
->
size
()
/
o_adrep
->
nElement
();
ak
.
cid
=
cid
;
ak
.
bix
=
bix
;
ak
.
oStart
=
o_adrep
->
offset
()
+
j
*
esize
;
ak
.
oEnd
=
ak
.
oStart
+
esize
-
1
;
ap
=
(
sAttribute
*
)
tree_Insert
(
&
sts
,
m_attribute_th
,
&
ak
);
ap
->
o
.
aref
=
o_adrep
->
aref
();
ap
->
n
.
aref
=
n_adrep
->
aref
();
ap
->
o
.
aref
.
Size
=
o_adrep
->
size
()
/
o_adrep
->
nElement
();
ap
->
n
.
aref
.
Size
=
n_adrep
->
size
()
/
n_adrep
->
nElement
();
ap
->
o
.
aref
.
Offset
+=
j
*
ap
->
o
.
aref
.
Size
;
ap
->
n
.
aref
.
Offset
+=
j
*
ap
->
n
.
aref
.
Size
;
ap
->
n
.
aref
.
Flags
.
b
.
Array
=
0
;
ap
->
o
.
aref
.
Flags
.
b
.
Array
=
0
;
ap
->
o
.
aix
=
o_adrep
->
aix
();
ap
->
n
.
aix
=
n_adrep
->
aix
();
ap
->
o
.
nElement
=
o_adrep
->
nElement
();
ap
->
n
.
nElement
=
n_adrep
->
nElement
();
}
}
}
if
(
o_adrep
->
isClass
()
&&
n_adrep
->
subClass
()
==
o_adrep
->
subClass
())
{
checkSubClass
(
cid
,
o_adrep
->
subClass
(),
o_adrep
->
offset
(),
n_adrep
->
offset
());
if
(
o_adrep
->
isArray
())
{
for
(
int
j
=
0
;
j
<
MIN
(
o_adrep
->
nElement
(),
n_adrep
->
nElement
());
j
++
)
{
checkSubClass
(
cid
,
o_adrep
->
subClass
(),
o_adrep
->
offset
()
+
j
*
o_adrep
->
size
()
/
o_adrep
->
nElement
(),
n_adrep
->
offset
()
+
j
*
n_adrep
->
size
()
/
n_adrep
->
nElement
(),
body
);
}
}
else
checkSubClass
(
cid
,
o_adrep
->
subClass
(),
o_adrep
->
offset
(),
n_adrep
->
offset
(),
body
);
}
delete
n_adrep
;
}
...
...
@@ -2278,7 +2340,8 @@ void wb_vrepdb::checkAttributes(pwr_tCid cid)
}
}
void
wb_vrepdb
::
checkSubClass
(
pwr_tCid
cid
,
pwr_tCid
subcid
,
unsigned
int
o_offset
,
unsigned
int
n_offset
)
void
wb_vrepdb
::
checkSubClass
(
pwr_tCid
cid
,
pwr_tCid
subcid
,
unsigned
int
o_offset
,
unsigned
int
n_offset
,
pwr_tCid
body
)
{
pwr_tStatus
sts
;
wb_cdrep
*
o_cdrep
=
m_merep
->
cdrep
(
&
sts
,
subcid
);
...
...
@@ -2297,6 +2360,7 @@ void wb_vrepdb::checkSubClass(pwr_tCid cid, pwr_tCid subcid, unsigned int o_offs
while
(
ODD
(
sts
))
{
bool
found
=
false
;
wb_adrep
*
n_adrep
=
n_bdrep
->
adrep
(
&
sts
);
while
(
ODD
(
sts
))
{
if
(
o_adrep
->
aix
()
==
n_adrep
->
aix
())
{
...
...
@@ -2308,14 +2372,12 @@ void wb_vrepdb::checkSubClass(pwr_tCid cid, pwr_tCid subcid, unsigned int o_offs
delete
prev
;
}
if
(
found
)
{
if
(
(
o_adrep
->
offset
()
!=
n_adrep
->
offset
())
||
if
(
((
o_adrep
->
offset
()
+
o_offset
)
!=
(
n_adrep
->
offset
()
+
n_offset
))
||
(
o_adrep
->
size
()
!=
n_adrep
->
size
())
||
(
o_adrep
->
type
()
!=
n_adrep
->
type
())
||
//(o_adrep->tid() != n_adrep->tid()) ||
(
o_adrep
->
nElement
()
!=
n_adrep
->
nElement
())
||
(
o_adrep
->
index
()
!=
n_adrep
->
index
()))
{
sAttributeKey
ak
;
sAttribute
*
ap
;
...
...
@@ -2327,22 +2389,76 @@ void wb_vrepdb::checkSubClass(pwr_tCid cid, pwr_tCid subcid, unsigned int o_offs
ap
->
o
.
aref
=
o_adrep
->
aref
();
ap
->
n
.
aref
=
n_adrep
->
aref
();
ap
->
o
.
aref
.
Offset
+=
o_offset
;
ap
->
n
.
aref
.
Offset
+=
n_offset
;
ap
->
o
.
aref
.
Body
=
body
;
ap
->
n
.
aref
.
Body
=
body
;
ap
->
o
.
aix
=
o_adrep
->
aix
();
ap
->
n
.
aix
=
n_adrep
->
aix
();
ap
->
o
.
nElement
=
o_adrep
->
nElement
();
ap
->
n
.
nElement
=
n_adrep
->
nElement
();
if
(
o_adrep
->
isArray
())
{
for
(
int
j
=
0
;
j
<
MIN
(
o_adrep
->
nElement
(),
n_adrep
->
nElement
());
j
++
)
{
int
esize
=
o_adrep
->
size
()
/
o_adrep
->
nElement
();
sAttributeKey
ak
;
sAttribute
*
ap
;
ak
.
cid
=
cid
;
ak
.
bix
=
bix
;
ak
.
oStart
=
o_adrep
->
offset
()
+
o_offset
+
j
*
esize
;
ak
.
oEnd
=
ak
.
oStart
+
esize
-
1
;
ap
=
(
sAttribute
*
)
tree_Insert
(
&
sts
,
m_attribute_th
,
&
ak
);
ap
->
o
.
aref
=
o_adrep
->
aref
();
ap
->
n
.
aref
=
n_adrep
->
aref
();
ap
->
o
.
aref
.
Size
=
o_adrep
->
size
()
/
o_adrep
->
nElement
();
ap
->
n
.
aref
.
Size
=
n_adrep
->
size
()
/
n_adrep
->
nElement
();
ap
->
o
.
aref
.
Offset
+=
o_offset
+
j
*
ap
->
o
.
aref
.
Size
;
ap
->
n
.
aref
.
Offset
+=
n_offset
+
j
*
ap
->
n
.
aref
.
Size
;
ap
->
n
.
aref
.
Flags
.
b
.
Array
=
0
;
ap
->
o
.
aref
.
Flags
.
b
.
Array
=
0
;
ap
->
o
.
aref
.
Body
=
body
;
ap
->
n
.
aref
.
Body
=
body
;
ap
->
o
.
aix
=
o_adrep
->
aix
();
ap
->
n
.
aix
=
n_adrep
->
aix
();
ap
->
o
.
nElement
=
o_adrep
->
nElement
();
ap
->
n
.
nElement
=
n_adrep
->
nElement
();
}
}
}
if
(
o_adrep
->
isClass
()
&&
o_adrep
->
subClass
()
==
n_adrep
->
subClass
())
{
checkSubClass
(
cid
,
n_adrep
->
subClass
(),
o_adrep
->
offset
(),
n_adrep
->
offset
());
}
else
if
(
o_adrep
->
type
()
==
pwr_eType_AttrRef
)
{
if
(
o_adrep
->
isArray
())
{
for
(
int
j
=
0
;
j
<
MIN
(
o_adrep
->
nElement
(),
n_adrep
->
nElement
());
j
++
)
{
checkSubClass
(
cid
,
n_adrep
->
subClass
(),
o_adrep
->
offset
()
+
o_offset
+
j
*
o_adrep
->
size
()
/
o_adrep
->
nElement
(),
n_adrep
->
offset
()
+
n_offset
+
j
*
n_adrep
->
size
()
/
n_adrep
->
nElement
(),
body
);
}
}
else
checkSubClass
(
cid
,
n_adrep
->
subClass
(),
o_adrep
->
offset
()
+
o_offset
,
n_adrep
->
offset
()
+
n_offset
,
body
);
}
else
if
(
o_adrep
->
type
()
==
pwr_eType_AttrRef
)
{
sArefKey
a
;
a
.
cid
=
subcid
;
if
(
o_adrep
->
isArray
())
{
for
(
int
j
=
0
;
j
<
o_adrep
->
nElement
();
j
++
)
{
a
.
cid
=
cid
;
a
.
bix
=
bix
;
a
.
offset
=
o_adrep
->
offse
t
();
a
.
offset
=
o_adrep
->
offset
()
+
o_offset
+
j
*
o_adrep
->
size
()
/
o_adrep
->
nElemen
t
();
tree_Insert
(
&
sts
,
m_aref_th
,
&
a
);
}
}
else
{
a
.
cid
=
cid
;
a
.
bix
=
bix
;
a
.
offset
=
o_adrep
->
offset
()
+
o_offset
;
tree_Insert
(
&
sts
,
m_aref_th
,
&
a
);
}
}
if
(
n_adrep
)
delete
n_adrep
;
}
wb_adrep
*
prev
=
o_adrep
;
...
...
wb/lib/wb/src/wb_vrepdb.h
View file @
effa81d9
/*
* Proview $Id: wb_vrepdb.h,v 1.3
4 2007-10-19 07:00:02
claes Exp $
* Proview $Id: wb_vrepdb.h,v 1.3
5 2007-11-06 13:29:38
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -193,7 +193,8 @@ public:
int
updateArefs
(
pwr_tOid
oid
,
pwr_tCid
cid
);
int
checkClass
(
pwr_tCid
cid
);
void
checkAttributes
(
pwr_tCid
cid
);
void
checkSubClass
(
pwr_tCid
cid
,
pwr_tCid
subcid
,
unsigned
int
o_offset
,
unsigned
int
n_offset
);
void
checkSubClass
(
pwr_tCid
cid
,
pwr_tCid
subcid
,
unsigned
int
o_offset
,
unsigned
int
n_offset
,
pwr_tCid
body
);
//bool classIsChanged(pwr_tCid cid);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment