In the process of implementing my python integration I faced a problem. I have class that looks like this:
cdef class SomeClass:
cdef CPPClass* cpp_impl
def some_method(self):
self.cpp_impl.cppMethod()
And I have cpp class that can return CPPClass* value. Smth like this:
class Creator
{
public:
CPPClass* createClass();
}
So I'd like to create SomeClass instance like this:
cdef class PyCreator:
cdef Creator* cpp_impl
def getSomeClass(self):
o = SomeClass()
o.cpp_impl = self.cpp_impl.createClass()
return o
But I'm getting error that cython can't convert CPPClass* to Python object.
How can I solve my problem? Thank you.