In our company we’re using a plugin system that I’ve written using QT plugin system.
Each plugin has “needed functions” and “own functions” so, if a plugin needs a function called *func_1*, there must be a plugin that has a function called *func_1*.
This works great, but now I have a problem: a plugin needs to know the pointer to a certain class object that another plugin uses but that is external. I cannot put any kind of information about this class in the plugins interface as it has nothing to do with it.
The only solution I have, is to write a interface function with which I can pass void pointers, but I’d like to know if there’s other solutions maybe less C style.
Thanks in advance.
The modern C++ “replacement” for a void-pointer is something like Boost.Any. It’ll allow you to pass anything through the interface, and still gives you a certain type-safety.