It provides Python code into C++ while preserving the structure of the code.
- Calling functions.
- Calling classes.
- Calling class methods.
- Calling class static methods.
- Types conversion from Python to C++ and backwards.
Function arguments can be represented by bool, char, int, double(also pointers of those types), and also const char*.
Function return value can be converted to types which described above(except pointers) and also in std::multimap if python method returning dictionary value.
Python file:
class A: def doSomething(self, value: int) -> int: return value
And it needs to be run in C++ code:
class A : private Class { public: int doSomething(int value); } int A::doSomething(int value) { Function::Arguments arg(value); return this->callMethod("doSomething", arg).ToLong(); } int main() { A* instance = new A(); std::cout << instance->doSomething(777) << std::endl; //It will print 777. }