Allowing natural assignment from C++ data type to Python data types and vice-versa is very important for seamless embedding of Python inside C++ Sigverse code To allow this kind of natural assignment, boost.python provides a system for registering converters between the languages
The aim of this tutorial is to show:
For instance, assigning an STL string to a python object looks like this:
Likewise, it is also important to be able to extract C++ objects from Python objects. Boost.python provides the extract type for this:
Please use the following code for onAction() function by using the complete code provided in the previous tutorial.
Please use the world file and Makefile provided in previous tutorial and use
$make $sigserver.sh -w ./WorldSample.xml -p write_your_port_number
After the world file loads into sigviewer please push "Start". You shall see the following output in console
42 100 142
This shows that aim of this tutorial to use boost converters from C++ to Python and vice versa have been accomplished.
If someone wants an advanced reference, please refer the following tutorial on how to write boost converters.