Plug-in systems in C++ are hard because the ABI is not properly defined, and each compiler (or version thereof) follows its own rules. However, COM on Windows shows that it's possible to create a minimal plug-in system that allows programmers with different compilers to create plug-ins for a host application using a simple interface.
Let's be practical, and leave the C++ standard, which is not very helpful in this respect, aside for a minute. If I want to write an app for Windows and Mac (and optionally Linux) that supports C++ plug-ins, and if I want to give plug-in authors a reasonably large choice of compilers (say less than 2 year old versions of Visual C++, GCC or Intel's C++ compiler), what features of C++ could I count on?
Of course, I assume that plug-ins would be written for a specific platform.
Off the top of my head, here are some C++ features I can think of, with what I think is the answer:
I would appreciate any experience you have in that area that you could share. If you know of any moderately successful app that has a C++ plug-in system, that's cool too.
Carl
Furthermore, while 'Schuko' plugs may come with earthing strips located on their sides, they are not safe for use in Singapore as the earthing strips cannot make contact with the earth contact of a local mains socket.
You can use all your equipment in Singapore if the outlet voltage in your own country is between 220V-240V. This is the case in most of Europe, Australia, the United Kingdom and most countries in Africa and Asia.
This electrical socket is common in: GB, Ireland, Cyprus, Malta, Malaysia, Singapore, Hong Kong, ... The Type G plug has three rectangular pins in a triangular pattern and includes a fuse (usually a 3A fuse for smaller appliances, such as computers, or a 13A fuse for larger appliances, such as heaters).
Dr Dobb's Journal has an article Building Your Own Plugin Framework: Part 1 which is pretty good reading on the subject. It is the start of a series of articles which covers the architecture, development, and deployment of a C/C++ cross-platform plugin framework.
You might also want to consider replacing the conventional plugin interface by a scripting interface. There are some very good bindings for several scripting languages in C/C++ that have already solved your problem. It might not be a bad idea to build on top of them. For example, have a look at Boost.Python.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With