def execute(self, space, cppmethod, cppthis, num_args, args): vptr = capi.c_call_r(space, cppmethod, cppthis, num_args, args) ccp = rffi.cast(rffi.CCHARP, vptr) if ccp == rffi.cast(rffi.CCHARP, 0): return space.newbytes("") result = rffi.charp2str(ccp) # TODO: make it a choice to free return space.newtext(result)
def execute(self, space, cppmethod, cppthis, num_args, args): if hasattr(space, "fake"): raise NotImplementedError address = capi.c_call_r(space, cppmethod, cppthis, num_args, args) ipv = rffi.cast(rffi.UINTPTR_T, address) if ipv == rffi.cast(rffi.UINTPTR_T, 0): from pypy.module._cppyy import interp_cppyy return interp_cppyy.get_nullptr(space) shape = letter2tp(space, self.typecode) return lowlevelviews.W_LowLevelView(space, shape, sys.maxint / shape.size, ipv)
def execute(self, space, cppmethod, cppthis, num_args, args): from pypy.module._cppyy import interp_cppyy voidp_result = capi.c_call_r(space, cppmethod, cppthis, num_args, args) ref_address = rffi.cast(rffi.VOIDPP, voidp_result) ptr_result = rffi.cast(capi.C_OBJECT, ref_address[0]) return interp_cppyy.wrap_cppobject(space, ptr_result, self.cppclass)
def execute(self, space, cppmethod, cppthis, num_args, args): result = capi.c_call_r(space, cppmethod, cppthis, num_args, args) return self._wrap_reference(space, rffi.cast(self.c_ptrtype, result))
def execute(self, space, cppmethod, cppthis, num_args, args): presult = capi.c_call_r(space, cppmethod, cppthis, num_args, args) ref = rffi.cast(rffi.VOIDPP, presult) return self._wrap_result(space, rffi.cast(capi.C_OBJECT, ref[0]))
def execute(self, space, cppmethod, cppthis, num_args, args): if hasattr(space, "fake"): raise NotImplementedError vptr = capi.c_call_r(space, cppmethod, cppthis, num_args, args) return self.wrap_result(space, vptr)
def execute(self, space, cppmethod, cppthis, num_args, args): cmplx = capi.c_call_r(space, cppmethod, cppthis, num_args, args) return self._convert2complex(space, rffi.cast(capi.C_OBJECT, cmplx))
def execute(self, space, cppmethod, cppthis, num_args, args): vptr = capi.c_call_r(space, cppmethod, cppthis, num_args, args) return self._wrap_result(space, rffi.cast(capi.C_OBJECT, vptr))