Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nett-python
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
nett-python
Commits
16b04ba7
Commit
16b04ba7
authored
9 years ago
by
Christian Nowke
Browse files
Options
Downloads
Patches
Plain Diff
added dependent libraries since this must be a dynamic library
parent
8291b09e
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+13
-6
13 additions, 6 deletions
CMakeLists.txt
src/nett-python/nett-python.cpp
+15
-0
15 additions, 0 deletions
src/nett-python/nett-python.cpp
tests/create_slot.py
+10
-1
10 additions, 1 deletion
tests/create_slot.py
with
38 additions
and
7 deletions
CMakeLists.txt
+
13
−
6
View file @
16b04ba7
...
...
@@ -9,22 +9,27 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++1y"
)
endif
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Linux"
)
set
(
PROTOBUF_BIN
""
CACHE FILEPATH
"The protobuf binary directory for the schema compiler 'protoc'"
)
set
(
PROTOBUF_INCLUDE_DIR
""
CACHE FILEPATH
"The protobuf include directory"
)
set
(
PROTOBUF_BIN
""
CACHE PATH
"The protobuf binary directory for the schema compiler 'protoc'"
)
set
(
PROTOBUF_INCLUDE_DIR
""
CACHE PATH
"The protobuf include directory"
)
set
(
PROTOBUF_LIBRARY
""
CACHE FILEPATH
"The protobuf library to link against"
)
set
(
PROTOBUF_LIBRARY_DEBUG
""
CACHE FILEPATH
"The protobuf library to link against"
)
set
(
BOOST_INCLUDE_DIR
""
CACHE
FILE
PATH
"The boost include path"
)
set
(
BOOST_INCLUDE_DIR
""
CACHE PATH
"The boost include path"
)
set
(
BOOST_PYTHON_LIBRARY
""
CACHE FILEPATH
"The boost python library to link against"
)
set
(
BOOST_PYTHON_LIBRARY_DEBUG
""
CACHE FILEPATH
"The boost python debug library to link against"
)
set
(
PYTHON_INCLUDE_DIR
""
CACHE
FILE
PATH
"The python include path"
)
set
(
PYTHON_INCLUDE_DIR
""
CACHE PATH
"The python include path"
)
set
(
PYTHON_LIBRARY
""
CACHE FILEPATH
"The python library to link against"
)
set
(
PYTHON_LIBRARY_DEBUG
""
CACHE FILEPATH
"The python debug library to link against"
)
set
(
NETT_INCLUDE_DIR
""
CACHE
FILE
PATH
"The nett include path"
)
set
(
NETT_SCHEMA_DIR
""
CACHE
FILE
PATH
"The nett schema path"
)
set
(
NETT_INCLUDE_DIR
""
CACHE PATH
"The nett include path"
)
set
(
NETT_SCHEMA_DIR
""
CACHE PATH
"The nett schema path"
)
set
(
NETT_LIBRARY
""
CACHE FILEPATH
"The nett library to link against"
)
set
(
NETT_LIBRARY_DEBUG
""
CACHE FILEPATH
"The nett debug library to link against"
)
set
(
ZMQ_LIBRARY
""
CACHE FILEPATH
"The zmq library to link against"
)
include
(
"include/nett-python/_SourceFiles.cmake"
)
include
(
"src/nett-python/_SourceFiles.cmake"
)
...
...
@@ -40,6 +45,8 @@ add_library (nett_python SHARED ${ProjectSources})
target_link_libraries
(
nett_python optimized
${
NETT_LIBRARY
}
debug
${
NETT_LIBRARY_DEBUG
}
)
target_link_libraries
(
nett_python optimized
${
PYTHON_LIBRARY
}
debug
${
PYTHON_LIBRARY_DEBUG
}
)
target_link_libraries
(
nett_python optimized
${
BOOST_PYTHON_LIBRARY
}
debug
${
BOOST_PYTHON_LIBRARY_DEBUG
}
)
target_link_libraries
(
nett_python optimized
${
PROTOBUF_LIBRARY
}
debug
${
PROTOBUF_LIBRARY_DEBUG
}
)
target_link_libraries
(
nett_python
${
ZMQ_LIBRARY
}
)
add_event
(
nett_python routing_message
${
NETT_SCHEMA_DIR
}
${
PROJECT_BINARY_DIR
}
)
add_event
(
nett_python string_message
${
NETT_SCHEMA_DIR
}
${
PROJECT_BINARY_DIR
}
)
...
...
This diff is collapsed.
Click to expand it.
src/nett-python/nett-python.cpp
+
15
−
0
View file @
16b04ba7
...
...
@@ -7,11 +7,26 @@
#include
<nett/nett.h>
#include
<memory>
#include
<../schema/string_message.pb.h>
using
namespace
boost
::
python
;
std
::
shared_ptr
<
nett
::
slot_in
<
string_message
>>
create_slot_in_string_message
()
{
return
nett
::
make_slot_in
<
string_message
>
();
}
//nett::make_slot_out<string_message>(const std::string &slot_tag);
BOOST_PYTHON_MODULE
(
nett_python
)
{
def
(
"initialize"
,
&
nett
::
initialize
);
class_
<
nett
::
slot_in
<
string_message
>
,
boost
::
noncopyable
>
(
"slot_in_string"
,
no_init
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/create_slot.py
+
10
−
1
View file @
16b04ba7
import
nett_python
as
nett
nett
.
initialize
(
"
tcp://127.0.0.1:6555
"
)
import
string_message_pb2
nett
.
initialize
(
"
tcp://127.0.0.1:65551
"
)
message
=
string_message_pb2
.
string_message
()
message
.
value
=
'
hi there
'
byte_stream
=
message
.
SerializeToString
()
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