Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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
cpp-libs
Actor Framework
Commits
a754a79f
Commit
a754a79f
authored
Jan 05, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply clang-tidy to codebase
parent
259449c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
src/main.cpp
src/main.cpp
+12
-12
No files found.
src/main.cpp
View file @
a754a79f
...
@@ -359,17 +359,17 @@ public:
...
@@ -359,17 +359,17 @@ public:
oss
<<
"import IPython"
<<
endl
oss
<<
"import IPython"
<<
endl
<<
"c = IPython.Config()"
<<
endl
<<
"c = IPython.Config()"
<<
endl
<<
"c.InteractiveShellApp.exec_lines = ["
<<
endl
<<
"c.InteractiveShellApp.exec_lines = ["
<<
endl
<<
"
\"\"\"
"
<<
R"(""")
"
<<
full_pre_run
<<
full_pre_run
<<
"
\"\"\"
"
<<
endl
<<
R"(""")
"
<<
endl
<<
"]"
<<
endl
<<
"]"
<<
endl
<<
"c.PromptManager.in_template = ' $: '"
<<
endl
<<
"c.PromptManager.in_template = ' $: '"
<<
endl
<<
"c.PromptManager.in2_template = ' -> '"
<<
endl
<<
"c.PromptManager.in2_template = ' -> '"
<<
endl
<<
"c.PromptManager.out_template = ' >> '"
<<
endl
<<
"c.PromptManager.out_template = ' >> '"
<<
endl
<<
"c.display_banner = True"
<<
endl
<<
"c.display_banner = True"
<<
endl
<<
"c.TerminalInteractiveShell.banner1 =
\"\"\"
"
<<
endl
<<
R"(c.TerminalInteractiveShell.banner1 = """)
"
<<
endl
<<
banner
<<
endl
<<
banner
<<
endl
<<
"
\"\"\"
"
<<
endl
<<
R"(""")
"
<<
endl
<<
"IPython.start_ipython(config=c)"
<<
endl
;
<<
"IPython.start_ipython(config=c)"
<<
endl
;
return
oss
.
str
();
return
oss
.
str
();
}
}
...
@@ -396,7 +396,7 @@ private:
...
@@ -396,7 +396,7 @@ private:
template
<
class
T
>
template
<
class
T
>
void
add_cpp
(
std
::
string
py_name
,
std
::
string
cpp_name
,
void
add_cpp
(
std
::
string
py_name
,
std
::
string
cpp_name
,
register_fun
reg
=
&
default_python_class_init
<
T
>
)
{
const
register_fun
&
reg
=
&
default_python_class_init
<
T
>
)
{
if
(
reg
)
if
(
reg
)
register_funs_
.
push_back
([
=
](
pybind11
::
module
&
m
)
{
reg
(
m
,
py_name
);
});
register_funs_
.
push_back
([
=
](
pybind11
::
module
&
m
)
{
reg
(
m
,
py_name
);
});
auto
ptr
=
new
default_cpp_binding
<
T
>
(
py_name
,
reg
!=
nullptr
);
auto
ptr
=
new
default_cpp_binding
<
T
>
(
py_name
,
reg
!=
nullptr
);
...
@@ -448,7 +448,7 @@ void set_py_exception(Ts&&... xs) {
...
@@ -448,7 +448,7 @@ void set_py_exception(Ts&&... xs) {
PyErr_SetString
(
PyExc_RuntimeError
,
oss
.
str
().
c_str
());
PyErr_SetString
(
PyExc_RuntimeError
,
oss
.
str
().
c_str
());
}
}
void
py_send
(
pybind11
::
args
xs
)
{
void
py_send
(
const
pybind11
::
args
&
xs
)
{
if
(
xs
.
size
()
<
2
)
{
if
(
xs
.
size
()
<
2
)
{
set_py_exception
(
"Too few arguments to call CAF.send"
);
set_py_exception
(
"Too few arguments to call CAF.send"
);
return
;
return
;
...
@@ -462,8 +462,8 @@ void py_send(pybind11::args xs) {
...
@@ -462,8 +462,8 @@ void py_send(pybind11::args xs) {
std
::
string
type_name
=
PyEval_GetFuncName
((
*
i
).
ptr
());
std
::
string
type_name
=
PyEval_GetFuncName
((
*
i
).
ptr
());
auto
kvp
=
bindings
.
find
(
type_name
);
auto
kvp
=
bindings
.
find
(
type_name
);
if
(
kvp
==
bindings
.
end
())
{
if
(
kvp
==
bindings
.
end
())
{
set_py_exception
(
"Unable to add element of type
\"
"
,
set_py_exception
(
R"(Unable to add element of type ")
"
,
type_name
,
"
\"
to message: type is unknown to CAF
"
);
type_name
,
R"(" to message: type is unknown to CAF)
"
);
return
;
return
;
}
}
kvp
->
second
->
append
(
mb
,
*
i
);
kvp
->
second
->
append
(
mb
,
*
i
);
...
@@ -478,15 +478,15 @@ pybind11::tuple tuple_from_message(const type_erased_tuple& msg) {
...
@@ -478,15 +478,15 @@ pybind11::tuple tuple_from_message(const type_erased_tuple& msg) {
for
(
size_t
i
=
0
;
i
<
msg
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
msg
.
size
();
++
i
)
{
auto
rtti
=
msg
.
type
(
i
);
auto
rtti
=
msg
.
type
(
i
);
auto
str_ptr
=
self
->
system
().
types
().
portable_name
(
rtti
);
auto
str_ptr
=
self
->
system
().
types
().
portable_name
(
rtti
);
if
(
!
str_
ptr
)
{
if
(
str_ptr
==
null
ptr
)
{
set_py_exception
(
"Unable to extract element #"
,
i
,
" from message: "
,
set_py_exception
(
"Unable to extract element #"
,
i
,
" from message: "
,
"could not get portable name of "
,
rtti
.
second
->
name
());
"could not get portable name of "
,
rtti
.
second
->
name
());
return
{};
return
{};
}
}
auto
kvp
=
bindings
.
find
(
*
str_ptr
);
auto
kvp
=
bindings
.
find
(
*
str_ptr
);
if
(
kvp
==
bindings
.
end
())
{
if
(
kvp
==
bindings
.
end
())
{
set_py_exception
(
"Unable to add element of type
\"
"
,
set_py_exception
(
R"(Unable to add element of type ")
"
,
*
str_ptr
,
"
\"
to message: type is unknown to CAF
"
);
*
str_ptr
,
R"(" to message: type is unknown to CAF)
"
);
return
{};
return
{};
}
}
auto
obj
=
kvp
->
second
->
to_object
(
msg
,
i
);
auto
obj
=
kvp
->
second
->
to_object
(
msg
,
i
);
...
@@ -604,7 +604,7 @@ void caf_main(actor_system& system, const config& cfg) {
...
@@ -604,7 +604,7 @@ void caf_main(actor_system& system, const config& cfg) {
int
py_res
=
0
;
int
py_res
=
0
;
if
(
!
cfg
.
py_file
.
empty
())
{
if
(
!
cfg
.
py_file
.
empty
())
{
auto
fp
=
fopen
(
cfg
.
py_file
.
c_str
()
,
"r"
);
auto
fp
=
fopen
(
cfg
.
py_file
.
c_str
()
,
"r"
);
if
(
!
fp
)
{
if
(
fp
==
nullptr
)
{
cerr
<<
"Unable to open file "
<<
cfg
.
py_file
<<
endl
;
cerr
<<
"Unable to open file "
<<
cfg
.
py_file
<<
endl
;
Py_Finalize
();
Py_Finalize
();
return
;
return
;
...
...
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