You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am in the the case where I have a complex tree of interfaces (only pure virtual methods). I successfully binded all of them.
I have a factory that returns objects that implements any of these interfaces. It is based on dynamic library loading and I can't bind theses implementations.
With the polymorphic_type_hook I detect with dynamic_cast the interface that is implemented by the returned object from the factory.
It works well when the object implements only one interface.
Now, in the case the object implements many interfaces I would like to create a "dynamic" class with the required bases.
In python it would be equivalent to NewClass = type('NewClass', (object,Interface1, Interface2,), {})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am in the the case where I have a complex tree of interfaces (only pure virtual methods). I successfully binded all of them.
I have a factory that returns objects that implements any of these interfaces. It is based on dynamic library loading and I can't bind theses implementations.
With the polymorphic_type_hook I detect with dynamic_cast the interface that is implemented by the returned object from the factory.
It works well when the object implements only one interface.
Now, in the case the object implements many interfaces I would like to create a "dynamic" class with the required bases.
In python it would be equivalent to NewClass = type('NewClass', (object,Interface1, Interface2,), {})
Any idea on how to do this with pybind11 ?
Thanks in advance,
Yannick
Beta Was this translation helpful? Give feedback.
All reactions