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
557b1a87
Commit
557b1a87
authored
Jul 12, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix in update classes, all attrrefs wasn't updated
parent
049818cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
32 deletions
+52
-32
wb/lib/wb/src/wb_vrepdb.cpp
wb/lib/wb/src/wb_vrepdb.cpp
+52
-32
No files found.
wb/lib/wb/src/wb_vrepdb.cpp
View file @
557b1a87
/*
* Proview $Id: wb_vrepdb.cpp,v 1.5
2 2007-06-18 06:23:06
claes Exp $
* Proview $Id: wb_vrepdb.cpp,v 1.5
3 2007-07-12 12:20:15
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -78,6 +78,8 @@ typedef struct sClass
pwr_tObjName
name
;
pwr_tTime
o_time
;
pwr_tTime
n_time
;
size_t
o_rbsize
;
size_t
n_rbsize
;
pwr_tUInt32
count
;
}
sClass
;
...
...
@@ -1776,6 +1778,7 @@ int wb_vrepdb::updateArefs(pwr_tOid oid, pwr_tCid cid)
{
pwr_tStatus
sts
;
sArefKey
ak
;
int
nAref
[
2
]
=
{
0
,
0
};
int
rbSize
=
0
;
int
dbSize
=
0
;
...
...
@@ -1835,37 +1838,51 @@ int wb_vrepdb::updateArefs(pwr_tOid oid, pwr_tCid cid)
if
(
EVEN
(
sts
))
printf
(
"n_cdrep sts %d"
,
sts
);
wb_bdrep
*
n_bdrep
=
n_cdrep
->
bdrep
(
&
sts
,
ap
->
key
.
bix
);
if
(
EVEN
(
sts
))
printf
(
"n_bdrep sts %d"
,
sts
);
sAttributeKey
k
;
k
.
cid
=
aohead
.
cid
();
k
.
bix
=
ap
->
key
.
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
)
{
arp
->
Offset
=
0
;
arp
->
Size
=
n_bdrep
->
size
();
}
else
if
(
arp
->
Offset
==
cap
->
o
.
aref
.
Offset
&&
arp
->
Size
==
cap
->
o
.
aref
.
Size
)
{
arp
->
Offset
=
cap
->
n
.
aref
.
Offset
;
arp
->
Size
=
cap
->
n
.
aref
.
Size
;
}
else
if
(
cap
->
o
.
aref
.
Flags
.
b
.
Array
)
{
pwr_tUInt32
oElementSize
=
cap
->
o
.
aref
.
Size
/
cap
->
o
.
nElement
;
pwr_tUInt32
oOffset
=
arp
->
Offset
-
cap
->
o
.
aref
.
Offset
;
pwr_tUInt32
index
=
oOffset
/
oElementSize
;
pwr_tUInt32
nElementSize
=
cap
->
n
.
aref
.
Size
/
cap
->
n
.
nElement
;
if
(
index
>=
cap
->
n
.
nElement
)
{
index
=
cap
->
n
.
nElement
-
1
;
}
arp
->
Offset
=
cap
->
n
.
aref
.
Offset
+
(
index
*
nElementSize
);
arp
->
Size
=
nElementSize
;
}
}
if
(
EVEN
(
sts
))
{
ap
=
(
sAref
*
)
tree_FindSuccessor
(
&
sts
,
m_aref_th
,
&
ap
->
key
);
continue
;
}
if
(
arp
->
Flags
.
b
.
Object
)
{
// Check if rbody size of changed
pwr_tCid
cid
=
aohead
.
cid
();
sClass
*
cp
=
(
sClass
*
)
tree_Find
(
&
sts
,
m_class_th
,
&
cid
);
if
(
cp
&&
cp
->
n_rbsize
!=
cp
->
o_rbsize
)
{
arp
->
Size
=
cp
->
n_rbsize
;
nAref
[
ap
->
key
.
bix
-
1
]
++
;
}
}
else
{
sAttributeKey
k
;
k
.
cid
=
aohead
.
cid
();
k
.
bix
=
ap
->
key
.
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
)
{
arp
->
Offset
=
0
;
arp
->
Size
=
n_bdrep
->
size
();
}
else
if
(
arp
->
Offset
==
cap
->
o
.
aref
.
Offset
&&
arp
->
Size
==
cap
->
o
.
aref
.
Size
)
{
arp
->
Offset
=
cap
->
n
.
aref
.
Offset
;
arp
->
Size
=
cap
->
n
.
aref
.
Size
;
}
else
if
(
cap
->
o
.
aref
.
Flags
.
b
.
Array
)
{
pwr_tUInt32
oElementSize
=
cap
->
o
.
aref
.
Size
/
cap
->
o
.
nElement
;
pwr_tUInt32
oOffset
=
arp
->
Offset
-
cap
->
o
.
aref
.
Offset
;
pwr_tUInt32
index
=
oOffset
/
oElementSize
;
pwr_tUInt32
nElementSize
=
cap
->
n
.
aref
.
Size
/
cap
->
n
.
nElement
;
if
(
index
>=
cap
->
n
.
nElement
)
{
index
=
cap
->
n
.
nElement
-
1
;
}
arp
->
Offset
=
cap
->
n
.
aref
.
Offset
+
(
index
*
nElementSize
);
arp
->
Size
=
nElementSize
;
}
}
}
}
catch
(
DbException
&
e
)
{
//printf("DbException vrepdb updateArefs 2: %s, oid: %d.%d, cid: %d \n", e.what(), oid.vid, oid.oix, cid);
}
catch
(
wb_error
&
e
)
{
...
...
@@ -1928,6 +1945,8 @@ pwr_tStatus wb_vrepdb::updateMeta()
pwr_tCid
cid
=
ip
.
cid
();
sClass
*
cp
=
(
sClass
*
)
tree_Find
(
&
sts
,
m_class_th
,
&
cid
);
nAref
+=
updateArefs
(
ip
.
oid
(),
ip
.
cid
());
if
(
!
cp
)
continue
;
...
...
@@ -1936,7 +1955,6 @@ pwr_tStatus wb_vrepdb::updateMeta()
if
(
time_IsNull
(
&
cp
->
n_time
))
continue
;
nAref
+=
updateArefs
(
ip
.
oid
(),
ip
.
cid
());
nObject
+=
updateObject
(
ip
.
oid
(),
ip
.
cid
());
}
}
catch
(
DbException
&
e
)
{
...
...
@@ -2043,6 +2061,8 @@ wb_vrepdb::checkClass(pwr_tCid cid)
sClass
*
ccp
=
(
sClass
*
)
tree_Insert
(
&
sts
,
m_class_th
,
&
cid
);
ccp
->
o_time
=
o_time
;
ccp
->
n_time
=
n_time
;
ccp
->
o_rbsize
=
o_crep
->
size
(
pwr_eBix_rt
);
ccp
->
n_rbsize
=
n_crep
->
size
(
pwr_eBix_rt
);
strcpy
(
ccp
->
name
,
o_crep
->
name
());
return
1
;
...
...
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