Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
senf
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
Service Desk
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
wiback
senf
Commits
c5eb706a
Commit
c5eb706a
authored
15 years ago
by
g0dil
Browse files
Options
Downloads
Patches
Plain Diff
PPI: BUGFIX: Duplicate connector registration
parent
0259ca7d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
PPI/Module.cci
+5
-2
5 additions, 2 deletions
PPI/Module.cci
PPI/drawmodules.py
+23
-16
23 additions, 16 deletions
PPI/drawmodules.py
with
28 additions
and
18 deletions
PPI/Module.cci
+
5
−
2
View file @
c5eb706a
...
...
@@ -55,8 +55,11 @@ prefix_ senf::ppi::ModuleManager & senf::ppi::module::Module::moduleManager()
prefix_ void senf::ppi::module::Module::registerConnector(connector::Connector & connector)
{
connectorRegistry_.push_back(&connector);
connector.setModule(*this);
if (std::find(connectorRegistry_.begin(), connectorRegistry_.end(), &connector)
== connectorRegistry_.end()) {
connectorRegistry_.push_back(&connector);
connector.setModule(*this);
}
}
prefix_ senf::ppi::RouteBase &
...
...
This diff is collapsed.
Click to expand it.
PPI/drawmodules.py
+
23
−
16
View file @
c5eb706a
...
...
@@ -6,8 +6,7 @@ mode = "MODULE"
sys
.
stdout
.
write
(
"""
digraph Modules {
node [shape=box, fontsize=10, fontname=
"
Helvetica
"
, height=.2];
edge [labelfontsize=8, labelfontname=
"
Helvetica
"
]
node [shape=Mrecord, fontsize=8, fontname=
"
Helvetica
"
];
"""
)
modules
=
{}
...
...
@@ -19,45 +18,53 @@ for line in sys.stdin:
mode
=
"
MODULE
"
elif
mode
==
"
MODULE
"
:
moduleid
,
module
=
line
.
split
(
'
'
,
1
);
moduleid
=
moduleid
[
1
:]
connectorid
=
type
=
peerid
=
None
modules
[
moduleid
]
=
(
module
,
[]);
mode
=
"
CONNECTOR
"
else
:
connectorid
,
type
=
line
.
split
(
'
'
,
1
);
connectorid
=
connectorid
[
1
:]
elts
=
type
.
rsplit
(
'
'
,
1
);
if
elts
[
-
1
].
startswith
(
'
0x
'
):
type
,
peerid
=
elts
peerid
=
peerid
[
1
:]
else
:
peerid
=
None
modules
[
moduleid
][
1
].
append
((
connectorid
,
type
,
peerid
))
connectors
[
connectorid
]
=
moduleid
for
moduleid
,
(
type
,
cs
)
in
modules
.
iteritems
():
type
=
type
.
split
(
'
<
'
,
1
)[
0
]
type
=
type
.
rsplit
(
'
::
'
,
1
)[
-
1
]
sys
.
stdout
.
write
(
'"
%s
"
[label=
"
%s (%s)
"
]
\n
'
%
(
moduleid
,
type
,
moduleid
))
for
moduleid
,
(
module
,
cs
)
in
modules
.
iteritems
():
module
=
module
.
split
(
'
<
'
,
1
)[
0
]
module
=
module
.
rsplit
(
'
::
'
,
1
)[
-
1
]
inputs
=
[]
outputs
=
[]
for
connectorid
,
type
,
peerid
in
cs
:
if
'
Input
'
in
type
:
inputs
.
append
(
"
<%s>%s
"
%
(
connectorid
,
connectorid
))
else
:
outputs
.
append
(
"
<%s>%s
"
%
(
connectorid
,
connectorid
))
rows
=
[]
if
inputs
:
rows
.
append
(
"
{%s}
"
%
"
|
"
.
join
(
inputs
))
rows
.
append
(
"
%s (%s)
"
%
(
module
,
moduleid
))
if
outputs
:
rows
.
append
(
"
{%s}
"
%
"
|
"
.
join
(
outputs
))
sys
.
stdout
.
write
(
'
%s [label=
"
{%s}
"
]
\n
'
%
(
moduleid
,
"
|
"
.
join
(
rows
)
))
anonid
=
0
for
moduleid
,
(
type
,
cs
)
in
modules
.
iteritems
():
for
connectorid
,
type
,
peerid
in
cs
:
opts
=
[]
if
"
Passive
"
in
type
:
opts
.
append
(
"
arrowtail=odot
"
);
if
peerid
:
opts
.
append
(
'
headlabel=
"
%s
"'
%
peerid
)
opts
.
append
(
'
taillabel=
"
%s
"'
%
connectorid
)
if
"
Passive
"
in
type
:
opts
.
append
(
"
arrowtail=odot
"
);
opts
=
"
,
"
.
join
(
opts
)
if
opts
:
opts
=
"
[%s]
"
%
opts
if
opts
:
opts
=
"
[%s]
"
%
opts
if
"
Output
"
in
type
and
peerid
is
not
None
:
sys
.
stdout
.
write
(
'"
%s
"
->
"
%s
"
%s
\n
'
%
(
moduleid
,
connectors
[
peerid
],
opts
))
sys
.
stdout
.
write
(
'
%s:%s -> %s:%s%s
\n
'
%
(
moduleid
,
connectorid
,
connectors
[
peerid
],
peerid
,
opts
))
elif
peerid
is
None
:
sys
.
stdout
.
write
(
'
anon%d [label=
""
, shape=point, height=.05];
\n
'
%
anonid
)
if
"
Output
"
in
type
:
sys
.
stdout
.
write
(
'
"
%s
"
-> anon%d%s;
\n
'
%
(
moduleid
,
anonid
,
opts
))
sys
.
stdout
.
write
(
'
%s:
%s -> anon%d%s;
\n
'
%
(
moduleid
,
connectorid
,
anonid
,
opts
))
else
:
sys
.
stdout
.
write
(
'
anon%d ->
"
%s
"
%s;
\n
'
%
(
anonid
,
moduleid
,
opts
))
sys
.
stdout
.
write
(
'
anon%d ->
%s:
%s%s;
\n
'
%
(
anonid
,
moduleid
,
connectorid
,
opts
))
anonid
+=
1
sys
.
stdout
.
write
(
"
}
\n
"
)
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