Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PacketLib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andrea Bulgarelli
PacketLib
Commits
c8e04e51
Commit
c8e04e51
authored
10 years ago
by
Andrea Zoli
Browse files
Options
Downloads
Patches
Plain Diff
Fix metadata loading for rblocks with a fixed number of instances.
parent
66b8339c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/SDFBlock.cpp
+38
-43
38 additions, 43 deletions
src/SDFBlock.cpp
with
38 additions
and
43 deletions
src/SDFBlock.cpp
+
38
−
43
View file @
c8e04e51
...
...
@@ -101,51 +101,46 @@ void SDFBlockType::loadType(pugi::xml_node node, const pugi::xml_document& doc,
throw
new
PacketExceptionFileFormat
(
"Too many number of blocks in the packet type."
);
maxNumberOfBlock
[
i
]
=
atoi
(
nblocks
);
if
(
!
idref
)
{
stringstream
ss
;
ss
<<
"idref attribute not defined for rblock"
<<
rbNode
.
attribute
(
"name"
).
value
();
throw
new
PacketExceptionFileFormat
(
ss
.
str
().
c_str
());
}
if
(
idref
)
{
string
query
=
string
(
"//field[@id=
\"
"
)
+
idref
.
value
()
+
"
\"
]"
;
pugi
::
xml_node
numberofblocksid
=
doc
.
select_nodes
(
query
.
c_str
())[
0
].
node
();
pugi
::
xml_node
nodetmp
=
rbNode
;
unsigned
int
level
=
0
;
while
(
nodetmp
.
parent
()
!=
numberofblocksid
.
parent
())
{
while
(
nodetmp
.
parent
()
!=
numberofblocksid
.
parent
())
{
// if the parent is a packet means that the id is not in the fixed part of the
// recursive rblocks nor the sourcedatafield. So test the datafieldheader
// and header, otherwise complain.
if
(
string
(
nodetmp
.
parent
().
name
()).
compare
(
"packet"
)
==
0
)
{
if
(
string
(
nodetmp
.
parent
().
name
()).
compare
(
"packet"
)
==
0
)
{
string
idparentnodename
=
numberofblocksid
.
parent
().
name
();
if
(
idparentnodename
.
compare
(
"datafieldheader"
)
==
0
)
{
if
(
idparentnodename
.
compare
(
"datafieldheader"
)
==
0
)
{
// we have already add 1 level because nodetmp in this case is
// the sourcedatafield node
}
else
if
(
idparentnodename
.
compare
(
"header"
)
==
0
)
{
else
if
(
idparentnodename
.
compare
(
"header"
)
==
0
)
{
// we add just one level for the same reason above
level
++
;
}
else
{
else
{
std
::
stringstream
ss
;
ss
<<
"Error on id association. Id'"
<<
idref
.
value
()
<<
"' doesn't exists. idref defined by rblock '"
<<
rbNode
.
attribute
(
"name"
).
value
()
<<
"'."
;
throw
new
PacketExceptionFileFormat
(
ss
.
str
().
c_str
());
}
break
;
}
level
++
;
nodetmp
=
nodetmp
.
parent
();
}
headerLevelOfNBlockIndex
[
i
]
=
level
;
indexOfNBlock
[
i
]
=
physicalIndex
[
numberofblocksid
];
pugi
::
xml_attribute
offsetAttr
=
numberofblocksid
.
attribute
(
"numberofblocksoffset"
);
}
else
{
headerLevelOfNBlockIndex
[
i
]
=
0
;
indexOfNBlock
[
i
]
=
0
;
}
pugi
::
xml_attribute
offsetAttr
=
rbNode
.
attribute
(
"numberofblocksoffset"
);
const
char
*
offset
;
if
(
offsetAttr
)
offset
=
offsetAttr
.
value
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment