Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
b3f5cdff
Commit
b3f5cdff
authored
Jun 13, 2019
by
gsamain
Committed by
Xavier Thompson
Aug 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaner construction of reifying classes
parent
eeae4572
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-5
Cython/Utility/CyObjects.cpp
Cython/Utility/CyObjects.cpp
+4
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
b3f5cdff
...
...
@@ -1240,20 +1240,17 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
arg_codes
.
append
(
arg_constructor_code
)
arg_names
.
append
(
arg
.
name
)
arg_cnames
.
append
(
arg
.
cname
)
# Putting them into constructor
constructor_args_declaration
=
", "
.
join
(
arg_codes
)
initializer_list
=
[
"%s(%s)"
%
(
cname
,
name
)
for
name
,
cname
in
zip
(
arg_names
,
arg_cnames
)]
constructor_initializer_list_declaration
=
", "
.
join
(
initializer_list
)
code
.
putln
(
"%s(%s) :
%s {
"
%
(
code
.
putln
(
"%s(%s) :
ActhonMessageInterface(sync_method, result_object), %s {}
"
%
(
constructor_name
,
constructor_args_declaration
,
constructor_initializer_list_declaration
))
# FIXME: it would be cleaner to be able to have a bare C++ two-args constructor for ActhonMessageInterface
code
.
putln
(
"this->_sync_method = sync_method;"
)
code
.
putln
(
"this->_result = result_object;"
)
code
.
putln
(
"}"
)
code
.
putln
(
"int activate() {"
)
code
.
putln
(
"/* Activate only if its sync object agrees to do so */"
)
code
.
putln
(
"if (this->_sync_method != NULL and !this->_sync_method->isActivable()) {"
)
...
...
Cython/Utility/CyObjects.cpp
View file @
b3f5cdff
...
...
@@ -96,6 +96,10 @@
ActhonSyncInterface
*
_sync_method
;
ActhonResultInterface
*
_result
;
virtual
int
activate
()
=
0
;
ActhonMessageInterface
(
ActhonSyncInterface
*
sync_method
,
ActhonResultInterface
*
result_object
)
:
_sync_method
(
sync_method
),
_result
(
result_object
)
{}
};
struct
ActhonQueueInterface
:
CyObject
{
...
...
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