TÖRÖK Attila
TÖRÖK Attila
Fortunately, in our case, we control the construction of the objects of interest (through the usual factory pattern), so we can wrap the instance methods after the fact to set...
My current solution looks something like this: ```python def iscppinstance(obj, typestring): return typestring in str(type(obj)) iscppinstance(cppyy.gbl.numbers, "cppyy.gbl.std.vector") #: True ``` It ... is not ideal. Is there a better way?
> A trivial solution could be to add a magic variable linking back to the original factory object? E.g. __cpp_template__ which would then be said cppyy.gbl.std.vector. Would that work? Yes,...
> To nonify the pointer held, there needs to be a callback from C++ into cppyy's memory regulator. These [hooks exist](https://github.com/wlav/CPyCppyy/blob/master/src/MemoryRegulator.h#L15), but require the C++ framework to use them. However,...
> In Python, yes; but in C++, no ... Ooh, that's... too bad. :/
> That's an issue unique to global variable pointers: Ah, I did not know that. And indeed, switching to this now works fine: ```python import cppyy cppyy.cppdef( """ // [...]...
I still don't know how to call `cppyy.ll.dynamic_cast` properly. The problem is, that I'm _actually_ getting the object to downcast via its pointer from C++, passed across the language boundary...
The line above gave me this error: ``` TypeError: Could not find "cppyy_reinterpret_cast" (set cppyy.set_debug() for C++ errors): Failed to instantiate "cppyy_reinterpret_cast(B&)" ``` I found no way to refer to...
Ah, yes, the key is this: `intptr_t makeAB()`. When I already have a wrapped `A` object (because I return a typed pointer from `makeAB` instead of an integer address from...
Hmm, I see... :/ Are you aware of any plans or effort adding this to Cling?