Plug-ins

closed account (S6k9GNh0)
I'm having a serious problem with finding documentation on anything to do with concepts. I'm still trying to make an outline of my audio converter and I figured that I should add the ability of plugins so I could have third-parties implement whatever they want into and have my program recognize and give the ability to use that third-party implementation. Anyone know anything about this?
documentation on anything to do with concepts
What do you mean? The C++0x construct?

By plugin, I assume you mean a dynamic library which the program can load at run time and call functions from.
Basically, what you do is give your middle-users (plugin developers) a source file that outlines your plugin interface. Such as
1
2
3
4
5
#include "AudioConverterPPI.h"

void plugin_f(int16_t **dst,size_t *dst_l,void *src,size_t src_l){
    //Decompress src into *dst.
}
They will then implement the function and your code will call it whenever your design demands.
It's important to note that if your program exports C++ symbols (classes, functions and globals not declared as extern "C") for the plugin to use the plugin will have to be built by the same compiler that built the program. This is because C++ code compiled by different compilers can't (generally) be linked together. If this is a problem for you, you should make sure that all the code the plugin will need is available at compile time (e.g. by only using inlined functions, templates, or by copy-pasting). This unfortunately not an option for data.
closed account (S6k9GNh0)
Okay. I can understand that much. I've also been told to simple go with a C API for a plugin framework so as to avoid most compatibility problems. I see no problem with that really...
Topic archived. No new replies allowed.