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
d494fe63
Commit
d494fe63
authored
Jul 27, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warnings on Clang
parent
6e514c60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
src/main.cpp
src/main.cpp
+14
-14
No files found.
src/main.cpp
View file @
d494fe63
...
@@ -542,26 +542,16 @@ std::string to_string(const foo& x) {
...
@@ -542,26 +542,16 @@ std::string to_string(const foo& x) {
}
}
void
register_class
(
foo
*
,
pybind11
::
module
&
m
,
const
std
::
string
&
name
)
{
void
register_class
(
foo
*
,
pybind11
::
module
&
m
,
const
std
::
string
&
name
)
{
std
::
string
(
*
str_fun
)(
const
foo
&
)
=
&
to_string
;
pybind11
::
class_
<
foo
>
(
m
,
name
.
c_str
())
pybind11
::
class_
<
foo
>
(
m
,
name
.
c_str
())
.
def
(
pybind11
::
init
<>
())
.
def
(
pybind11
::
init
<>
())
.
def
(
pybind11
::
init
<
int
,
int
>
())
.
def
(
pybind11
::
init
<
int
,
int
>
())
.
def
(
"__str__"
,
(
std
::
string
(
*
)(
const
foo
&
))
&
to_string
)
.
def
(
"__str__"
,
str_fun
)
.
def
(
"__repr__"
,
(
std
::
string
(
*
)(
const
foo
&
))
&
to_string
)
.
def
(
"__repr__"
,
str_fun
)
.
def_readwrite
(
"x"
,
&
foo
::
x
)
.
def_readwrite
(
"x"
,
&
foo
::
x
)
.
def_readwrite
(
"y"
,
&
foo
::
y
);
.
def_readwrite
(
"y"
,
&
foo
::
y
);
}
}
class
config
:
public
py_config
{
public:
std
::
string
py_file
;
config
()
{
add_message_type
<
foo
>
(
"foo"
);
opt_group
{
custom_options_
,
"python"
}
.
add
(
py_file
,
"file,f"
,
"Run script instead of interactive shell."
);
}
};
#if PY_MAJOR_VERSION == 3
#if PY_MAJOR_VERSION == 3
#define CAF_MODULE_INIT_RES PyObject*
#define CAF_MODULE_INIT_RES PyObject*
#define CAF_MODULE_INIT_RET(res) return res;
#define CAF_MODULE_INIT_RET(res) return res;
...
@@ -570,7 +560,6 @@ public:
...
@@ -570,7 +560,6 @@ public:
#define CAF_MODULE_INIT_RET(unused)
#define CAF_MODULE_INIT_RET(unused)
#endif
#endif
CAF_MODULE_INIT_RES
caf_module_init
()
{
CAF_MODULE_INIT_RES
caf_module_init
()
{
pybind11
::
module
m
(
"CAF"
,
"Python binding for CAF"
);
pybind11
::
module
m
(
"CAF"
,
"Python binding for CAF"
);
s_context
->
cfg
.
py_init
(
m
);
s_context
->
cfg
.
py_init
(
m
);
...
@@ -592,6 +581,17 @@ namespace {
...
@@ -592,6 +581,17 @@ namespace {
using
namespace
caf
;
using
namespace
caf
;
using
namespace
caf
::
python
;
using
namespace
caf
::
python
;
class
config
:
public
py_config
{
public:
std
::
string
py_file
;
config
()
{
add_message_type
<
foo
>
(
"foo"
);
opt_group
{
custom_options_
,
"python"
}
.
add
(
py_file
,
"file,f"
,
"Run script instead of interactive shell."
);
}
};
void
caf_main
(
actor_system
&
system
,
const
config
&
cfg
)
{
void
caf_main
(
actor_system
&
system
,
const
config
&
cfg
)
{
// register system and scoped actor in global variables
// register system and scoped actor in global variables
scoped_actor
self
{
system
};
scoped_actor
self
{
system
};
...
...
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